:root {
  --bg-dark: #090d16;
  --panel-bg: #0f172a;
  --card-bg: #1e293b;
  --card-bg-light: #334155;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --border-light: #334155;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  user-select: none;
}

body {
  display: flex;
  flex-direction: column;
}

header {
  background-color: var(--panel-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.brand-title h1 {
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #818cf8, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-title p {
  font-size: 10px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.divider {
  width: 1px;
  height: 16px;
  background-color: var(--border-light);
  margin: 0 4px;
}

button,
select {
  font-family: inherit;
  font-size: 12px;
  color: var(--text-main);
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

button:hover,
select:hover {
  background-color: var(--card-bg-light);
}

button.btn-accent {
  background-color: var(--accent);
  border-color: var(--accent);
  font-weight: 500;
}

button.btn-accent:hover {
  background-color: var(--accent-hover);
}

button.btn-success {
  background-color: #059669;
  border-color: #059669;
  font-weight: 500;
}

button.btn-success:hover {
  background-color: #10b981;
}

button.btn-icon {
  padding: 6px;
  width: 28px;
  height: 28px;
  justify-content: center;
}

select {
  outline: none;
  cursor: pointer;
}

input[type='number'] {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-light);
  color: #818cf8;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 12px;
  width: 50px;
  text-align: right;
}

input[type='range'] {
  accent-color: var(--accent);
  height: 4px;
  background: var(--card-bg-light);
  border-radius: 4px;
  cursor: pointer;
}

input[type='color'] {
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.project-nav,
.morph-library-nav {
  position: relative;
  display: inline-flex;
}
.project-menu {
  position: fixed;
  top: 52px;
  right: 12px;
  min-width: 245px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 6px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-light);
  border-radius: 9px;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.project-menu.hidden {
  display: none !important;
}
.project-menu button {
  width: 100%;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  padding: 8px 9px;
}
.project-menu button:hover {
  background: var(--card-bg-light);
}
.menu-separator {
  height: 1px;
  background: var(--border-light);
  margin: 4px 2px;
}
.project-menu .menu-section-separator {
  height: 0;
  background: none;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.52);
  margin: 8px 4px;
  pointer-events: none;
}
.library-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 18px;
}
.library-modal.hidden {
  display: none !important;
}
.library-card {
  width: min(720px, calc(100vw - 30px));
  max-height: min(620px, calc(100vh - 36px));
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.library-head {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}
.library-tabs {
  display: flex;
  gap: 4px;
  padding: 7px;
  border-bottom: 1px solid var(--border-color);
}
.library-tab {
  flex: 1;
  justify-content: center;
}
.library-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.library-list {
  overflow: auto;
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.library-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid var(--border-light);
  border-radius: 7px;
}
.library-item .library-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-item small {
  color: var(--text-muted);
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.random-settings-panel {
  overflow-y: auto;
}
.morph-setting-row label {
  min-width: 0;
}
.morph-setting-row select {
  min-width: 0 !important;
  max-width: 240px;
}
@media (max-width: 1050px) {
  .brand-title p {
    display: none;
  }
  .preset-nav select {
    min-width: 145px;
  }
  aside {
    width: 330px;
  }
}
@media (max-height: 620px) {
  .morph-settings-panel,
  .random-settings-panel {
    top: 48px;
    max-height: calc(100vh - 56px);
    padding: 7px;
  }
  .morph-setting-row {
    min-height: 24px;
    padding: 3px 6px;
  }
  .morph-settings-grid {
    gap: 3px;
  }
}
@media (max-width: 820px) {
  aside {
    width: 300px;
  }
  .header-actions {
    gap: 4px;
  }
  .preset-nav select {
    min-width: 120px;
    max-width: 150px;
  }
  .project-menu,
  .morph-library-nav .project-menu {
    right: 12px;
    max-width: calc(100vw - 24px);
  }
}

.app-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

aside {
  width: 360px;
  background-color: rgba(15, 23, 42, 0.95);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 10;
  flex-shrink: 0;
  box-shadow: 10px 0 25px rgba(0, 0, 0, 0.5);
}

.section-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--panel-bg);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.badge {
  background-color: var(--card-bg);
  color: #818cf8;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-family: monospace;
}

#layerList {
  max-height: 140px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: rgba(9, 13, 22, 0.4);
  border-bottom: 1px solid var(--border-color);
}

.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background-color: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.layer-item.active {
  background-color: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.6);
  color: var(--text-main);
}

.layer-item.selected {
  background-color: rgba(14, 165, 233, 0.1);
  border-color: rgba(56, 189, 248, 0.48);
  color: var(--text-main);
}
.layer-item.selected.active {
  background-color: rgba(99, 102, 241, 0.22);
  border-color: rgba(129, 140, 248, 0.82);
  box-shadow: inset 3px 0 0 rgba(56, 189, 248, 0.8);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-group {
  background-color: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.row-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.row-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.row-inputs input[type='range'] {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
}

.control-row > input[type='range'] {
  width: 100%;
  min-width: 0;
  display: block;
}

.chaos-star-toggle-row,
.geometry-circles-row {
  border: 1px solid rgba(99, 102, 241, 0.26);
  background: rgba(15, 23, 42, 0.42);
  border-radius: 7px;
  padding: 8px;
}
.chaos-star-head,
.geometry-circles-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chaos-star-head > label,
.geometry-circles-head > label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-main);
}
.chaos-star-head input[type='checkbox'],
.geometry-circles-head input[type='checkbox'],
.geometry-circle-modes input[type='checkbox'] {
  accent-color: var(--accent);
}
.chaos-star-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.chaos-star-settings.hidden,
.geometry-circle-modes.hidden {
  display: none !important;
}
.chaos-star-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font-size: 9px;
  color: var(--text-muted);
}
.chaos-star-field input[type='number'] {
  width: 100% !important;
  text-align: center;
}
.chaos-regenerate-btn {
  min-width: 30px;
  width: 30px;
  height: 26px;
  padding: 0;
  justify-content: center;
  font-size: 16px;
}
.geometry-circle-modes {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.geometry-circle-modes label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 5px;
  border: 1px solid rgba(51, 65, 85, 0.62);
  background: rgba(30, 41, 59, 0.36);
  font-size: 9px;
  color: var(--text-muted);
  cursor: pointer;
}

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

.btn-group-toggle {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background-color: var(--panel-bg);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.btn-group-toggle button {
  background: transparent;
  border: none;
  padding: 4px 0;
  font-size: 10px;
  text-align: center;
  border-radius: 4px;
  color: var(--text-muted);
}

.btn-group-toggle button.active {
  background-color: var(--accent);
  color: white;
}

.profile-canvas-container {
  position: relative;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

#profileCanvas {
  width: 100%;
  height: 160px;
  display: block;
  cursor: crosshair;
}

.profile-overlay-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 2px;
  background-color: rgba(15, 23, 42, 0.8);
  padding: 2px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.profile-overlay-controls button {
  padding: 2px 6px;
  height: 22px;
  font-size: 10px;
  background: transparent;
  border: none;
}

.color-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.profile-library-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  min-width: 0;
  margin-bottom: 5px;
}
.profile-library-tab {
  min-width: 0;
  min-height: 30px;
  padding: 3px 2px;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.05;
  font-size: 8.5px;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.68);
  border-color: var(--border-light);
}
.profile-library-tab.active {
  color: #e0f2fe;
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(129, 140, 248, 0.62);
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.12);
}
#profilePresetSelect {
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease;
}

.profile-spline-render-row {
  margin-top: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.profile-spline-render-row > span:first-child {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

#wholeCurveSplineRow {
  cursor: pointer;
  margin-top: 6px;
  gap: 9px;
  font-size: 12px;
  color: var(--text-main, #cbd5e1);
}
#wholeCurveSplineRow input[type='checkbox'] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: #ed4899;
}
#wholeCurveSplineRow:has(input:disabled) {
  opacity: 0.65;
}
.profile-mode-transition-row {
  margin-top: 6px;
}
.profile-mode-transition-row .profile-spline-render-switch {
  max-width: none;
}
.profile-spline-render-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 2px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.58);
}
.profile-spline-render-switch button {
  min-width: 0;
  padding: 4px 5px;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
}
.profile-spline-render-switch button.active {
  color: #fff;
  background: var(--accent);
}
.profile-spline-point-editor {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
}
.profile-spline-point-editor input[type='number'] {
  width: 50px !important;
  height: 24px;
  padding: 2px 4px !important;
  text-align: center !important;
  color: #a5b4fc !important;
}
#profilePresetSelect.family-triangle {
  background: #5a4a14;
  border-color: #a88519;
  color: #fff4b0;
}
#profilePresetSelect.family-square {
  background: #55262b;
  border-color: #9f3b45;
  color: #ffe0e3;
}
#profilePresetSelect.family-sine {
  background: #173b61;
  border-color: #2d6fa8;
  color: #d9efff;
}
#profilePresetSelect option.profile-family-triangle {
  background: #5a4a14;
  color: #fff4b0;
}
#profilePresetSelect option.profile-family-square {
  background: #55262b;
  color: #ffe0e3;
}
#profilePresetSelect option.profile-family-sine {
  background: #173b61;
  color: #d9efff;
}
#profilePresetSelect option.profile-library-placeholder {
  background: #111827;
  color: #94a3b8;
}
.profile-family-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 8px;
  color: var(--text-muted);
}
.profile-family-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.profile-family-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.profile-family-legend .tri i {
  background: #d9ad26;
}
.profile-family-legend .sq i {
  background: #cf4b58;
}
.profile-family-legend .sin i {
  background: #3f8fd0;
}

main {
  flex: 1;
  position: relative;
  background-color: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.grid-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#1e293b 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.4;
  pointer-events: none;
}

#mainCanvas,
#lampGlCanvas,
#geometryGlCanvas,
#sweepGlCanvas {
  width: 100%;
  height: 100%;
  display: block;
}
#lampGlCanvas,
#geometryGlCanvas,
#sweepGlCanvas {
  position: absolute;
  left: -100000px;
  top: -100000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#viewportBackgroundImage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 1;
  display: none;
}
#viewportBackgroundImage.active {
  display: block;
}
.project-morph-background-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: none;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change:
    opacity,
    transform,
    mask-image,
    -webkit-mask-image;
}
.project-morph-background-layer.active {
  display: block;
}
#mainContainer.project-morph-background-active #viewportBackgroundImage {
  display: none !important;
}
#mainCanvas {
  position: relative;
  z-index: 1;
}
.background-image-btn.active {
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(14, 165, 233, 0.18);
}
.background-image-clear {
  width: 22px !important;
  min-width: 22px !important;
  padding: 0 !important;
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.4);
}

#sceneBlendCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: normal;
  transform: translateZ(0);
  backface-visibility: hidden;
}

#finalGpuCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 3;
  pointer-events: none;
  opacity: 1;
  mix-blend-mode: normal;
  transform: translateZ(0);
  backface-visibility: hidden;
}

#graffitiGpuOverlayCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 4;
  pointer-events: none;
  opacity: 1;
  mix-blend-mode: normal;
  transform: translateZ(0);
  backface-visibility: hidden;
}

#pathFxOverlayCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 5;
  pointer-events: none;
  opacity: 1;
  mix-blend-mode: normal;
  transform: translateZ(0);
  backface-visibility: hidden;
}
#mainCanvas {
  z-index: 2;
}
.scene-blend-menu {
  position: fixed;
  z-index: 240;
  width: min(304px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.985);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
  overscroll-behavior: contain;
}
.scene-blend-menu.hidden {
  display: none !important;
}
.scene-blend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.scene-blend-head strong {
  font-size: 11px;
  color: var(--text-main);
}
.scene-blend-head small {
  font-size: 8px;
  color: var(--text-muted);
}
.scene-blend-field {
  display: grid;
  grid-template-columns: minmax(104px, auto) minmax(0, 1fr) 42px;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  font-size: 10px;
  color: var(--text-muted);
}
.scene-blend-field.mode {
  grid-template-columns: minmax(82px, auto) minmax(0, 1fr);
}
.scene-blend-mode-stepper {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 26px;
  gap: 4px;
  align-items: center;
  min-width: 0;
}
.scene-blend-mode-stepper button {
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}
.scene-blend-mode-stepper select {
  width: 100%;
  min-width: 0;
  max-width: 152px;
  height: 26px;
  padding-left: 5px;
  padding-right: 4px;
  font-size: 9px;
}
.scene-blend-field select {
  width: 100%;
  min-width: 0;
}
.scene-blend-field input[type='range'] {
  width: 100%;
  min-width: 0;
}
.scene-blend-value {
  text-align: right;
  color: #a5b4fc;
  font:
    10px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
}
.scene-background-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 7px;
}
.scene-background-actions button {
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  justify-content: center;
  font-size: 9px;
}
#btnClearBackgroundImageMenu:disabled {
  opacity: 0.42;
  cursor: default;
}
.scene-desktop-transparent-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 7px;
  background: rgba(14, 165, 233, 0.07);
  color: #cbd5e1;
  font-size: 9.5px;
  cursor: pointer;
}
.scene-desktop-transparent-toggle input {
  accent-color: #38bdf8;
}
.scene-desktop-transparent-toggle:has(input:checked) {
  border-color: rgba(56, 189, 248, 0.72);
  background: rgba(14, 165, 233, 0.16);
  color: #e0f2fe;
}
.scene-desktop-transparent-hint {
  margin-top: 5px;
  font-size: 8px;
  line-height: 1.35;
  color: #64748b;
}
body.desktop-transparent main#mainContainer {
  background-color: transparent !important;
}
body.desktop-transparent #viewportBackgroundImage,
body.desktop-transparent #projectMorphBackgroundSource,
body.desktop-transparent #projectMorphBackgroundTarget,
body.desktop-transparent #gridPattern {
  display: none !important;
}
body.desktop-transparent #mainCanvas,
body.desktop-transparent #sceneBlendCanvas,
body.desktop-transparent #finalGpuCanvas,
body.desktop-transparent #graffitiGpuOverlayCanvas,
body.desktop-transparent #pathFxOverlayCanvas,
body.desktop-transparent #particleGpuOverlayCanvas {
  background: transparent !important;
}
.scene-blend-note {
  margin-top: 6px;
  font-size: 8.5px;
  line-height: 1.35;
  color: var(--text-muted);
}
.scene-blend-reset {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
  color: #cbd5e1;
}
.background-image-btn.blend-active {
  color: #f0abfc;
  border-color: rgba(232, 121, 249, 0.62);
  background: rgba(192, 38, 211, 0.16);
}

.floating-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background-color: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 12;
  backdrop-filter: blur(8px);
}

.floating-display-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.floating-display-controls .display-control {
  width: 28px;
  height: 28px;
  padding: 0;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
}

.floating-display-controls .display-control:hover {
  background: var(--card-bg-light);
  color: var(--text-main);
  border-color: var(--border-light);
}

.floating-display-controls input[type='color'] {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
}

.floating-display-controls .display-color-control {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
}

.floating-display-controls .display-color-control:hover {
  background: var(--card-bg-light);
}

.floating-display-controls .display-color-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.floating-display-controls .display-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

.floating-display-controls .display-check {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
}

.floating-display-controls .display-check:has(input:checked) {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
}

.floating-display-controls .display-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.preset-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}

.preset-nav select {
  min-width: 190px;
}

.random-preset-btn {
  width: 32px;
  height: 28px;
  padding: 5px;
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.random-preset-btn:hover {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.6);
  transform: translateY(-1px);
}

.random-preset-btn .dice-icon {
  width: 17px;
  height: 17px;
  fill: none;
}

.morph-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-left: 2px;
}

.morph-settings-btn {
  width: 28px;
  height: 28px;
  padding: 5px;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.24);
}

.morph-settings-btn:hover {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.45);
}

.morph-settings-panel {
  position: fixed;
  top: 52px;
  right: 12px;
  width: 560px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 7px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.45);
  z-index: 60;
}

.morph-settings-panel.hidden {
  display: none !important;
}

.morph-settings-panel select {
  max-width: 240px;
  height: 23px;
  padding-top: 2px;
  padding-bottom: 2px;
  font-size: 9px;
}

.morph-settings-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
}

.mobile-panel-close {
  display: none;
  margin-left: auto;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.morph-settings-subtitle {
  font-size: 9px;
  font-weight: 400;
  color: var(--text-muted);
}

.morph-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

.morph-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 23px;
  padding: 3px 5px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 5px;
  background: rgba(30, 41, 59, 0.45);
  font-size: 9px;
  color: var(--text-muted);
}

.morph-setting-row label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  width: 100%;
}

.morph-setting-row input[type='checkbox'] {
  accent-color: #67e8f9;
}

.morph-setting-row.interval-row {
  grid-column: 1 / -1;
}

.morph-settings-note {
  margin-top: 5px;
  font-size: 9px;
  line-height: 1.35;
  color: var(--text-muted);
}

.morph-btn {
  width: 30px;
  height: 28px;
  color: #67e8f9;
  border-color: rgba(103, 232, 249, 0.28);
  background: rgba(103, 232, 249, 0.06);
  font-size: 16px;
  line-height: 1;
}

.morph-btn:hover {
  background: rgba(103, 232, 249, 0.14);
  border-color: rgba(103, 232, 249, 0.5);
}

.morph-btn.active {
  color: #0b1220;
  background: #67e8f9;
  border-color: #67e8f9;
  box-shadow:
    0 0 0 1px rgba(103, 232, 249, 0.18),
    0 0 14px rgba(103, 232, 249, 0.28);
}

.morph-interval {
  width: 42px !important;
  height: 23px;
  padding: 1px 4px !important;
  font-size: 10px !important;
  color: #67e8f9 !important;
  text-align: right;
}

.morph-range-controls {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.morph-range-controls .morph-interval {
  width: 48px !important;
}

.morph-fade-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 54px auto;
  align-items: center;
  gap: 6px;
  width: min(330px, 100%);
  margin-left: auto;
  min-width: 0;
}
.morph-fade-controls input[type='range'] {
  width: 100%;
  min-width: 0;
}
.morph-fade-controls input[type='number'] {
  width: 54px !important;
  text-align: right !important;
}

.morph-setting-row.compact-morph-row label {
  width: auto;
  flex: 1;
}
.morph-setting-row.compact-morph-row .morph-range-controls {
  flex-shrink: 0;
}
.morph-setting-row.compact-morph-row .morph-row-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  margin-left: auto;
}
.morph-setting-row.mono-orbit-row .morph-range-controls {
  transition: opacity 0.15s ease;
}
.morph-setting-row.mono-orbit-row.mono-orbit-disabled .morph-range-controls {
  opacity: 0.42;
}
.morph-setting-row.mono-orbit-row .morph-row-check {
  min-width: 0;
}

.morph-setting-row.morph-shape-row {
  grid-column: 1 / -1;
  display: block;
  padding: 4px 5px;
}

.morph-fill-color-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}
.morph-fill-color-row > label {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}
.morph-fill-counts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.morph-fill-counts input {
  width: 44px !important;
}
.morph-fill-hue-wrap {
  position: relative;
  flex: 1 1 180px;
  min-width: 120px;
  height: 28px;
}
.morph-fill-hue-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #ef4444);
  opacity: 0.62;
}
.morph-fill-hue-wrap input[type='range'] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: transparent;
  pointer-events: none;
  accent-color: #f8fafc;
}
.morph-fill-hue-wrap input[type='range']::-webkit-slider-thumb {
  pointer-events: auto;
}
.morph-fill-hue-wrap input[type='range']::-moz-range-thumb {
  pointer-events: auto;
}
.morph-fill-hue-text {
  flex: 0 0 auto;
  min-width: 78px;
  text-align: center;
  font: 10px monospace;
  color: #cbd5e1;
}
.morph-fill-color-row.fill-disabled .morph-fill-counts,
.morph-fill-color-row.fill-disabled .morph-fill-hue-wrap,
.morph-fill-color-row.fill-disabled .morph-fill-hue-text,
.morph-fill-color-row.fill-disabled .morph-fill-reset {
  opacity: 0.42;
}
.morph-fill-color-row.hue-reset .morph-fill-hue-wrap {
  opacity: 0.35;
}
@media (max-width: 760px) {
  .morph-fill-color-row {
    flex-wrap: wrap;
  }
  .morph-fill-hue-wrap {
    flex-basis: 180px;
  }
}
.morph-shape-head {
  display: flex;
  align-items: center;
  gap: 5px;
}
.morph-shape-head > label {
  width: auto;
  flex: 1;
}
.morph-shape-head select {
  min-width: 118px;
  max-width: 172px;
}
.morph-shape-options {
  display: block;
  margin-top: 4px;
  min-width: 0;
}
.morph-profile-group-switch {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.58);
  min-width: 0;
  width: 100%;
}
.morph-profile-group-switch button {
  min-width: 0;
  padding: 3px 3px;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}
.morph-profile-group-switch button.active {
  color: white;
  background: var(--accent);
}
.spiral-settings-block {
  margin-top: 7px;
  padding: 7px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 7px;
  background: rgba(8, 47, 73, 0.2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.spiral-settings-block.hidden {
  display: none !important;
}
.spiral-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.spiral-settings-row > span {
  font-size: 10px;
  color: var(--text-muted);
  min-width: 0;
}

#spiralGeometryControls .spiral-zero-mode-setting > label {
  font-size: 13px !important;
  line-height: 1.3;
}
.spiral-settings-row input[type='number'] {
  width: 82px !important;
  min-width: 0;
  text-align: right;
}

#spiralOrderControl.spiral-order-morphable {
  border: 1px solid rgba(34, 211, 238, 0.65);
  border-radius: 6px;
  padding: 5px 7px;
  background: rgba(8, 145, 178, 0.09);
  box-shadow: inset 2px 0 0 rgba(34, 211, 238, 0.72);
}
#spiralOrderControl.spiral-order-morphable:focus-within {
  border-color: #22d3ee;
  box-shadow:
    0 0 0 2px rgba(34, 211, 238, 0.2),
    inset 2px 0 0 #67e8f9;
}
#spiralOrderControl.spiral-order-morphable input {
  border: 1px solid rgba(34, 211, 238, 0.48) !important;
  background: rgba(15, 23, 42, 0.8);
}

.spiral-fill-type-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}
.spiral-fill-type-row select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 11px;
  color: #e5f4ff;
  background: #17243d;
}
.spiral-fill-type-row select option {
  color: #e5f4ff;
  background: #17243d;
}
.spiral-fill-type-row.hidden {
  display: none !important;
}
.spiral-step-link,
.spiral-tangent-toggle,
.spiral-seam-round-toggle,
.spiral-fill-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 10px;
  color: var(--text-muted);
  min-width: 0;
}
.spiral-step-link input,
.spiral-tangent-toggle input,
.spiral-seam-round-toggle input,
.spiral-fill-toggle input {
  accent-color: #22d3ee;
}
.spiral-step-link span,
.spiral-tangent-toggle span,
.spiral-seam-round-toggle span,
.spiral-fill-toggle span {
  min-width: 0;
}
.spiral-closure-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.spiral-closure-row > span {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--text-muted);
}
.spiral-closure-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  flex: 1 1 auto;
  padding: 2px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.58);
}
.spiral-closure-toggle button {
  min-width: 0;
  padding: 4px 5px;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
}
.spiral-closure-toggle button.active {
  color: #ecfeff;
  background: #0e7490;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.42);
}
.spiral-layerwise-turn-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.spiral-layerwise-turn-row.hidden {
  display: none !important;
}
.spiral-layerwise-turn-row > span {
  font-size: 10px;
  color: var(--text-muted);
}
.spiral-layerwise-turn-toggle button {
  font-size: 10px;
  min-height: 30px;
  white-space: normal;
}
.spiral-step-manual-disabled {
  opacity: 0.48;
}
.contour-mode-toggle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
}
.contour-mode-toggle button {
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 4px 3px;
  font-size: 9px;
  line-height: 1.08;
  white-space: normal;
  text-align: center;
}
.contour-mode-toggle button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.contour-mode-toggle button[data-contour-mode^='spiral-'].active {
  background: #0e7490;
  border-color: #22d3ee;
  color: #ecfeff;
}
.contour-status-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}
#spiralTopologyBadge.hidden {
  display: none !important;
}
.spiral-setting-disabled {
  opacity: 0.45;
}
.morph-spiral-row {
  grid-column: 1 / -1;
}
.morph-spiral-continuity-row {
  grid-column: 1 / -1;
}
.morph-lamp-morph-row {
  grid-column: 1 / -1;
  display: block;
}
.morph-lamp-morph-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.morph-lamp-morph-inner > label {
  width: auto;
  flex: 0 0 auto;
}
.morph-lamp-morph-inner .lamp-morph-settings {
  margin: 0;
  flex: 1 1 300px;
  min-width: 220px;
}
.morph-lamp-morph-inner .lamp-morph-settings.hidden {
  display: none !important;
}
.morph-chaos-morph-row {
  grid-column: 1 / -1;
  display: block;
}
.morph-chaos-morph-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.morph-chaos-morph-inner > label {
  width: auto;
  flex: 0 0 auto;
}
.chaos-morph-settings {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  min-width: 0;
}
.chaos-morph-settings.hidden {
  display: none !important;
}
.chaos-morph-settings .chaos-morph-number {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  font-size: 9px;
  color: var(--text-muted);
}
.chaos-morph-settings input[type='number'] {
  width: 42px !important;
  height: 23px;
  text-align: center !important;
  color: #fbbf24;
}
.random-spiral-range {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}
.random-spiral-range input {
  width: 48px !important;
}
.morph-profile-group-switch button:last-of-type.active {
  box-shadow: none;
}
.morph-spline-points-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 3px;
  min-width: 0;
  font-size: 9px;
  color: var(--text-muted);
}
.morph-spline-points-row > span {
  white-space: nowrap;
}
.morph-spline-point-input {
  width: 58px !important;
  height: 24px;
  padding: 2px 5px !important;
  text-align: center !important;
  color: #a5b4fc !important;
  flex: 0 0 58px;
}
.morph-spline-points-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(34px, 1fr));
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.58);
  width: min(150px, 48%);
}
.morph-spline-points-switch button {
  min-width: 0;
  padding: 3px 5px;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 9px;
}
.morph-spline-points-switch button.active {
  color: white;
  background: var(--accent);
}
.morph-segmented-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 2px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.58);
  min-width: 0;
}
.morph-segmented-switch button {
  min-width: 0;
  padding: 3px 5px;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}
.morph-segmented-switch button.active {
  background: rgba(103, 232, 249, 0.18);
  color: #a5f3fc;
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.42);
}
.morph-dual-setting-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3px;
  min-width: 0;
}
.morph-dual-setting-row .morph-setting-row {
  min-width: 0;
}
.morph-standard-only-btn {
  min-width: 112px;
  padding: 3px 7px;
  justify-content: center;
  border-radius: 5px;
  font-size: 9px;
  white-space: nowrap;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid var(--border-light);
}
.morph-standard-only-btn.active {
  color: #a5f3fc;
  background: rgba(103, 232, 249, 0.18);
  border-color: rgba(103, 232, 249, 0.42);
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.12);
}
.morph-shape-row.shape-disabled .morph-shape-options,
.morph-shape-row.shape-disabled select {
  opacity: 0.42;
  pointer-events: none;
}
.morph-inline-options {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.morph-inline-options label {
  width: auto;
  justify-content: center;
  white-space: nowrap;
}
.morph-inline-options .morph-size-option {
  grid-column: 1 / -1;
  justify-content: flex-start;
  gap: 7px;
  min-width: 0;
}
.morph-size-variation-controls {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) 50px auto;
  align-items: center;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
}
.morph-size-variation-controls input[type='range'] {
  width: 100%;
  min-width: 0;
}
.morph-size-variation-controls input[type='number'] {
  width: 50px !important;
}
.rounding-reset-btn {
  margin-left: 4px;
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.38);
  background: rgba(127, 29, 29, 0.14);
}
.rounding-reset-btn:hover {
  color: #fff;
  background: rgba(185, 28, 28, 0.35);
  border-color: rgba(248, 113, 113, 0.68);
}
.morph-harmony-palette {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 1 1 330px;
  min-width: 220px;
  flex-wrap: wrap;
}
.morph-harmony-btn {
  min-height: 24px;
  height: 24px;
  padding: 2px 6px;
  font-size: 9px;
  white-space: nowrap;
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.55);
}
.morph-harmony-btn.active {
  color: #0b1220;
  background: #67e8f9;
  border-color: #a5f3fc;
}
.morph-fill-color-row.fill-disabled .morph-harmony-palette {
  opacity: 0.42;
}
.morph-fill-block {
  grid-column: 1 / -1;
  border: 1px solid rgba(51, 65, 85, 0.65);
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.38);
  overflow: hidden;
}
.morph-fill-block .morph-setting-row {
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0;
}
.morph-fill-block .morph-fill-opacity-row {
  border-top: 1px solid rgba(51, 65, 85, 0.52);
}
.fill-reset-btn {
  flex: 0 0 auto;
  min-height: 24px;
  height: 24px;
  padding: 2px 7px;
  font-size: 9px;
  white-space: nowrap;
}
.editable-number-value {
  cursor: text;
  border-bottom: 1px dashed rgba(129, 140, 248, 0.6);
  outline: none;
  min-width: 34px;
  text-align: right;
  border-radius: 3px;
  padding: 1px 2px;
}
.editable-number-value:focus {
  background: rgba(99, 102, 241, 0.14);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.38);
  border-bottom-color: transparent;
}
@media (max-width: 650px) {
  .morph-shape-options {
    grid-template-columns: 1fr;
  }
  .morph-inline-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .morph-harmony-palette {
    justify-content: flex-start;
    min-width: 0;
  }
}
.freehand-interpolation-panel {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.65);
}
.freehand-interpolation-panel.visible {
  display: grid;
}
.freehand-interpolation-panel button {
  padding: 5px 4px;
  font-size: 10px;
  justify-content: center;
}

.morph-sec {
  font-size: 10px;
  color: var(--text-muted);
  margin-right: 1px;
}

#morphInterval {
  width: 72px !important;
  text-align: left !important;
  padding: 2px 22px 2px 7px !important;
}

.morph-cycle-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  white-space: nowrap;
}

.morph-quick-btn {
  min-width: 32px;
  height: 24px;
  padding: 2px 6px;
  justify-content: center;
  font-size: 10px;
}

.morph-quick-btn.active {
  background: rgba(103, 232, 249, 0.16);
  border-color: rgba(103, 232, 249, 0.55);
  color: #67e8f9;
}

.tap-auto-badge {
  color: #ef4444;
  font:
    800 9px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0.55px;
  margin-right: 2px;
  flex: 0 0 auto;
}

.morph-fill-opacity-row.fill-disabled {
  opacity: 0.42;
}
.fill-settings-block {
  margin-top: 8px;
  padding: 9px;
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.32);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.fill-settings-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
}
.fill-settings-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fill-settings-body.fill-disabled {
  opacity: 0.42;
}
.fill-opacity-control.hidden,
.fill-match-stroke-control.hidden,
.fill-mode-control.hidden,
.fill-special-control.hidden {
  display: none !important;
}
.fill-match-stroke-control {
  padding-top: 2px;
  padding-bottom: 2px;
}
.fill-match-stroke-control label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #cbd5e1;
  cursor: pointer;
}
.fill-mode-control .row-label {
  margin-bottom: 4px;
}
.fill-mode-select,
#paramFillFadeDirection {
  width: 100%;
  min-width: 0;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #172033;
  color: #e2e8f0;
  font-size: 10px;
  padding: 0 8px;
}
.fill-timer-inputs {
  justify-content: flex-start;
  gap: 6px;
}
#paramFillAccumulationSeconds {
  width: 78px;
}
.fill-special-control {
  padding-top: 2px;
}
.fill-mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  width: 100%;
}
.fill-mode-btn {
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #172033;
  color: #cbd5e1;
  font-size: 10px;
  cursor: pointer;
}
.fill-mode-btn.active {
  border-color: #22d3ee;
  background: rgba(8, 145, 178, 0.3);
  color: #e6fdff;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.14);
}
.fill-mode-hint {
  margin-top: 3px;
  min-height: 20px;
  color: #64748b;
  font-size: 9px;
  line-height: 1.25;
}
#paramFillColor:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.graffiti-playlist-palette-row select {
  width: 100%;
  min-width: 0;
  height: 26px;
  font-size: 10px;
}
#graffitiBrightPaletteSwatches:empty::after {
  content: 'Нет цветов';
  color: var(--text-muted);
  font-size: 9px;
}

.random-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.random-settings-btn {
  width: 28px;
  height: 28px;
  padding: 5px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.06);
  border-color: rgba(251, 191, 36, 0.24);
}

.random-settings-btn:hover {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.45);
}

.random-settings-panel {
  position: fixed;
  top: 52px;
  right: 12px;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 10px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.45);
  z-index: 100;
}

.random-settings-panel.hidden {
  display: none !important;
}

.random-layer-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 2px 0 4px;
  height: 28px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.6);
}

.random-layer-count label {
  font-size: 10px;
  color: var(--text-muted);
}

.random-layer-count input {
  width: 32px !important;
  height: 22px;
  padding: 2px 4px !important;
  border: none !important;
  background: transparent !important;
  color: #fbbf24 !important;
  font-family: monospace;
  font-size: 11px !important;
  text-align: center;
}

.fps-counter {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 14;
  min-width: 52px;
  padding: 4px 7px;
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.78);
  color: #cbd5e1;
  font:
    10px/1.2 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.info-pill {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
}

.hidden {
  display: none !important;
}
.text-mono {
  font-family: monospace;
  color: #818cf8;
}

.perf-backend-canvas,
.perf-backend-canvas * {
  color: #f59e0b !important;
}
.perf-backend-gpu,
.perf-backend-gpu * {
  color: #f8fafc !important;
}
.perf-backend-mixed,
.perf-backend-mixed * {
  color: #fb923c !important;
}
.perf-backend-canvas input[type='color'],
.perf-backend-gpu input[type='color'],
.perf-backend-mixed input[type='color'] {
  color: initial !important;
}
.perf-forced-canvas,
.perf-forced-canvas * {
  color: #f59e0b !important;
}
.hint-text {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

.icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
}

.tunnel-btn {
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.36);
  background: rgba(124, 58, 237, 0.08);
  white-space: nowrap;
}
.tunnel-btn:hover {
  color: #ede9fe;
  border-color: rgba(167, 139, 250, 0.62);
  background: rgba(124, 58, 237, 0.18);
}
.tunnel-btn.active {
  color: white;
  background: #7c3aed;
  border-color: #8b5cf6;
  box-shadow:
    0 0 0 1px rgba(167, 139, 250, 0.16),
    0 0 16px rgba(124, 58, 237, 0.32);
}

.tap-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.tap-btn {
  min-width: 72px;
  height: 28px;
  justify-content: center;
  font-weight: 800;
  color: #111827;
  background: #ffffff;
  border-color: rgba(239, 68, 68, 0.75);
  font-variant-numeric: tabular-nums;
}
.tap-btn.tempo-active {
  animation: tapBeatPulse var(--tap-beat-ms, 500ms) steps(1, end) infinite;
  color: #111827;
  border-color: #ef4444;
}
@keyframes tapBeatPulse {
  0%,
  22% {
    background: #ef4444;
  }
  23%,
  100% {
    background: #ffffff;
  }
}
.tap-settings-btn {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.32);
  background: rgba(239, 68, 68, 0.07);
}
.tap-settings-btn:hover {
  color: #fee2e2;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.55);
}
.tap-reset-btn {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(127, 29, 29, 0.1);
  white-space: nowrap;
}
.auto-tap-listen-btn {
  width: 30px;
  height: 28px;
  min-height: 28px;
  padding: 4px;
  justify-content: center;
  color: #fff;
  background: #b91c1c;
  border-color: #ef4444;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12);
}
.auto-tap-listen-btn:hover {
  background: #dc2626;
  border-color: #f87171;
}
.auto-tap-listen-btn.active {
  background: #ef4444;
  border-color: #fecaca;
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(254, 202, 202, 0.22),
    0 0 14px rgba(239, 68, 68, 0.38);
}
.tap-settings-panel {
  position: fixed;
  top: 52px;
  left: 12px;
  width: min(340px, calc(100vw - 24px));
  padding: 10px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.48);
  z-index: 106;
  backdrop-filter: blur(10px);
}
.tap-settings-panel.hidden {
  display: none !important;
}
.tap-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 7px 0;
  padding: 7px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.36);
  font-size: 10px;
  color: var(--text-muted);
}
.tap-setting-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-main);
}
.tap-setting-row input[type='number'] {
  width: 68px;
}
.tap-setting-row select {
  min-width: 132px;
  max-width: 170px;
}
.tap-setting-row input[type='checkbox'] {
  accent-color: #ef4444;
}
.tap-status {
  margin-top: 7px;
  font-size: 9px;
  line-height: 1.4;
  color: var(--text-muted);
}
.mobile-only-action {
  display: none !important;
}

.mobile-number-stepper {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  vertical-align: middle;
}
.mobile-step-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-main);
  font:
    700 22px/1 system-ui,
    sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mobile-step-btn:active {
  transform: scale(0.94);
  background: var(--card-bg-light);
}

.tunnel-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.tunnel-settings-btn {
  width: 28px;
  height: 28px;
  padding: 5px;
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.06);
  border-color: rgba(167, 139, 250, 0.24);
}
.tunnel-settings-btn:hover {
  color: #ede9fe;
  background: rgba(124, 58, 237, 0.16);
  border-color: rgba(167, 139, 250, 0.5);
}
.tunnel-settings-panel {
  position: fixed;
  top: 52px;
  left: 12px;
  width: min(360px, calc(100vw - 24px));
  padding: 10px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.48);
  z-index: 105;
  backdrop-filter: blur(10px);
}
.tunnel-settings-panel.hidden {
  display: none !important;
}
.tunnel-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.tunnel-settings-head strong {
  font-size: 12px;
}
.tunnel-setting {
  margin: 7px 0;
  padding: 7px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.36);
}
.tunnel-setting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 10px;
  color: var(--text-muted);
}
.tunnel-effect-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 7px;
  align-items: center;
}
.tunnel-effect-control input[type='range'] {
  width: 100%;
  min-width: 0;
}
.tunnel-effect-control input[type='number'] {
  width: 54px;
  min-width: 0;
}
.tunnel-direction-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.tunnel-direction-toggle button {
  justify-content: center;
  padding: 5px 8px;
  min-height: 28px;
  font-size: 10px;
}
.tunnel-direction-toggle button.active {
  background: #7c3aed;
  border-color: #8b5cf6;
  color: white;
}
.tunnel-settings-note {
  margin-top: 7px;
  font-size: 9px;
  line-height: 1.35;
  color: var(--text-muted);
}
.tunnel-fade-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-main);
}
.tunnel-default-active-row .tunnel-fade-toggle {
  font-weight: 400 !important;
  font-size: 10px;
  line-height: 1.25;
}
.tunnel-fade-toggle input[type='checkbox'] {
  accent-color: #8b5cf6;
}
.tunnel-vignette-toggle {
  font-size: 12px;
  line-height: 1.25;
}
.tunnel-fade-control {
  display: grid;
  gap: 6px;
}
.tunnel-fade-numeric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px auto;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
}
.tunnel-fade-numeric-row input[type='number'] {
  width: 82px;
  text-align: right;
}
.tunnel-fade-unit {
  min-width: 34px;
  color: var(--text-muted);
}
.tunnel-color-shift-controls {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(51, 65, 85, 0.48);
}
.tunnel-color-shift-controls.hidden {
  display: none !important;
}
.tunnel-color-shift-controls .tunnel-setting-head {
  margin-bottom: 0;
}
.tunnel-color-degree-control input[type='number'] {
  width: 54px;
}
.tunnel-palette-lag-toggle {
  font-size: 10px;
  color: var(--text-muted);
}

.minimal-morph-btn {
  width: 32px;
  height: 28px;
  padding: 5px;
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.38);
  background: rgba(249, 115, 22, 0.08);
  font-size: 15px;
  line-height: 1;
  justify-content: center;
}
.minimal-morph-btn:hover {
  color: #fed7aa;
  background: rgba(249, 115, 22, 0.18);
  border-color: rgba(251, 146, 60, 0.65);
  transform: translateY(-1px);
}
.minimal-morph-btn.active {
  color: white;
  background: #f97316;
  border-color: #fb923c;
  box-shadow:
    0 0 0 1px rgba(251, 146, 60, 0.18),
    0 0 14px rgba(249, 115, 22, 0.32);
}

.minimal-morph-btn.paused,
.morph-btn.paused {
  opacity: 0.62;
  outline: 1px dashed currentColor;
  outline-offset: 2px;
}

#mainCanvas {
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: contents;
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: rgba(71, 85, 105, 0.72);
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  border: 2px solid #0f172a;
  background: #e2e8f0;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.34),
    0 1px 5px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}
input[type='range']::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: rgba(71, 85, 105, 0.72);
}
input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #0f172a;
  background: #e2e8f0;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.34),
    0 1px 5px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}
.dual-range-wrap input[type='range']::-webkit-slider-runnable-track {
  background: transparent;
}
.dual-range-wrap input[type='range']::-moz-range-track {
  background: transparent;
}
.audio-band-count-row,
.audio-custom-bands-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0;
  font-size: 9px;
  color: var(--text-muted);
}
.audio-band-count-row select {
  min-width: 74px;
}
.audio-custom-bands-toggle label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.audio-custom-band-rows {
  display: grid;
  gap: 5px;
  margin: 5px 0 9px;
}
.audio-custom-band-rows.hidden {
  display: none !important;
}
.audio-custom-band-row {
  display: grid;
  grid-template-columns: 92px minmax(380px, 1fr) 170px;
  gap: 9px;
  align-items: center;
  min-height: 32px;
  font-size: 9px;
  color: var(--text-muted);
}
.audio-custom-band-name {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.audio-custom-band-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--band-color);
  box-shadow: 0 0 7px var(--band-color);
}
.audio-custom-dual {
  position: relative;
  height: 28px;
  min-width: 380px;
}
.audio-custom-dual input[type='range'] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: transparent;
  pointer-events: none;
}
.audio-custom-dual input[type='range']::-webkit-slider-runnable-track {
  background: color-mix(in srgb, var(--band-color) 48%, #334155);
}
.audio-custom-dual input[type='range']::-moz-range-track {
  background: color-mix(in srgb, var(--band-color) 48%, #334155);
}
.audio-custom-band-values {
  display: grid;
  grid-template-columns: 76px 12px 76px;
  gap: 3px;
  align-items: center;
  justify-content: end;
  font-family: monospace;
  white-space: nowrap;
}
.audio-custom-band-values input[type='number'] {
  width: 76px !important;
  min-width: 0;
  padding: 3px 4px;
  text-align: right !important;
  color: #e2e8f0;
}
.audio-band-gain-wrap {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 2px;
  align-items: center;
  color: var(--text-muted);
}
.audio-band-gain {
  width: 54px !important;
  min-width: 0;
  padding: 3px 4px !important;
  text-align: right !important;
  color: #e2e8f0 !important;
}
.audio-cutoff-row-label #audioCutoffText {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0;
}
.audio-cutoff-boundary {
  cursor: text;
  border-bottom: 1px dashed rgba(129, 140, 248, 0.58);
  border-radius: 3px;
  padding: 0 1px;
  min-width: 22px;
  text-align: center;
}
.audio-cutoff-boundary:hover {
  color: #e0e7ff;
  background: rgba(99, 102, 241, 0.12);
}
.audio-cutoff-boundary.editing {
  color: #fff;
  background: rgba(99, 102, 241, 0.22);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.52);
  border-bottom-color: transparent;
  outline: none;
}
.audio-routing-tools {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  align-items: center;
  margin: 0 0 4px;
  padding: 5px;
  border: 1px solid rgba(71, 85, 105, 0.45);
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.28);
}
.audio-route-group {
  position: relative;
  min-width: 0;
}
.audio-route-group-btn {
  width: 100%;
  min-width: 0;
  min-height: 25px;
  padding: 3px 4px;
  font-size: 8px;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-route-group-btn.group-enabled {
  border-color: #f472b6;
  color: #fbcfe8;
  background: rgba(190, 24, 93, 0.24);
}
.audio-route-group-menu {
  position: absolute;
  z-index: 125;
  top: 29px;
  left: 0;
  width: 210px;
  max-height: 300px;
  overflow: auto;
  padding: 5px;
  background: #0b1220;
  border: 1px solid rgba(244, 114, 182, 0.46);
  border-radius: 7px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}
.audio-route-group-menu.hidden {
  display: none !important;
}
.audio-route-group-menu button {
  width: 100%;
  justify-content: flex-start;
  min-height: 25px;
  margin: 1px 0;
  padding: 3px 6px;
  font-size: 9px;
  border: 0;
  background: transparent;
}
.audio-route-group-menu button:hover {
  background: rgba(236, 72, 153, 0.24);
}
.audio-routing-tools-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 7px;
  padding: 0 2px;
  min-height: 20px;
}
.audio-routing-tools-hint {
  color: #94a3b8;
  font-size: 8px;
  line-height: 1.25;
}
.audio-routing-defaults {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  color: #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
}
.audio-routing-preset-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin: 0 0 7px;
  padding: 5px 6px;
  border: 1px solid rgba(71, 85, 105, 0.45);
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.28);
}
.audio-routing-preset-bar > span {
  font-size: 8px;
  color: #94a3b8;
}
.audio-routing-preset-bar select {
  min-width: 150px;
  height: 25px;
  padding: 2px 6px;
  font-size: 9px;
}
.audio-clear-all-btn {
  min-height: 25px;
  padding: 3px 7px;
  font-size: 9px;
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.16);
}
.audio-clear-all-btn:hover {
  color: white;
  border-color: #f87171;
  background: rgba(185, 28, 28, 0.34);
}
.lamp-adaptive-strength-row {
  margin-top: 2px;
}

.editable-mult-summary {
  cursor: text;
  border-bottom: 1px dashed rgba(244, 114, 182, 0.55);
  outline: none;
}
.editable-mult-summary:focus {
  background: rgba(190, 24, 93, 0.16);
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.35);
  border-radius: 3px;
}

.audio-reactive-btn {
  color: #fce7f3;
  border-color: rgba(236, 72, 153, 0.58);
  background: rgba(190, 24, 93, 0.3);
}
.audio-reactive-btn:hover {
  color: #fff;
  border-color: #f472b6;
  background: rgba(219, 39, 119, 0.48);
}
.audio-reactive-btn.active {
  background: #ec4899;
  border-color: #f9a8d4;
  color: white;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.36);
}
.audio-routing-btn {
  color: #fce7f3;
  border-color: rgba(236, 72, 153, 0.58);
  background: rgba(190, 24, 93, 0.3);
  font-size: 15px;
}
.audio-routing-btn:hover,
.audio-routing-btn.active {
  color: #fff;
  border-color: #f9a8d4;
  background: #db2777;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.32);
}
.header-audio-entry {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.audio-routing-panel {
  position: fixed;
  top: 48px;
  bottom: 8px;
  left: 8px;
  z-index: 85;
  width: 50vw;
  min-width: 640px;
  max-width: calc(100vw - 16px);
  max-height: none;
  background: rgba(15, 23, 42, 0.985);
  border: 1px solid rgba(244, 114, 182, 0.42);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.audio-routing-panel.hidden {
  display: none !important;
}
.audio-routing-head {
  height: 38px;
  padding: 6px 8px 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(71, 85, 105, 0.58);
  background: rgba(131, 24, 67, 0.13);
}
.audio-routing-head strong {
  color: #fbcfe8;
  font-size: 12px;
}
.audio-routing-layout {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  overflow: hidden;
}
.audio-routing-layers {
  padding: 7px;
  overflow: auto;
  border-right: 1px solid rgba(71, 85, 105, 0.58);
  background: rgba(2, 6, 23, 0.4);
}
.audio-routing-layer {
  width: 100%;
  min-height: 28px;
  margin: 0 0 4px;
  padding: 4px 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  color: #cbd5e1;
  font-size: 10px;
  border: 1px solid rgba(71, 85, 105, 0.55);
  background: rgba(30, 41, 59, 0.45);
  border-radius: 6px;
  overflow: hidden;
}
.audio-routing-layer.active {
  color: #fff;
  border-color: #f472b6;
  background: rgba(190, 24, 93, 0.42);
}
.audio-routing-layer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 7px currentColor;
}
.audio-routing-layer.signal-disabled {
  color: #94a3b8;
  border-color: rgba(100, 116, 139, 0.58);
  background: rgba(51, 65, 85, 0.32);
}
.audio-routing-layer.signal-disabled.active {
  color: #e2e8f0;
  border-color: #94a3b8;
  background: rgba(71, 85, 105, 0.52);
}
.audio-routing-layer.signal-disabled .audio-routing-layer-dot {
  color: #64748b !important;
  background: #64748b !important;
  box-shadow: none !important;
  opacity: 0.92;
}
.audio-routing-main {
  min-width: 0;
  overflow: auto;
  padding: 8px;
}
.audio-routing-target-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: #f8fafc;
  font-size: 11px;
}
.audio-routing-note {
  color: #94a3b8;
  font-size: 9px;
  line-height: 1.35;
  margin-bottom: 8px;
}
.audio-master-amplitude {
  margin: 0 0 8px;
  padding: 7px;
  border: 1px solid rgba(244, 114, 182, 0.38);
  border-radius: 7px;
  background: rgba(131, 24, 67, 0.12);
}
.audio-master-amplitude.hidden {
  display: none !important;
}
.audio-master-amplitude-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: #fbcfe8;
  font-size: 10px;
  font-weight: 700;
}
.audio-master-amplitude-value {
  color: #f9a8d4;
  font:
    9px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: nowrap;
}
.audio-master-amplitude-control {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto 68px;
  gap: 6px;
  align-items: center;
}
.audio-master-amplitude-control input[type='range'] {
  width: 100%;
  min-width: 0;
  accent-color: #ec4899;
}
.audio-master-amplitude-control input[type='number'] {
  width: 68px;
  min-width: 0;
}
.audio-master-amplitude-mult {
  color: #f9a8d4;
  font-weight: 700;
}
.audio-master-global-routes {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(244, 114, 182, 0.28);
}
.audio-master-global-routes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: #f9a8d4;
  font-size: 9px;
}
.audio-master-global-routes-note {
  color: #94a3b8;
  font-size: 8px;
  font-weight: 400;
}
.audio-master-global-routes .audio-routing-rows {
  margin-bottom: 5px;
}
.audio-master-global-routes .audio-routing-add {
  border-color: rgba(244, 114, 182, 0.42);
  background: rgba(190, 24, 93, 0.14);
  color: #fbcfe8;
}
.audio-master-global-routes .audio-route-row {
  border-color: rgba(244, 114, 182, 0.28);
  background: rgba(131, 24, 67, 0.08);
}

.audio-master-route-controls {
  margin: 0 0 8px;
  padding: 7px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 7px;
  background: rgba(3, 105, 161, 0.1);
}
.audio-master-route-controls.hidden {
  display: none !important;
}
.audio-master-route-controls-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: #bae6fd;
  font-size: 10px;
  font-weight: 700;
}
.audio-master-route-controls-note {
  color: #7dd3fc;
  opacity: 0.8;
  font-size: 8px;
  font-weight: 400;
}
.audio-master-route-control-rows {
  display: grid;
  gap: 5px;
}
.audio-master-route-row {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(130px, 1.4fr) 68px 62px 28px;
  gap: 6px;
  align-items: center;
  min-height: 31px;
  padding: 4px 5px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 6px;
  background: rgba(2, 132, 199, 0.07);
}
.audio-master-polarity-btn {
  width: 28px;
  min-width: 28px;
  height: 25px;
  padding: 0;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(14, 165, 233, 0.1);
}
.audio-master-polarity-btn.polarity-plus {
  color: #86efac;
}
.audio-master-polarity-btn.polarity-minus {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.14);
  border-color: rgba(248, 113, 113, 0.42);
}
.audio-master-route-label {
  min-width: 0;
  color: #e0f2fe;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-master-route-row input[type='range'] {
  width: 100%;
  min-width: 0;
  accent-color: #38bdf8;
}
.audio-master-route-row input[type='number'] {
  width: 62px;
  min-width: 0;
  color: #7dd3fc;
}
.audio-master-route-value {
  color: #7dd3fc;
  font:
    8px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  text-align: right;
  white-space: nowrap;
}
.audio-routing-rows {
  display: grid;
  gap: 6px;
}
.audio-route-row {
  position: relative;
  display: grid;
  grid-template-columns: 20px 14px 64px minmax(120px, 1fr) 78px minmax(78px, 118px) 54px 22px;
  gap: 4px;
  align-items: center;
  min-width: 600px;
  padding: 5px;
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.34);
}
.audio-route-row.disabled {
  opacity: 0.48;
}
.audio-route-row input[type='checkbox'] {
  accent-color: #ec4899;
}
.audio-route-band-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--band-color, #fff);
  opacity: calc(0.22 + var(--audio-level, 0) * 0.78);
  box-shadow: 0 0 calc(3px + var(--audio-level, 0) * 12px) var(--band-color, #fff);
  transition:
    opacity 0.07s linear,
    box-shadow 0.07s linear;
}
.audio-route-row select,
.audio-route-row input[type='number'],
.audio-param-picker-button {
  min-height: 25px;
  height: 25px;
  padding: 2px 5px;
  font-size: 9px;
  min-width: 0;
}
.audio-route-gain {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  min-width: 0;
}
.audio-route-gain input[type='range'] {
  width: 100%;
  min-width: 0;
  accent-color: #ec4899;
}
.audio-route-gain-value {
  color: #f9a8d4;
  font:
    8px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  text-align: center;
  white-space: nowrap;
}
.audio-route-mode-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}
.audio-route-derivative {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  color: #cbd5e1;
  font-size: 8.5px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.audio-route-derivative input {
  margin: 0;
  flex: none;
}
.audio-route-signal-mode {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  justify-content: center;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}
.audio-route-signal-mode.mode-add {
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.46);
  background: rgba(22, 101, 52, 0.16);
}
.audio-route-signal-mode.mode-median {
  color: #fde047;
  border-color: rgba(250, 204, 21, 0.48);
  background: rgba(113, 63, 18, 0.16);
}
.audio-route-signal-mode.mode-subtract {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(127, 29, 29, 0.16);
}
.audio-param-picker {
  position: relative;
  min-width: 0;
}
.audio-param-picker-button {
  width: 100%;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e2e8f0;
}
.audio-param-menu {
  position: absolute;
  z-index: 120;
  top: 29px;
  left: 0;
  width: min(330px, 70vw);
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  background: #0b1220;
  border: 1px solid rgba(244, 114, 182, 0.46);
  border-radius: 7px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55);
}
.audio-param-menu.hidden {
  display: none !important;
}
.audio-param-search {
  width: 100%;
  height: 27px;
  margin-bottom: 5px;
  font-size: 10px;
}
.audio-param-group-title {
  padding: 5px 4px 3px;
  color: #f9a8d4;
  font-size: 9px;
  font-weight: 700;
  border-top: 1px solid rgba(71, 85, 105, 0.32);
}
.audio-param-group-title:first-of-type {
  border-top: 0;
}
.audio-param-option {
  width: 100%;
  min-height: 25px;
  padding: 3px 6px;
  margin: 1px 0;
  text-align: left;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 9px;
  border-radius: 4px;
}
.audio-param-option:hover,
.audio-param-option.active {
  color: white;
  background: rgba(236, 72, 153, 0.25);
}
.audio-route-remove {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0 !important;
  color: #fca5a5;
}
.audio-routing-add {
  margin-top: 8px;
  min-height: 29px;
  color: #fff;
  border-color: #ec4899;
  background: rgba(190, 24, 93, 0.42);
}
.audio-routing-add:hover {
  background: #db2777;
}
:fullscreen .audio-routing-panel,
:-webkit-full-screen .audio-routing-panel {
  display: none !important;
}
@media (max-width: 1300px) and (min-width: 761px) {
  .audio-routing-panel {
    width: calc(100vw - 16px);
    min-width: 0;
  }
}
@media (max-width: 760px) {
  .audio-routing-panel {
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: calc(100vw - 12px);
    max-height: none;
  }
  .audio-routing-layout {
    grid-template-columns: 104px minmax(0, 1fr);
    max-height: none;
    min-height: 0;
  }
  .audio-route-row {
    grid-template-columns: 22px 18px 72px minmax(135px, 1fr) 82px 100px 52px 24px;
  }
  .audio-custom-band-row {
    grid-template-columns: 68px minmax(150px, 1fr) 132px;
    gap: 5px;
  }
  .audio-custom-dual {
    min-width: 150px;
  }
  .audio-custom-band-values {
    grid-template-columns: 58px 10px 58px;
  }
  .audio-custom-band-values input[type='number'] {
    width: 58px !important;
  }
  .header-audio-entry {
    display: none !important;
  }
}
.audio-panel {
  position: fixed;
  left: 8px;
  top: 48px;
  right: auto;
  bottom: auto;
  width: min(520px, calc(100vw - 16px));
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  z-index: 40;
  padding: 12px;
  backdrop-filter: blur(10px);
}
.audio-panel.hidden {
  display: none !important;
}
.audio-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.audio-panel-head strong {
  font-size: 12px;
}
.audio-source-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.audio-source-row select {
  width: 100%;
}
.audio-status {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.35;
}
.audio-diagnostics {
  margin: 0 0 10px;
  border: 1px solid rgba(51, 65, 85, 0.65);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.48);
  overflow: hidden;
}
.audio-diagnostics summary {
  cursor: pointer;
  padding: 7px 9px;
  font-size: 10px;
  color: #cbd5e1;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.audio-diagnostics summary::-webkit-details-marker {
  display: none;
}
.audio-diagnostics summary::after {
  content: '▾';
  color: var(--text-muted);
}
.audio-diagnostics[open] summary::after {
  content: '▴';
}
.audio-diagnostics-body {
  border-top: 1px solid rgba(51, 65, 85, 0.55);
  padding: 8px;
}
.audio-diagnostics-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.audio-diagnostics-actions button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 10px;
}
.audio-diagnostics-text {
  margin: 0;
  padding: 7px;
  border-radius: 6px;
  background: #080d17;
  color: #a5b4fc;
  font:
    9px/1.45 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  user-select: text;
}
.dual-range-wrap {
  position: relative;
  height: 30px;
  margin: 2px 0 4px;
}
.dual-range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 13px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #fb7185 0 33%, #fbbf24 33% 66%, #67e8f9 66% 100%);
  opacity: 0.55;
}
.dual-range-wrap input[type='range'] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: transparent;
  pointer-events: none;
  accent-color: #e2e8f0;
}
.dual-range-wrap input[type='range']::-webkit-slider-thumb {
  pointer-events: auto;
}
.dual-range-wrap input[type='range']::-moz-range-thumb {
  pointer-events: auto;
}
.dual-range-wrap .audio-gate-range {
  accent-color: #e2e8f0;
}
.audio-four-handle-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: -1px;
  margin-bottom: 4px;
  font-size: 8px;
  color: #94a3b8;
}
.audio-four-handle-labels span:last-child {
  text-align: right;
}
.audio-band-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.audio-band-labels span:nth-child(2) {
  text-align: center;
}
.audio-band-labels span:nth-child(3) {
  text-align: right;
}
.audio-meters {
  display: grid;
  gap: 6px;
}
.audio-meter-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 38px 66px;
  gap: 7px;
  align-items: center;
  font-size: 10px;
}
.audio-meter {
  height: 7px;
  border-radius: 8px;
  overflow: hidden;
  background: #0b1220;
  border: 1px solid rgba(51, 65, 85, 0.7);
}
.audio-meter > i {
  display: block;
  height: 100%;
  width: 0%;
  background: currentColor;
  transition: width 0.045s linear;
}
.audio-meter-row.bass {
  color: #fb7185;
}
.audio-meter-row.mid {
  color: #fbbf24;
}
.audio-meter-row.high {
  color: #67e8f9;
}
.audio-hotkey-note {
  margin-top: 9px;
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.4;
}
.audio-effect-row {
  margin: 3px 0 9px;
}
.audio-effect-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 10px;
  color: var(--text-muted);
}
.audio-effect-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.audio-effect-title input[type='checkbox'] {
  accent-color: #67e8f9;
}
.audio-effect-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 7px;
  align-items: center;
}
.audio-effect-control input[type='range'] {
  width: 100%;
  min-width: 0;
}
.audio-effect-control input[type='number'] {
  width: 52px;
  min-width: 0;
}
.audio-effect-row.disabled .audio-effect-control {
  opacity: 0.42;
}
.audio-cutoff-grid {
  display: grid;
  gap: 5px;
  margin: 3px 0 2px;
}
.audio-cutoff-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 72px;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
}
.audio-cutoff-row input[type='range'] {
  width: 100%;
  min-width: 0;
}
.audio-cutoff-row .text-mono {
  text-align: right;
  white-space: nowrap;
}
.audio-frequency-scale {
  display: flex;
  justify-content: space-between;
  margin: 0 79px 7px 69px;
  font-size: 8px;
  color: #64748b;
}
.audio-normalization-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 9px;
  padding: 6px 7px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.35);
  font-size: 9px;
  color: var(--text-muted);
}
.audio-reaction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 9px 0 5px;
  padding: 7px;
  border: 1px solid rgba(103, 232, 249, 0.3);
  border-radius: 6px;
  background: rgba(8, 47, 73, 0.2);
  font-size: 9px;
  color: var(--text-muted);
}
.audio-reaction-row > span {
  color: #cbd5e1;
}
.audio-reaction-row select {
  min-width: 132px;
  height: 27px;
  color: #a5f3fc;
  border-color: rgba(103, 232, 249, 0.38);
}
.audio-normalization-row label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.audio-normalization-row input[type='checkbox'] {
  accent-color: #67e8f9;
}
.audio-noise-gate-panel {
  margin: 5px 0 9px;
  padding: 7px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.35);
}
.audio-noise-gate-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-size: 9px;
  color: var(--text-muted);
}
.audio-noise-gate-row > label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-right: auto;
}
.audio-noise-gate-row input[type='checkbox'] {
  accent-color: #67e8f9;
}
.audio-noise-gate-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.audio-noise-gate-value input[type='number'] {
  width: 58px;
}
.audio-noise-gate-listen {
  min-height: 24px;
  height: 24px;
  padding: 2px 7px;
  font-size: 9px;
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(127, 29, 29, 0.18);
}
.audio-noise-gate-listen.listening {
  color: #0f172a;
  background: #fca5a5;
  border-color: #fecaca;
}
.audio-gate-threshold-wrap {
  position: relative;
  height: 22px;
  margin: 0 1px 2px;
}
.audio-gate-threshold-wrap input[type='range'] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  accent-color: #fb7185;
}
.audio-noise-gate-soft-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 54px;
  gap: 7px;
  align-items: center;
  margin: 6px 0 2px;
  font-size: 9px;
  color: var(--text-muted);
}
.audio-noise-gate-soft-row > label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.audio-noise-gate-soft-row input[type='checkbox'] {
  accent-color: #67e8f9;
}
.audio-noise-gate-soft-row input[type='range'] {
  width: 100%;
  min-width: 0;
  accent-color: #f59e0b;
}
.audio-noise-gate-soft-row input[type='number'] {
  width: 54px;
}
.audio-noise-gate-soft-row.soft-disabled .audio-noise-gate-soft-control,
.audio-noise-gate-soft-row.soft-disabled input[type='number'] {
  opacity: 0.42;
}
.audio-noise-gate-soft-control {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.audio-level-meter {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #070b13;
  border: 1px solid rgba(51, 65, 85, 0.75);
}
.audio-level-meter > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e 0%, #facc15 72%, #ef4444 100%);
  transition: width 0.045s linear;
}
.audio-level-meter.gated > i {
  opacity: 0.35;
}
.audio-level-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 9px;
  color: var(--text-muted);
}
.shortcut-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border-light);
  font: 11px monospace;
  color: #cbd5e1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease;
}
.shortcut-toast.show {
  opacity: 1;
}

#settingsSidebar {
  position: relative;
  transition:
    width 0.2s ease,
    min-width 0.2s ease;
}
.sidebar-collapse-btn {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  flex: 0 0 26px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
#settingsSidebar.desktop-collapsed {
  width: 42px !important;
  min-width: 42px !important;
  flex-basis: 42px !important;
}
#settingsSidebar.desktop-collapsed > #layerList,
#settingsSidebar.desktop-collapsed > .sidebar-content,
#settingsSidebar.desktop-collapsed .sidebar-section-title,
#settingsSidebar.desktop-collapsed .sidebar-layer-actions,
#settingsSidebar.desktop-collapsed .master-layer-btn {
  display: none !important;
}
#settingsSidebar.desktop-collapsed > .section-header {
  min-height: 42px;
  padding: 7px !important;
  justify-content: center;
  border-bottom: 0;
}

#settingsSidebar > .section-header {
  position: relative;
}
.sidebar-tool-rail .sidebar-collapse-btn {
  position: static;
  width: 34px;
  height: 34px;
  min-height: 34px;
  flex: 0 0 34px;
  margin: 0 0 3px;
  padding: 0;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  letter-spacing: -1px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(51, 65, 85, 0.76);
}
.sidebar-tool-rail .sidebar-collapse-btn:hover {
  color: #fff;
  background: var(--card-bg-light);
}
.sidebar-section-title {
  flex: 0 0 auto;
}
.sidebar-layer-actions {
  width: auto !important;
  flex: 0 0 auto !important;
  margin-left: auto;
  justify-content: flex-end;
}
.group-title-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.group-title-toggle input[type='checkbox'] {
  margin: 0;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  accent-color: #818cf8;
}
.lamp-settings-group .group-title-toggle input[type='checkbox'] {
  accent-color: #facc15;
}
.lamp-raster-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 6px;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.lamp-raster-toggle input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: #facc15;
}
.lamp-raster-toggle:has(input:checked) {
  color: #fde68a;
}
.lamp-quality-toggles {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 6px;
}
.lamp-quality-toggles .lamp-raster-toggle {
  margin: 0;
}
.lamp-hd-toggle:has(input:checked) {
  color: #a5f3fc;
}
.lamp-hd-toggle input {
  accent-color: #22d3ee;
}
#settingsSidebar.desktop-collapsed > .section-header {
  position: relative;
  padding: 7px !important;
}

@media (min-width: 761px) {
  .app-container > #settingsSidebar.desktop-collapsed {
    flex: 0 0 0px !important;
    flex-basis: 0px !important;
    width: 0px !important;
    min-width: 0px !important;
    max-width: 0px !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    visibility: hidden;
    pointer-events: none;
  }
  #settingsSidebar.desktop-collapsed > .section-header {
    display: none !important;
  }
}

html,
body {
  min-height: 100%;
  min-height: 100dvh;
  overscroll-behavior: none;
}

button,
select {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#mainContainer,
#mainCanvas,
#profileCanvas {
  touch-action: none;
}

.mobile-controls-toggle,
.mobile-sidebar-close,
.mobile-sidebar-backdrop {
  display: none;
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  html,
  body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  body {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }

  header {
    padding: 6px 8px;
    gap: 5px;
    align-items: stretch;
    flex-direction: column;
    min-width: 0;
    overflow: visible;
  }

  .header-brand {
    min-height: 30px;
    gap: 8px;
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
  }

  .brand-title h1 {
    font-size: 14px;
  }

  .brand-title p {
    display: none;
  }

  .header-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 5px;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 1px 1px 4px;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .header-actions > * {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .tap-nav,
  .tunnel-nav,
  .preset-nav,
  .random-nav,
  .morph-nav,
  .project-nav,
  .morph-library-nav {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .header-actions .divider {
    margin: 0 1px;
  }

  button,
  select {
    min-height: 38px;
    font-size: 13px;
    padding: 7px 10px;
  }

  button.btn-icon,
  .random-preset-btn,
  .minimal-morph-btn,
  .morph-settings-btn,
  .morph-btn,
  .project-morph-btn,
  .project-morph-settings-btn,
  .random-settings-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 7px;
  }

  input[type='number'],
  select {
    font-size: 16px !important;
  }

  input[type='number'] {
    width: 62px;
    min-height: 36px;
  }

  .mobile-number-stepper {
    gap: 4px;
    flex: 0 0 auto;
    max-width: 100%;
  }

  .mobile-number-stepper input[type='number'] {
    width: 64px !important;
    min-width: 54px;
    min-height: 38px;
    padding-left: 5px !important;
    padding-right: 5px !important;
    text-align: center !important;
  }

  .mobile-step-btn {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .morph-range-controls .mobile-number-stepper,
  .morph-fill-counts .mobile-number-stepper {
    flex: 0 0 auto;
  }

  input[type='range'] {
    min-height: 28px;
  }

  .preset-nav select {
    min-width: 158px;
    max-width: 178px;
  }

  .app-container {
    position: relative;
    display: block;
    min-width: 0;
    min-height: 0;
  }

  main#mainContainer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
  }

  aside#settingsSidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(92vw, 380px);
    max-width: 380px;
    height: 100dvh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 160;
    transform: translate3d(-105%, 0, 0);
    transition: transform 0.22s ease;
    box-shadow: 16px 0 42px rgba(0, 0, 0, 0.62);
    visibility: hidden;
  }

  aside#settingsSidebar.mobile-open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
  }

  .sidebar-tool-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 44px;
    z-index: 161;
    padding-top: calc(8px + env(safe-area-inset-top));
    transform: translate3d(-105%, 0, 0);
    visibility: hidden;
    transition: transform 0.22s ease;
  }
  .sidebar-tool-rail.mobile-open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
  }
  aside#settingsSidebar {
    left: 44px;
    width: min(calc(92vw - 44px), 336px);
    max-width: 336px;
  }

  aside#settingsSidebar .section-header {
    padding-left: 12px;
    padding-right: 52px;
  }

  .sidebar-collapse-btn {
    display: none !important;
  }

  .mobile-sidebar-close {
    position: absolute;
    top: calc(7px + env(safe-area-inset-top));
    right: 8px;
    z-index: 5;
    display: inline-flex;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    background: rgba(30, 41, 59, 0.96);
  }

  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: block;
    background: rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.2s ease,
      visibility 0.2s ease;
  }

  .mobile-sidebar-backdrop.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-controls-toggle {
    position: fixed;
    left: max(10px, env(safe-area-inset-left));
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 45;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.94);
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(9px);
    font-weight: 600;
  }

  .sidebar-content {
    padding: 10px 10px calc(80px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #layerList {
    max-height: 126px;
    -webkit-overflow-scrolling: touch;
  }

  .control-group {
    padding: 10px;
  }

  .grid-2 {
    gap: 7px;
  }

  #profileCanvas {
    height: 190px;
  }

  .floating-controls {
    left: auto;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 128px - env(safe-area-inset-left) - env(safe-area-inset-right));
    overflow-x: hidden;
    overflow-y: visible;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-content: flex-end;
    padding: 4px;
    gap: 4px;
    border-radius: 11px;
  }

  .floating-controls::-webkit-scrollbar {
    display: none;
  }

  .floating-controls > * {
    flex: 0 0 auto;
  }

  .mobile-only-action {
    display: inline-flex !important;
  }

  #btnZoomOut {
    order: -40;
  }
  #btnZoomIn {
    order: -39;
  }
  #btnResetView {
    order: -38;
  }
  #btnMobileMic {
    order: -37;
  }
  #btnAudioReactive {
    order: -36;
  }
  #btnMobileFullscreen {
    order: -35;
  }
  .floating-display-controls {
    order: 0;
  }
  #btnBackgroundImage,
  #btnClearBackgroundImage {
    flex: 0 0 auto;
  }
  #zoomDisplay {
    order: 2;
  }

  #btnZoomIn,
  #btnZoomOut {
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-color: rgba(129, 140, 248, 0.52);
    background: rgba(99, 102, 241, 0.14);
    color: #e0e7ff;
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
  }

  #btnMobileMic {
    border-color: rgba(236, 72, 153, 0.55);
    background: rgba(236, 72, 153, 0.12);
  }

  #btnAudioReactive {
    display: none !important;
  }

  .floating-controls > .divider {
    display: none;
  }

  .floating-controls .btn-icon,
  .floating-display-controls .display-control,
  .floating-display-controls .display-check,
  .floating-display-controls .display-color-control {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .floating-controls .divider {
    height: 22px;
  }

  .fps-counter {
    left: max(10px, env(safe-area-inset-left));
    bottom: calc(60px + env(safe-area-inset-bottom));
  }

  .info-pill {
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    padding: 5px 8px;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-panel-close {
    display: inline-flex !important;
    position: fixed;
    top: calc(90px + env(safe-area-inset-top));
    right: max(14px, calc(env(safe-area-inset-right) + 14px));
    z-index: 280;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    margin: 0;
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
  }

  .morph-fade-controls {
    grid-template-columns: minmax(0, 1fr) 58px auto;
    width: 100%;
  }

  .project-menu,
  .morph-library-nav .project-menu,
  .random-settings-panel,
  .morph-settings-panel,
  .tunnel-settings-panel,
  .tap-settings-panel {
    position: fixed;
    top: calc(84px + env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: calc(100dvh - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
    z-index: 220;
  }

  .project-menu,
  .morph-library-nav .project-menu,
  .random-settings-panel,
  .morph-settings-panel,
  .tunnel-settings-panel,
  .tap-settings-panel,
  .audio-panel,
  aside#settingsSidebar,
  .sidebar-content,
  .control-group,
  .control-row,
  .row-label,
  .row-inputs,
  .profile-canvas-container {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .profile-preset-row {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    width: 100%;
    min-width: 0;
    gap: 5px !important;
  }
  .profile-preset-row select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .morph-settings-grid {
    grid-template-columns: 1fr;
    min-width: 0;
    max-width: 100%;
  }

  .morph-setting-row,
  .morph-setting-row.interval-row,
  .morph-setting-row.morph-shape-row {
    grid-column: 1;
  }

  .morph-setting-row {
    min-height: 30px;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }
  .morph-setting-row > label,
  .morph-setting-row label {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }
  .morph-setting-row select,
  .morph-shape-head select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }
  .morph-shape-head {
    flex-wrap: wrap;
    min-width: 0;
  }
  .morph-dual-setting-row {
    grid-template-columns: 1fr;
  }
  .morph-shape-options {
    grid-template-columns: 1fr !important;
  }
  .morph-standard-only-btn {
    width: 100%;
  }
  .morph-range-controls {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    justify-content: flex-start;
  }

  .morph-cycle-controls,
  .morph-range-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .library-modal {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .library-card {
    width: 100%;
    max-height: 92dvh;
  }

  .audio-panel {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(66px + env(safe-area-inset-bottom));
    width: auto;
    max-height: calc(100dvh - 150px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
    z-index: 230;
  }

  .audio-source-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .audio-source-row select,
  .audio-source-row button {
    min-height: 44px;
  }
}

@media (max-width: 430px) {
  .brand-icon {
    display: none;
  }

  .header-brand {
    min-height: 24px;
  }

  .brand-title h1 {
    font-size: 13px;
  }

  .preset-nav select {
    min-width: 145px;
    max-width: 154px;
  }

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

  .floating-controls {
    max-width: calc(100vw - 118px - env(safe-area-inset-left) - env(safe-area-inset-right));
  }

  .mobile-controls-toggle {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 12px;
  }

  #zoomDisplay {
    display: none;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .header-brand {
    display: none;
  }

  header {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .project-menu,
  .morph-library-nav .project-menu,
  .random-settings-panel,
  .morph-settings-panel,
  .tunnel-settings-panel,
  .tap-settings-panel {
    top: calc(52px + env(safe-area-inset-top));
    max-height: calc(100dvh - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .mobile-panel-close {
    top: calc(58px + env(safe-area-inset-top));
  }

  aside#settingsSidebar {
    width: min(76vw, 360px);
  }
}

@media (prefers-reduced-motion: reduce) {
  aside#settingsSidebar,
  .mobile-sidebar-backdrop {
    transition: none;
  }
}

:fullscreen body {
  width: 100vw;
  height: 100vh;
}

:fullscreen header,
:fullscreen aside,
:fullscreen .sidebar-tool-rail,
:fullscreen .floating-controls,
:fullscreen .info-pill,
:fullscreen .audio-panel,
:fullscreen .tunnel-settings-panel,
:fullscreen .tap-settings-panel,
:fullscreen .library-modal,
:fullscreen .shortcut-toast,
:fullscreen .mobile-controls-toggle,
:fullscreen .mobile-sidebar-close,
:fullscreen .mobile-sidebar-backdrop {
  display: none !important;
}

:-webkit-full-screen header,
:-webkit-full-screen aside,
:-webkit-full-screen .sidebar-tool-rail,
:-webkit-full-screen .floating-controls,
:-webkit-full-screen .info-pill,
:-webkit-full-screen .audio-panel,
:-webkit-full-screen .tunnel-settings-panel,
:-webkit-full-screen .tap-settings-panel,
:-webkit-full-screen .library-modal,
:-webkit-full-screen .shortcut-toast,
:-webkit-full-screen .mobile-controls-toggle,
:-webkit-full-screen .mobile-sidebar-close,
:-webkit-full-screen .mobile-sidebar-backdrop {
  display: none !important;
}

:fullscreen .fps-counter {
  left: 12px;
  bottom: 12px;
}

:fullscreen .app-container {
  width: 100vw;
  height: 100vh;
  flex: none;
}

:fullscreen main#mainContainer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
}

:fullscreen #mainCanvas {
  width: 100vw;
  height: 100vh;
}

#gridPattern {
  display: none !important;
}
#paramShowGrid {
  display: none !important;
}

header {
  justify-content: flex-start;
}
.header-actions {
  width: 100%;
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  header {
    display: block !important;
    width: 100%;
    max-width: 100%;
    padding: 6px 8px !important;
    overflow: hidden !important;
    min-height: 50px;
  }
  .header-actions {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 5px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 0 3px !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }
  .header-actions::-webkit-scrollbar {
    display: none;
  }
  .header-actions > * {
    flex: 0 0 auto !important;
    min-width: auto !important;
    max-width: none !important;
  }
  .tap-nav,
  .tunnel-nav,
  .preset-nav,
  .random-nav,
  .morph-nav,
  .project-nav,
  .morph-library-nav {
    flex: 0 0 auto !important;
    min-width: auto !important;
    max-width: none !important;
  }
  .preset-nav select {
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
  }

  .project-menu,
  .morph-library-nav .project-menu,
  .random-settings-panel,
  .morph-settings-panel,
  .tunnel-settings-panel,
  .tap-settings-panel {
    top: calc(56px + env(safe-area-inset-top)) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    width: auto !important;
    max-width: calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
    max-height: calc(100dvh - 64px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  aside#settingsSidebar {
    width: min(100vw, 420px) !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    height: 100dvh !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  aside#settingsSidebar .section-header {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  #layerList {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden !important;
  }
  .sidebar-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 10px calc(74px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .control-group {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
  }
  .control-group-title,
  .control-row,
  .row-label,
  .row-inputs,
  .profile-canvas-container,
  .color-presets,
  .btn-group-toggle {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .control-row {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .row-label {
    width: 100%;
    gap: 6px;
  }
  .row-label > span:first-child,
  .row-label > label:first-child {
    min-width: 0;
  }
  .row-inputs {
    width: 100% !important;
    overflow: visible !important;
  }
  .row-inputs input[type='range'],
  .control-row > input[type='range'] {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .profile-preset-row {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) 38px !important;
    gap: 5px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  .profile-preset-row select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #profileCanvas {
    width: 100% !important;
    height: 160px !important;
    max-width: 100% !important;
  }
  .grid-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
  }
  .color-presets {
    flex-wrap: wrap !important;
  }

  .morph-settings-grid {
    grid-template-columns: 1fr !important;
    width: 100%;
    min-width: 0;
  }
  .morph-setting-row {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .morph-setting-row > label,
  .morph-setting-row label {
    min-width: 0 !important;
  }
  .morph-setting-row select,
  .morph-shape-head select {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .morph-range-controls {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .audio-panel {
    position: fixed !important;
    top: calc(56px + env(safe-area-inset-top)) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    z-index: 230 !important;
    -webkit-overflow-scrolling: touch;
  }
  .audio-source-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    width: 100%;
    min-width: 0;
  }
  .audio-source-row select {
    min-width: 0 !important;
    width: 100% !important;
  }
  .audio-cutoff-row,
  .audio-effect-control,
  .audio-noise-gate-soft-row,
  .tunnel-effect-control,
  .tunnel-fade-numeric-row {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #btnZoomIn,
  #btnZoomOut,
  #zoomDisplay {
    display: none !important;
  }
  #btnAudioReactive {
    display: none !important;
  }
  .floating-controls {
    left: auto !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: auto !important;
    max-width: calc(100vw - 124px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
    overflow: hidden !important;
    padding: 4px !important;
    gap: 3px !important;
    border-radius: 10px;
  }
  .floating-display-controls {
    display: flex !important;
    flex-flow: row nowrap !important;
    gap: 3px !important;
  }
  .floating-controls > .divider {
    display: none !important;
  }
  .floating-controls .btn-icon,
  .floating-display-controls .display-control,
  .floating-display-controls .display-check,
  .floating-display-controls .display-color-control {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    flex: 0 0 34px !important;
    padding: 4px !important;
  }
  #btnResetView {
    order: -20;
  }
  #btnMobileMic {
    order: -19;
  }
  #btnMobileFullscreen {
    order: -18;
  }
  .floating-display-controls {
    order: 0;
  }
  .mobile-controls-toggle {
    left: max(8px, env(safe-area-inset-left)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    min-height: 42px !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }
  .fps-counter {
    bottom: calc(58px + env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 430px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }
  .preset-nav select {
    width: 154px !important;
    min-width: 154px !important;
    max-width: 154px !important;
  }
  .floating-controls {
    max-width: calc(100vw - 118px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
  }
}

.morph-mode-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  overflow: hidden;
}
.morph-mode-card > .morph-setting-row {
  border: 0;
  background: transparent;
  padding: 3px 2px;
  min-height: 30px;
}
.morph-mode-card select {
  min-width: 190px !important;
}
.morph-dependent-row {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-5px);
  margin-top: -5px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  min-height: 0 !important;
  transition:
    max-height 0.22s ease,
    opacity 0.18s ease,
    transform 0.22s ease,
    margin 0.22s ease,
    padding 0.22s ease,
    border-width 0.22s ease;
}
.morph-dependent-row.is-visible {
  max-height: 180px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 0;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  border-width: 1px !important;
}
.morph-top-row {
  grid-column: 1/-1;
}
.morph-lightning-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}
.morph-lightning-grid label {
  justify-content: center;
  width: auto;
  white-space: nowrap;
}
.morph-lightning-grid .lightning-color-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.morph-lightning-grid input[type='color'] {
  width: 30px;
  height: 24px;
}
.lightning-effect-control {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) 54px auto;
  gap: 6px;
  align-items: center;
  width: 100%;
  font-size: 10px;
  color: var(--text-muted);
}
.lightning-effect-control input[type='range'] {
  width: 100%;
  min-width: 0;
}
.lightning-effect-control input[type='number'] {
  width: 54px !important;
  text-align: right;
}
.lightning-effect-control .unit {
  min-width: 18px;
  color: var(--text-muted);
}
#morphLightningSettingsRow.is-visible {
  max-height: 320px;
}
@media (max-width: 650px) {
  #morphLightningSettingsRow.is-visible {
    max-height: 460px;
  }
}

.sidebar-tool-rail {
  width: 44px;
  flex: 0 0 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 8px 5px;
  background: #0b1220;
  border-right: 1px solid var(--border-color);
  z-index: 12;
  box-shadow: 4px 0 14px rgba(0, 0, 0, 0.28);
}
.sidebar-tool-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid rgba(51, 65, 85, 0.72);
  background: rgba(15, 23, 42, 0.78);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
}
.sidebar-tool-btn.active {
  background: rgba(99, 102, 241, 0.19);
  border-color: rgba(129, 140, 248, 0.7);
  color: #e0e7ff;
}
.sidebar-tool-btn[data-sidebar-mode='lamps'].active {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.68);
  color: #fff59d;
}
.sidebar-tool-btn[data-sidebar-mode='web'].active {
  background: rgba(226, 232, 240, 0.14);
  border-color: rgba(226, 232, 240, 0.62);
  color: #f8fafc;
}
.sidebar-tool-btn[data-sidebar-mode='sweep'].active {
  background: rgba(125, 211, 252, 0.14);
  border-color: rgba(186, 230, 253, 0.72);
  color: #f0f9ff;
}
.sidebar-tool-btn .lamp-dot-icon {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}
.sidebar-tool-btn .sweep-icon {
  position: relative;
  width: 13px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 2px;
  overflow: hidden;
  display: block;
}
.sidebar-tool-btn .sweep-icon::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 4px;
  left: -5px;
  top: 8px;
  transform: rotate(-35deg);
  background: currentColor;
  box-shadow:
    0 0 7px currentColor,
    0 0 12px currentColor;
}
.sidebar-tool-btn .web-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
}
#settingsSidebar.sidebar-mode-lines .lamp-settings-group,
#settingsSidebar.sidebar-mode-lines .web-settings-group,
#settingsSidebar.sidebar-mode-lines .sweep-settings-group {
  display: none;
}
#settingsSidebar.sidebar-mode-lamps .sidebar-content > .control-group:not(.lamp-settings-group) {
  display: none;
}
#settingsSidebar.sidebar-mode-web .sidebar-content > .control-group:not(.web-settings-group) {
  display: none;
}
#settingsSidebar.sidebar-mode-sweep .sidebar-content > .control-group:not(.sweep-settings-group) {
  display: none;
}
.lamp-settings-group {
  border-color: rgba(250, 204, 21, 0.32);
}
.web-settings-group {
  border-color: rgba(226, 232, 240, 0.34);
}
.sweep-settings-group {
  border-color: rgba(125, 211, 252, 0.38);
}
.sweep-settings-group .group-title-toggle input {
  accent-color: #7dd3fc;
}
.lamp-adaptive-toggles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 12px;
}
.lamp-compact-toggle {
  font-size: 10px !important;
  font-weight: 400 !important;
  line-height: 1.2;
  gap: 5px !important;
}
.lamp-compact-toggle span {
  font-size: 10px !important;
  font-weight: 400 !important;
}
.line-profile-mode {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.line-profile-mode button {
  justify-content: center;
  padding: 5px 4px;
  font-size: 10px;
  min-width: 0;
}
.line-profile-mode button.active {
  background: rgba(129, 140, 248, 0.18);
  border-color: rgba(129, 140, 248, 0.62);
  color: #e0e7ff;
}
.line-profile-mode button:disabled {
  opacity: 0.34;
  cursor: not-allowed;
  filter: saturate(0.45);
}
.line-profile-application-mode {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.graffiti-gpu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
}
.graffiti-gpu-heading .text-mono {
  color: #86efac;
}
.line-main-mode {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.line-main-mode button {
  min-width: 0;
  padding: 5px 3px;
  font-size: 9px;
  justify-content: center;
}
.line-marker-type-grid,
.graffiti-nib-stamp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.line-marker-type-grid button,
.graffiti-nib-stamp-grid button {
  min-width: 0;
  min-height: 42px;
  padding: 4px 2px;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--border-light);
  background: rgba(15, 23, 42, 0.56);
  color: var(--text-muted);
}
.line-marker-type-grid button.active,
.graffiti-nib-stamp-grid button.active {
  color: #fff;
  border-color: rgba(129, 140, 248, 0.72);
  background: rgba(99, 102, 241, 0.22);
}
.profile-stamp-icon {
  width: 23px;
  height: 23px;
  display: block;
  position: relative;
}
.profile-stamp-icon.circle::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: currentColor;
}
.profile-stamp-icon.square::before {
  content: '';
  position: absolute;
  inset: 4px;
  background: currentColor;
  transform: rotate(45deg);
}
.profile-stamp-icon.slash::before {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 10px;
  height: 4px;
  border-radius: 3px;
  background: currentColor;
  transform: rotate(-35deg);
}
.profile-stamp-icon.cross::before,
.profile-stamp-icon.cross::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 10px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}
.profile-stamp-icon.cross::before {
  transform: rotate(45deg);
}
.profile-stamp-icon.cross::after {
  transform: rotate(-45deg);
}
.graffiti-stamp {
  width: 28px;
  height: 28px;
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.45);
}
.graffiti-stamp::before {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  top: 12px;
  height: 5px;
  background: currentColor;
  transform: rotate(-28deg);
  transform-origin: center;
}
.graffiti-stamp.pointed::before {
  clip-path: polygon(0 50%, 12% 12%, 88% 12%, 100% 50%, 88% 88%, 12% 88%);
}
.graffiti-stamp.blunt::before {
  border-radius: 1px;
}
.graffiti-stamp.pinched::before {
  clip-path: polygon(50% 0, 60% 34%, 100% 50%, 60% 66%, 50% 100%, 40% 66%, 0 50%, 40% 34%);
}
.graffiti-stamp.round::before {
  border-radius: 999px;
  height: 8px;
  top: 10px;
}
#lineSpriteBlock.line-mode-hidden,
#lineMarkerTypeRow.line-mode-hidden,
#graffitiProfileRow.line-mode-hidden,
#graffitiNibRow.line-mode-hidden,
#graffitiAngleRow.line-mode-hidden {
  display: none !important;
}

.line-profile-sprite-lock {
  margin-top: 5px;
  color: #94a3b8;
}
.sweep-control-grid {
  display: grid;
  gap: 8px;
}
.sweep-control-grid .row-inputs input[type='range'] {
  flex: 1 1 auto;
}
.sweep-glint-settings {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 8px;
  background: rgba(14, 116, 144, 0.045);
}
.sweep-glint-settings.hidden {
  display: none !important;
}
.sweep-lightning-settings {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-radius: 8px;
  background: rgba(14, 116, 144, 0.08);
}
.sweep-lightning-settings.hidden {
  display: none !important;
}
.sweep-lightning-settings .control-row {
  margin: 0;
}
.lightning-type-precision-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  align-items: end;
}
.lightning-type-precision-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.lightning-type-precision-field select {
  width: 100%;
  min-width: 0;
}
.lightning-glow-box {
  display: grid;
  gap: 7px;
  padding: 8px;
  margin-top: 1px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 7px;
  background: rgba(14, 116, 144, 0.055);
}
.lightning-glow-box-title {
  font-size: 9px;
  font-weight: 700;
  color: #bae6fd;
  letter-spacing: 0.02em;
}
.sweep-subsection {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 7px;
  background: rgba(14, 116, 144, 0.045);
}
.sweep-subsection-title {
  font-size: 9px;
  font-weight: 700;
  color: #bae6fd;
  letter-spacing: 0.02em;
}
.sweep-appearance-section {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.42);
}
.sweep-appearance-section .control-row {
  min-width: 0;
  margin: 0;
}
.sweep-appearance-title {
  font-size: 10px;
  font-weight: 700;
  color: #d8f2ff;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.17);
}
#sweepCoreAppearance {
  border-color: rgba(148, 163, 184, 0.36);
}
#sweepHaloAppearance {
  border-color: rgba(125, 211, 252, 0.39);
}
.sweep-check-row {
  justify-content: flex-start !important;
  gap: 7px;
}
.sweep-inline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sweep-mini-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  white-space: nowrap;
}
.lightning-color-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 7px;
  align-items: center;
  padding: 7px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.16);
}
.lightning-color-grid > span {
  min-width: 0;
  text-align: center;
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lightning-color-grid > input[type='color'] {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 2px;
}
@media (max-width: 520px) {
  .lightning-type-precision-row {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
}
.web-settings-group .group-title-toggle input {
  accent-color: #f8fafc;
}
.web-settings-note {
  font-size: 9px;
  line-height: 1.35;
  color: var(--text-muted);
}
.line-outline-row {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(51, 65, 85, 0.52);
}
.line-outline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.line-outline-head label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-main);
  font-weight: 600;
}
.line-outline-head input[type='checkbox'] {
  accent-color: #818cf8;
}
.line-outline-head input[type='color'] {
  width: 30px;
  height: 24px;
}
.line-outline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 6px;
  align-items: center;
}
.line-outline-control input[type='range'] {
  width: 100%;
  min-width: 0;
}
.line-outline-control input[type='number'] {
  width: 56px !important;
}
.line-slider-mult {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 58px;
  gap: 5px;
  align-items: center;
}
.line-slider-mult input[type='range'] {
  width: 100%;
  min-width: 0;
}
.line-slider-mult input[type='number'] {
  width: 58px !important;
  min-width: 0;
}

.line-slider-mult.line-slider-with-base {
  grid-template-columns: minmax(0, 1fr) 46px auto 46px;
  gap: 5px;
}
.line-slider-mult.line-slider-with-base input[type='number'] {
  width: 46px !important;
  min-width: 0;
  padding-left: 4px;
  padding-right: 4px;
}
.line-outline-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 3px;
}
.line-outline-mode {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 4px;
  border: 1px solid rgba(51, 65, 85, 0.62);
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.48);
  color: var(--text-muted);
  font-size: 9px;
  cursor: pointer;
  text-align: center;
}
.line-outline-mode:has(input:checked) {
  color: #e0e7ff;
  border-color: rgba(129, 140, 248, 0.68);
  background: rgba(99, 102, 241, 0.18);
}
.line-outline-mode input {
  accent-color: #818cf8;
}
.display-enable-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--text-main);
  font-weight: 600;
}
.display-enable-toggle input {
  accent-color: #818cf8;
}
.lamp-settings-group .display-enable-toggle input {
  accent-color: #facc15;
}
.master-layer-btn {
  width: auto !important;
  min-width: 78px;
  padding: 4px 8px !important;
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.35);
}
.master-layer-btn.active {
  color: #fff7ed;
  background: rgba(249, 115, 22, 0.18);
  border-color: rgba(251, 146, 60, 0.75);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.18);
}
.lamp-bokeh-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 5px;
}
.lamp-morph-settings {
  margin-top: 5px;
  padding-top: 6px;
  border-top: 1px solid rgba(250, 204, 21, 0.16);
}
.lamp-color-mode {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.lamp-color-mode button {
  min-width: 0;
  padding: 5px 4px;
  justify-content: center;
  font-size: 9px;
}
.lamp-color-mode button.active {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.62);
  color: #fef08a;
}
.lamp-color-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.lamp-color-row input[type='color'] {
  width: 40px;
  height: 28px;
}
.lamp-selected-palette {
  margin-top: 2px;
}
.lamp-selected-palette .color-swatch {
  width: 21px;
  height: 21px;
}
.lamp-control-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.lamp-control-grid .control-row {
  min-width: 0;
}
.lamp-slider-mult {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 56px;
  gap: 5px;
  align-items: center;
}
.lamp-slider-mult input[type='range'] {
  width: 100%;
  min-width: 0;
}
.lamp-slider-mult input[type='number'] {
  width: 56px !important;
}
.lamp-mult-label {
  color: var(--text-muted);
  font-size: 9px;
}
.lamp-type-preview {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}
@media (max-width: 650px) {
  .morph-mode-card select {
    min-width: 0 !important;
    max-width: 180px;
  }
  .morph-lightning-grid {
    grid-template-columns: 1fr;
  }
  .lamp-control-grid {
    grid-template-columns: 1fr;
  }
}

.file-settings-block {
  margin: 3px 0;
  padding: 4px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 6px;
  background: rgba(9, 13, 22, 0.34);
}
.file-settings-block.hidden {
  display: none !important;
}
.file-settings-block button {
  min-height: 30px;
}
.morph-size-row,
.morph-rotation-row {
  grid-column: 1 / -1;
}
.morph-size-row > label,
.morph-rotation-row > label {
  width: 100%;
}

.morph-effect-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 7px;
  align-items: center;
  flex: 1 1 220px;
  min-width: 150px;
  margin-left: auto;
}
.morph-effect-control input[type='range'] {
  width: 100%;
  min-width: 0;
}
.morph-effect-control input[type='number'] {
  width: 54px !important;
  min-width: 0;
}
.morph-multiplier-label {
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}
.morph-inline-summary {
  margin-left: 6px;
  white-space: nowrap;
}
.morph-rotation-number-controls {
  display: grid;
  grid-template-columns: 50px auto 50px auto auto 56px;
  gap: 4px;
  align-items: center;
  margin-left: auto;
  min-width: 0;
}
.morph-rotation-number-controls input[type='number'] {
  width: 50px !important;
  text-align: right !important;
}
.morph-rotation-number-controls .rotation-multiplier {
  width: 56px !important;
}
.morph-rotation-direction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  margin-left: 8px;
}
.morph-opacity-row {
  grid-column: 1 / -1;
}
.morph-opacity-reset-btn {
  margin-left: 4px;
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.38);
  background: rgba(30, 64, 175, 0.12);
}
.morph-opacity-reset-btn:hover {
  color: #fff;
  background: rgba(37, 99, 235, 0.3);
  border-color: rgba(96, 165, 250, 0.68);
}
.morph-line-color-row {
  border-bottom: 1px solid rgba(51, 65, 85, 0.52) !important;
}
.morph-global-hue-row {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding-top: 4px !important;
}
.morph-global-hue-row > label {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 10px;
}
.morph-global-hue-controls {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 9px;
}
.morph-global-hue-controls input[type='number'] {
  width: 58px !important;
  text-align: right !important;
}
.morph-global-hue-row.color-disabled .morph-global-hue-controls {
  opacity: 0.45;
}
.morph-line-palette {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}
.morph-line-palette-btn {
  min-height: 23px;
  height: 23px;
  padding: 2px 6px;
  font-size: 9px;
  white-space: nowrap;
}
.morph-line-palette-btn.active {
  color: #0b1220;
  background: #67e8f9;
  border-color: #a5f3fc;
}
.morph-line-palette-btn[data-line-morph-palette='fire'] {
  border-color: rgba(249, 115, 22, 0.55);
}
.morph-line-palette-btn[data-line-morph-palette='ice'] {
  border-color: rgba(56, 189, 248, 0.55);
}
.morph-line-palette-btn[data-line-morph-palette='sex'] {
  border-color: rgba(244, 63, 94, 0.55);
}
.morph-line-palette-btn[data-line-morph-palette='holy'] {
  border-color: rgba(250, 204, 21, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.morph-line-color-row.color-disabled .morph-line-palette {
  opacity: 0.58;
  pointer-events: auto;
}
.morph-spiral-order-controls {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  flex-wrap: wrap;
}
.morph-spiral-order-controls .morph-interval {
  width: 44px !important;
}
.morph-spiral-link-check {
  display: inline-flex !important;
  width: auto !important;
  flex: 0 0 auto !important;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  margin-left: 5px;
}
.morph-spiral-order-controls.linked input[type='number'] {
  opacity: 0.45;
}
@media (max-width: 650px) {
  .morph-line-palette {
    width: 100%;
    margin-left: 0;
  }
  .morph-spiral-order-controls {
    margin-left: 0;
    width: 100%;
  }
}
@media (max-width: 760px) {
  .morph-effect-control {
    grid-template-columns: minmax(90px, 1fr) 52px;
    min-width: 130px;
  }
  .morph-rotation-number-controls {
    grid-template-columns: 46px auto 46px auto auto 52px;
  }
  .morph-rotation-number-controls input[type='number'] {
    width: 46px !important;
  }
  .morph-rotation-number-controls .rotation-multiplier {
    width: 52px !important;
  }
  .morph-rotation-direction {
    margin-left: 0;
  }
}

.preset-chooser-panel,
.morph-type-nav {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.morph-type-nav select {
  min-width: 190px;
}
.header-choice-hidden {
  display: none !important;
}
.file-settings-block,
.file-morphing-block,
.file-defaults-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.55);
}
.file-settings-block.hidden,
.file-morphing-block.hidden,
.file-defaults-block.hidden {
  display: none !important;
}
.file-setting-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  font-size: 10px;
  color: var(--text-main);
  cursor: pointer;
}
.file-setting-toggle input {
  accent-color: #818cf8;
}
.file-morphing-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 4px;
}
.file-morphing-actions button {
  justify-content: flex-start;
  min-height: 27px;
  padding: 4px 7px;
  font-size: 10px;
  border: 1px solid var(--border-light);
  background: rgba(30, 41, 59, 0.55);
}
.file-morphing-reset {
  margin-top: 3px;
  min-height: 27px !important;
  padding: 4px 7px !important;
  font-size: 10px !important;
  color: #fecaca !important;
  border-color: rgba(248, 113, 113, 0.42) !important;
  background: rgba(127, 29, 29, 0.18) !important;
}
.file-morphing-block .morph-settings-panel {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  overflow: visible !important;
  box-shadow: none !important;
  padding: 7px !important;
  background: rgba(15, 23, 42, 0.35) !important;
}
.file-morphing-block .mobile-panel-close {
  display: none !important;
}
.lamp-position-mode {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.lamp-position-mode button {
  justify-content: center;
  padding: 5px 5px;
  font-size: 9px;
  min-width: 0;
  white-space: normal;
  line-height: 1.15;
}
.lamp-position-mode button.active {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.62);
  color: #fef08a;
}
.lamp-morph-motion-mode {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.lamp-morph-motion-mode button {
  font-size: 10px;
}
.lamp-morph-motion-mode button.active {
  background: rgba(103, 232, 249, 0.16);
  border-color: rgba(103, 232, 249, 0.58);
  color: #a5f3fc;
}
.lamp-morph-motion-note {
  font-size: 9px;
  line-height: 1.3;
  color: var(--text-muted);
}
@media (max-width: 820px) {
  .morph-type-nav select {
    min-width: 125px;
    max-width: 155px;
  }
  .file-morphing-actions {
    grid-template-columns: 1fr;
  }
}

.file-shapes-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  margin: 3px 0;
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.55);
  min-width: 0;
  max-width: 100%;
}
.file-shapes-block.hidden {
  display: none !important;
}
.file-shapes-block button {
  min-height: 30px;
  border: 1px solid var(--border-light) !important;
  background: rgba(30, 41, 59, 0.42) !important;
}
#projectMenu {
  max-width: calc(100vw - 16px) !important;
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
#projectMenu > *,
#projectMenu .file-settings-block,
#projectMenu .file-shapes-block,
#projectMenu .file-morphing-block,
#projectMenu .morph-settings-panel,
#projectMenu .morph-settings-grid,
#projectMenu .morph-mode-card,
#projectMenu .morph-setting-row {
  min-width: 0;
  max-width: 100%;
}
#projectMenu select {
  max-width: 100%;
}
.random-settings-panel,
.tunnel-settings-panel,
.tap-settings-panel,
.audio-panel {
  max-height: calc(100dvh - 16px) !important;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 820px) {
  #projectMenu {
    max-width: calc(100vw - 12px) !important;
    max-height: calc(100dvh - 12px) !important;
  }
}

.project-menu,
.morph-settings-panel,
.random-settings-panel,
.tunnel-settings-panel,
.tap-settings-panel,
.audio-panel,
.project-morph-settings-panel,
.audio-param-menu,
.audio-route-group-menu {
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.audio-param-menu,
.audio-route-group-menu {
  max-width: calc(100vw - 16px);
  overflow-x: hidden;
}

.morph-checkbox-tools {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  flex: 0 0 auto;
}
.morph-checkbox-tools button {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0 !important;
  justify-content: center;
  border-radius: 6px;
}
.morph-clear-checks {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.07);
  font-size: 14px !important;
}
.morph-clear-checks:hover {
  background: rgba(148, 163, 184, 0.16);
}
.morph-undo-checks {
  color: #67e8f9;
  border-color: rgba(103, 232, 249, 0.34);
  background: rgba(103, 232, 249, 0.07);
  font-size: 15px !important;
}
.morph-undo-checks:disabled {
  opacity: 0.28;
  cursor: default;
}
.morph-nav .morph-settings-panel {
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.morph-shape-options .morph-segmented-switch button.active {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 0 0 1px rgba(99, 102, 241, 0.18);
}

.audio-routing-panel {
  left: 8px !important;
  right: auto !important;
  width: 50vw !important;
  min-width: 0 !important;
  max-width: calc(100vw - 16px) !important;
}
.audio-routing-main {
  overflow-y: auto !important;
  overflow-x: auto !important;
}
.audio-route-row {
  min-width: 0 !important;
  grid-template-columns:
    22px 18px minmax(68px, 88px) minmax(130px, 1.5fr) minmax(108px, 0.95fr) minmax(100px, 1fr)
    64px 24px !important;
}
.audio-route-row > * {
  min-width: 0;
  max-width: 100%;
}
.audio-route-row > input[type='number'] {
  width: 100% !important;
}
#projectMenu,
#projectMenu:has(#fileMorphingBlock:not(.hidden)) {
  width: 260px !important;
  min-width: 260px !important;
  max-width: calc(100vw - 24px) !important;
}
#projectMenu .file-morphing-block,
#projectMenu .file-settings-block,
#projectMenu .file-shapes-block,
#projectMenu .file-defaults-block {
  width: 100% !important;
}
.preset-chooser-panel,
.project-chooser-panel,
.morph-type-nav {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.project-chooser-panel select {
  min-width: 190px;
  max-width: 250px;
}
.project-chooser-panel select.project-folder-empty {
  color: var(--text-muted);
}
@media (max-width: 1050px) {
  .project-chooser-panel select {
    min-width: 145px;
    max-width: 180px;
  }
}
@media (max-width: 1200px) {
  .audio-routing-layout {
    grid-template-columns: 112px minmax(0, 1fr) !important;
  }
  .audio-route-row {
    grid-template-columns: 22px 18px 76px minmax(0, 1fr) 64px 24px !important;
    grid-template-rows: auto auto;
  }
  .audio-route-row > :nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .audio-route-row > :nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  .audio-route-row > :nth-child(3) {
    grid-column: 3;
    grid-row: 1;
  }
  .audio-route-row > :nth-child(4) {
    grid-column: 4 / 6;
    grid-row: 1;
  }
  .audio-route-row > :nth-child(5) {
    grid-column: 1 / 4;
    grid-row: 2;
    justify-content: flex-start;
  }
  .audio-route-row > :nth-child(6) {
    grid-column: 4;
    grid-row: 2;
  }
  .audio-route-row > :nth-child(7) {
    grid-column: 5;
    grid-row: 2;
    width: 100% !important;
  }
  .audio-route-row > :nth-child(8) {
    grid-column: 6;
    grid-row: 1;
  }
}
@media (max-width: 760px) {
  .audio-routing-panel {
    left: 4px !important;
    right: 4px !important;
    top: 4px !important;
    bottom: 4px !important;
    width: auto !important;
  }
  .audio-routing-layout {
    grid-template-columns: 92px minmax(0, 1fr) !important;
  }
  .project-chooser-panel select {
    min-width: 132px;
    max-width: 155px;
  }
  #projectMenu {
    width: min(260px, calc(100vw - 12px)) !important;
    min-width: 0 !important;
  }
}

#projectMenu > button,
#projectMenu .file-settings-block > button,
#projectMenu .file-shapes-block > button,
#projectMenu .file-morphing-actions > button,
#projectMenu .file-defaults-block > button,
#projectMenu .file-morphing-reset {
  justify-content: flex-start !important;
  text-align: left !important;
}
#projectMenu .file-setting-toggle {
  justify-content: flex-start !important;
  text-align: left !important;
}

@media (max-width: 760px) {
  .sidebar-tool-rail {
    width: 46px !important;
  }
  aside#settingsSidebar {
    left: 46px !important;
    width: min(calc(96vw - 46px), 390px) !important;
    max-width: 390px !important;
  }
  aside#settingsSidebar .sidebar-content {
    padding: 10px 10px calc(72px + env(safe-area-inset-bottom)) !important;
  }
  aside#settingsSidebar .control-group {
    padding: 10px !important;
    gap: 9px !important;
  }
  aside#settingsSidebar .control-row {
    gap: 5px !important;
  }
  .profile-library-tabs {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 3px !important;
    width: 100% !important;
  }
  .profile-library-tab {
    min-width: 0 !important;
    padding: 5px 2px !important;
    font-size: 9px !important;
    line-height: 1.12 !important;
    white-space: normal !important;
  }
  .contour-mode-toggle {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
  .contour-mode-toggle button {
    min-height: 38px !important;
    font-size: 9px !important;
    padding: 4px 2px !important;
  }
  .spiral-settings-block {
    padding: 7px !important;
    gap: 7px !important;
  }
  .spiral-settings-row {
    grid-template-columns: minmax(0, 1fr) 78px !important;
  }
  .spiral-settings-row input[type='number'] {
    width: 78px !important;
    min-height: 34px !important;
    font-size: 16px !important;
  }
  .morph-profile-group-switch {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
  .morph-profile-group-switch button {
    min-width: 0 !important;
    padding: 4px 2px !important;
    font-size: 9px !important;
  }
  .morph-shape-options {
    grid-template-columns: 1fr 1fr !important;
  }
  .morph-settings-panel,
  .random-settings-panel,
  .tunnel-settings-panel,
  .tap-settings-panel {
    left: max(6px, env(safe-area-inset-left)) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    top: calc(58px + env(safe-area-inset-top)) !important;
    max-height: calc(100dvh - 66px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }
  .morph-settings-grid {
    grid-template-columns: 1fr !important;
  }
  .floating-display-controls #paramBoundingCircleColor {
    display: none !important;
  }
}
@media (max-width: 430px) {
  aside#settingsSidebar {
    width: calc(100vw - 46px) !important;
    max-width: none !important;
  }
  .profile-library-tab {
    font-size: 8px !important;
  }
  .morph-shape-options {
    grid-template-columns: 1fr !important;
  }
}

.shape-star-icon {
  font-size: 23px;
  line-height: 1;
  transform: translateY(-1px);
}
#btnSidebarShape.feature-enabled .shape-star-icon {
  color: #f8fafc;
  text-shadow: 0 0 8px rgba(129, 140, 248, 0.85);
}
.rainbow-line-icon {
  width: 22px;
  height: 4px;
  border-radius: 999px;
  display: block;
  transform: rotate(-18deg);
  background: #64748b;
  box-shadow: none;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}
#btnSidebarLines.feature-enabled .rainbow-line-icon {
  background: linear-gradient(90deg, #ef4444, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef);
  box-shadow: 0 0 8px rgba(103, 232, 249, 0.55);
}
#btnSidebarLines.graffiti-enabled .rainbow-line-icon {
  height: 7px;
  filter: saturate(1.25);
  box-shadow: 0 0 10px rgba(244, 114, 182, 0.72);
}
#btnSidebarLamps.feature-enabled {
  color: #fff59d;
}
#btnSidebarLamps.feature-enabled .lamp-dot-icon {
  background: #fde047;
  box-shadow:
    0 0 5px #fde047,
    0 0 13px #f59e0b;
}
#btnSidebarWeb.feature-enabled {
  color: #f8fafc;
}
#btnSidebarWeb.feature-enabled .web-icon {
  filter: drop-shadow(0 0 4px rgba(248, 250, 252, 0.9));
}
#btnSidebarSweep.feature-enabled {
  color: #e0f2fe;
}
#btnSidebarSweep.feature-enabled .sweep-icon::after {
  box-shadow:
    0 0 7px currentColor,
    0 0 14px currentColor;
}
.sidebar-tool-btn.active {
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.18);
}
#settingsSidebar.sidebar-mode-shape .sidebar-content > .control-group:not(.shape-settings-group) {
  display: none !important;
}
#settingsSidebar.sidebar-mode-lines .sidebar-content > .control-group:not(.line-settings-group) {
  display: none !important;
}
#settingsSidebar.sidebar-mode-lamps .sidebar-content > .control-group:not(.lamp-settings-group) {
  display: none !important;
}
#settingsSidebar.sidebar-mode-web .sidebar-content > .control-group:not(.web-settings-group) {
  display: none !important;
}
#settingsSidebar.sidebar-mode-sweep .sidebar-content > .control-group:not(.sweep-settings-group) {
  display: none !important;
}
.graffiti-nib-row {
  margin-top: 6px;
  padding: 8px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 7px;
  background: rgba(120, 53, 15, 0.08);
  display: grid;
  gap: 9px;
}
.graffiti-nib-row.hidden {
  display: none !important;
}
.graffiti-raster-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 6px;
  background: rgba(120, 53, 15, 0.055);
  font-size: 10px;
  color: var(--text-main);
  cursor: pointer;
}
.graffiti-raster-option input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #f59e0b;
}
.graffiti-raster-option span {
  white-space: nowrap;
}
.graffiti-nib-row > label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 1.35fr);
  gap: 8px;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
}
.graffiti-nib-row select {
  width: 100%;
  min-width: 0;
}
.graffiti-wide-slider {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.graffiti-wide-slider .row-label {
  font-size: 10px;
}
.graffiti-range-with-multiplier {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto 64px;
  gap: 7px;
  align-items: center;
  min-width: 0;
}
.graffiti-range-with-multiplier input[type='range'] {
  width: 100%;
  min-width: 0;
  accent-color: #f59e0b;
}
.graffiti-range-with-multiplier input[type='number'] {
  width: 64px !important;
  min-width: 0;
}
.graffiti-variation {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(245, 158, 11, 0.2);
  display: grid;
  gap: 8px;
}
.graffiti-variation-title {
  font-size: 10px;
  font-weight: 700;
  color: #fde68a;
}
.graffiti-variation-scope {
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 6px;
  background: rgba(120, 53, 15, 0.055);
}
.graffiti-variation-scope select {
  width: 100%;
}
.graffiti-variation-every-n.hidden {
  display: none !important;
}
.graffiti-variation-every-n input[type='range'] {
  width: 100%;
  min-width: 0;
  accent-color: #f59e0b;
}
.graffiti-variation-block {
  padding: 7px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 6px;
  display: grid;
  gap: 7px;
  background: rgba(120, 53, 15, 0.055);
}
.graffiti-variation-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-main);
}
.graffiti-variation-head input {
  accent-color: #f59e0b;
}
.graffiti-variation-control {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 9px;
  color: var(--text-muted);
}
.graffiti-variation-control .row-label {
  font-size: 9px;
}
.graffiti-variation-control input[type='range'] {
  width: 100%;
  min-width: 0;
  accent-color: #f59e0b;
}
.graffiti-variation-control .text-mono {
  text-align: right;
  color: #fbbf24;
  font-size: 9px;
}
.graffiti-rotation-strength {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto 64px;
  gap: 7px;
  align-items: center;
  min-width: 0;
}
.graffiti-rotation-strength input[type='range'] {
  width: 100%;
  min-width: 0;
}
.graffiti-rotation-strength input[type='number'] {
  width: 64px !important;
}
.graffiti-variation-block.variation-disabled .graffiti-variation-control,
.graffiti-variation:has(#graffitiSizeVariationBlock.variation-disabled):has(#graffitiRotationVariationBlock.variation-disabled) .graffiti-variation-scope,
#graffitiNibRow:has(#graffitiSizeVariationBlock.variation-disabled):has(#graffitiRotationVariationBlock.variation-disabled) > .hint-text {
  display: none;
}
@media (max-width: 760px) {
  .sidebar-tool-rail.mobile-open {
    pointer-events: auto !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    background: #0b1220 !important;
    isolation: isolate;
  }
  .sidebar-tool-rail .sidebar-tool-btn {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    filter: none !important;
    opacity: 1 !important;
  }
  .mobile-sidebar-backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .morph-settings-panel {
    width: min(96vw, 560px) !important;
  }
  .morph-setting-row,
  .morph-setting-row label,
  .morph-settings-note,
  .morph-settings-subtitle {
    font-size: 11px !important;
    line-height: 1.35 !important;
  }
  .morph-settings-panel select,
  .morph-settings-panel button {
    font-size: 11px !important;
    min-height: 30px;
  }
  .morph-profile-group-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .profile-library-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #btnMobileMic {
    order: -19;
  }
  #btnMobileAudioRouting {
    order: -18;
  }
  #btnMobileFullscreen {
    order: -17;
  }
  #btnMobileMic,
  #btnMobileAudioRouting {
    display: inline-flex !important;
  }
  .graffiti-nib-row > label {
    grid-template-columns: 1fr;
  }
}

#btnSidebarLines.active:not(.feature-enabled),
#btnSidebarLamps.active:not(.feature-enabled),
#btnSidebarWeb.active:not(.feature-enabled),
#btnSidebarSweep.active:not(.feature-enabled) {
  color: var(--text-muted) !important;
  background: rgba(99, 102, 241, 0.19) !important;
  border-color: rgba(129, 140, 248, 0.7) !important;
}

.file-setting-toggle {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.file-setting-toggle:hover {
  background: rgba(51, 65, 85, 0.42);
  border-color: rgba(71, 85, 105, 0.45);
}
.file-setting-toggle input[type='checkbox'] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  accent-color: #818cf8;
}
.file-setting-toggle > span {
  min-width: 0;
  flex: 1 1 auto;
}
#fpsLimitSetting {
  width: 64px !important;
  flex: 0 0 64px;
  text-align: center !important;
}

@media (max-width: 760px) {
  header,
  .header-actions,
  .app-container,
  main#mainContainer {
    max-width: 100vw;
  }
  .header-actions {
    overflow-x: hidden !important;
  }
  #projectMenu {
    left: max(6px, env(safe-area-inset-left)) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    top: calc(58px + env(safe-area-inset-top)) !important;
    max-height: calc(100dvh - 66px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
  #projectMenu > button,
  #projectMenu .file-shapes-block button,
  #projectMenu .file-morphing-actions button,
  #projectMenu .file-morphing-reset {
    width: 100%;
    min-width: 0;
    min-height: 42px !important;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
  }
  #projectMenu .file-setting-toggle {
    min-height: 42px;
    padding: 9px 8px;
    font-size: 12px;
    align-items: center;
  }
  #projectMenu .file-setting-toggle input[type='checkbox'] {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
  }
  .graffiti-range-with-multiplier,
  .graffiti-rotation-strength {
    grid-template-columns: minmax(0, 1fr) auto 58px !important;
    width: 100%;
  }
  .graffiti-range-with-multiplier input[type='number'],
  .graffiti-rotation-strength input[type='number'] {
    width: 58px !important;
  }
  .graffiti-wide-slider,
  .graffiti-variation,
  .graffiti-variation-block,
  .graffiti-variation-control {
    min-width: 0;
    max-width: 100%;
  }
  .morph-size-row > label,
  .morph-rotation-row > label {
    gap: 6px;
  }
  .morph-effect-control {
    width: 100%;
    margin-left: 0;
  }
  .morph-rotation-number-controls {
    width: 100%;
    margin-left: 0;
    grid-template-columns: minmax(46px, 1fr) auto minmax(46px, 1fr) auto auto minmax(52px, 1fr);
  }
  .morph-rotation-direction {
    width: 100%;
    margin-left: 0;
  }
  .morph-line-palette,
  .morph-harmony-palette {
    max-width: 100%;
  }
  .floating-controls {
    max-height: calc(100dvh - 140px);
  }
}
.morph-profile-group-switch {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.morph-profile-group-check {
  min-width: 0;
  min-height: 30px;
  padding: 5px 6px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  font-size: 9px;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.28);
}
.morph-profile-group-check input[type='checkbox'] {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 0;
  accent-color: #67e8f9;
}
.morph-profile-group-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .morph-settings-panel * {
    box-sizing: border-box;
  }
  .morph-settings-panel .morph-settings-grid {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }
  .morph-setting-row.compact-morph-row {
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100%;
    min-width: 0;
  }
  .morph-setting-row.compact-morph-row > label,
  .morph-setting-row.compact-morph-row .morph-row-check {
    width: 100% !important;
    max-width: 100%;
    margin-left: 0 !important;
    white-space: normal !important;
  }
  .morph-setting-row.compact-morph-row .morph-row-check {
    justify-content: flex-start;
  }
  .morph-setting-row.compact-morph-row .morph-range-controls {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }
  .morph-profile-group-switch {
    grid-template-columns: 1fr 1fr !important;
  }
  .morph-profile-group-check {
    min-height: 38px;
    font-size: 11px;
  }
  .morph-profile-group-check input[type='checkbox'] {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .morph-settings-panel .morph-settings-title,
  .random-settings-panel .morph-settings-title {
    position: sticky;
    top: -7px;
    z-index: 12;
    margin: -7px -7px 6px;
    padding: 7px;
    background: rgba(15, 23, 42, 0.985);
    border-bottom: 1px solid rgba(51, 65, 85, 0.7);
  }
  .mobile-panel-close {
    position: static !important;
    top: auto !important;
    right: auto !important;
    margin-left: auto !important;
    flex: 0 0 38px;
  }

  body:has(#settingsSidebar.mobile-open) #btnMobileControls,
  body:has(#projectMenu:not(.hidden)) #btnMobileControls,
  body:has(#morphSettingsPanel:not(.hidden)) #btnMobileControls,
  body:has(#randomSettingsPanel:not(.hidden)) #btnMobileControls,
  body:has(#tunnelSettingsPanel:not(.hidden)) #btnMobileControls,
  body:has(#tapSettingsPanel:not(.hidden)) #btnMobileControls,
  body:has(#audioReactivePanel:not(.hidden)) #btnMobileControls,
  body:has(#audioRoutingPanel:not(.hidden)) #btnMobileControls,
  body:has(#libraryModal:not(.hidden)) #btnMobileControls {
    display: none !important;
  }
}
@media (max-width: 360px) {
  aside#settingsSidebar {
    width: calc(100vw - 46px) !important;
  }
  .graffiti-range-with-multiplier,
  .graffiti-rotation-strength {
    grid-template-columns: minmax(0, 1fr) auto 54px !important;
    gap: 5px;
  }
  .morph-rotation-number-controls {
    gap: 3px;
    grid-template-columns: 44px auto 44px auto auto 48px;
  }
  .morph-rotation-number-controls input[type='number'] {
    width: 44px !important;
  }
  .morph-rotation-number-controls .rotation-multiplier {
    width: 48px !important;
  }
  .morph-profile-group-switch {
    grid-template-columns: 1fr !important;
  }
}

.morph-mode-card .morph-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.morph-mode-card .morph-top-row > label[for='morphMode'] {
  flex: 1 1 auto;
  min-width: 0;
}
.morph-mode-inline-check {
  width: auto !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 9px;
}
.morph-mode-inline-check.hidden {
  display: none !important;
}
.morph-default-diversity-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.morph-default-diversity-row > label {
  width: auto !important;
  flex: 0 0 auto;
  white-space: nowrap;
}
.morph-default-diversity-row > label:last-child {
  margin-left: auto;
}
.morph-compact-pair-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3px;
  min-width: 0;
}
.morph-compact-pair-row .morph-pair-cell {
  min-width: 0;
  padding: 3px 5px;
  gap: 3px;
  flex-wrap: wrap;
}
.morph-compact-pair-row .morph-pair-cell > label:first-child {
  min-width: 0;
  flex: 1 1 150px;
}
.morph-compact-pair-row .morph-pair-cell .morph-range-controls {
  margin-left: 5px;
}
.morph-compact-pair-row .morph-pair-cell .morph-row-check {
  flex: 0 0 auto;
  font-size: 8px;
}
.morph-pair-title {
  white-space: nowrap;
  color: #cbd5e1;
}
.morph-shape-row {
  padding: 3px 5px !important;
}
.morph-shape-checkline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  min-width: 0;
}
.morph-shape-master-check {
  display: inline-flex !important;
  width: auto !important;
  min-height: 26px;
  padding: 3px 5px;
  border: 1px solid rgba(51, 65, 85, 0.62);
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.35);
  white-space: nowrap;
}
.morph-inline-section-title {
  color: #cbd5e1;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 2px;
}
.morph-right-check {
  margin-left: auto !important;
}
.morph-speed-slide-row .morph-pair-cell {
  min-width: 0;
}
.morph-speed-slide-row .morph-pair-cell > label {
  width: 100%;
  min-width: 0;
}
.morph-speed-slide-row select {
  margin-left: auto;
  min-width: 0;
  width: min(178px, 58%);
  max-width: 178px;
}
.morph-shape-checkline .morph-profile-group-switch {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}
.morph-shape-checkline .morph-profile-group-check {
  min-height: 26px;
  padding: 3px 5px;
}
.morph-shape-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  min-width: 0;
}
.morph-shape-family-label {
  width: auto !important;
  flex: 1 1 auto;
  min-width: 0;
}
.morph-shape-family-label select {
  margin-left: auto;
  min-width: 105px;
  max-width: 145px;
}
.morph-shape-meta-line .morph-spline-points-row {
  margin: 0 0 0 auto;
  flex: 0 1 220px;
  justify-content: flex-end;
}
.morph-shape-meta-line .morph-spline-points-switch {
  width: min(132px, 55%);
}
.morph-shape-meta-line .morph-spline-point-input {
  width: 58px !important;
}
.morph-spiral-row {
  gap: 5px;
  flex-wrap: wrap;
}
.morph-spiral-row > label:first-child {
  min-width: 145px;
}
.morph-spiral-preserve {
  margin-left: 0 !important;
}
.morph-spiral-morph-check {
  margin-left: auto !important;
  flex: 0 0 auto;
}
@media (max-width: 760px) {
  .morph-compact-pair-row {
    grid-template-columns: 1fr;
  }
  .morph-compact-pair-row .morph-pair-cell {
    flex-direction: row !important;
    align-items: center !important;
  }
  .morph-compact-pair-row .morph-pair-cell > label:first-child {
    width: auto !important;
    flex: 1 1 auto;
  }
  .morph-compact-pair-row .morph-pair-cell .morph-row-check {
    width: auto !important;
    margin-left: auto !important;
  }
  .morph-shape-checkline {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .morph-shape-checkline .morph-inline-section-title {
    grid-column: 1;
    grid-row: 1;
  }
  .morph-shape-checkline .morph-right-check {
    grid-column: 2;
    grid-row: 1;
  }
  .morph-shape-checkline .morph-profile-group-switch {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: 1fr 1fr !important;
  }
  .morph-shape-meta-line {
    flex-wrap: wrap;
  }
  .morph-shape-family-label {
    width: 100% !important;
  }
  .morph-shape-meta-line .morph-spline-points-row {
    width: 100%;
    flex: 1 1 100%;
    justify-content: space-between;
  }
  .morph-mode-card .morph-top-row {
    flex-wrap: wrap;
  }
  .morph-mode-inline-check {
    margin-left: auto;
  }
}
@media (max-width: 360px) {
  .morph-shape-checkline .morph-profile-group-switch {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  header {
    position: relative;
  }
  .header-actions {
    padding-left: 44px !important;
    box-sizing: border-box !important;
  }
  .mobile-controls-toggle {
    position: fixed !important;
    top: max(7px, env(safe-area-inset-top)) !important;
    left: max(7px, env(safe-area-inset-left)) !important;
    bottom: auto !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    z-index: 245 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font:
      700 22px/1 system-ui,
      sans-serif !important;
    white-space: nowrap;
    border-radius: 8px !important;
    background: rgba(15, 23, 42, 0.96) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38) !important;
  }

  body:has(#settingsSidebar.mobile-open) #btnMobileControls,
  body:has(#projectMenu:not(.hidden)) #btnMobileControls,
  body:has(#morphSettingsPanel:not(.hidden)) #btnMobileControls,
  body:has(#randomSettingsPanel:not(.hidden)) #btnMobileControls,
  body:has(#tunnelSettingsPanel:not(.hidden)) #btnMobileControls,
  body:has(#tapSettingsPanel:not(.hidden)) #btnMobileControls,
  body:has(#audioReactivePanel:not(.hidden)) #btnMobileControls,
  body:has(#audioRoutingPanel:not(.hidden)) #btnMobileControls,
  body:has(#libraryModal:not(.hidden)) #btnMobileControls {
    display: inline-flex !important;
  }

  .sidebar-tool-rail {
    top: calc(48px + env(safe-area-inset-top)) !important;
    bottom: auto !important;
    left: max(6px, env(safe-area-inset-left)) !important;
    width: 42px !important;
    height: auto !important;
    padding: 4px !important;
    border: 1px solid rgba(51, 65, 85, 0.72) !important;
    border-radius: 10px !important;
    background: rgba(15, 23, 42, 0.96) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.46) !important;
    transform: translate3d(-140%, 0, 0) !important;
    visibility: hidden !important;
    z-index: 244 !important;
  }
  .sidebar-tool-rail.mobile-rail-open,
  .sidebar-tool-rail.mobile-open {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible !important;
  }
  .sidebar-tool-rail .sidebar-tool-btn {
    width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
  }
  aside#settingsSidebar {
    left: 48px !important;
    width: calc(100vw - 48px) !important;
    max-width: calc(100vw - 48px) !important;
    z-index: 240 !important;
  }
  .mobile-sidebar-backdrop {
    z-index: 235 !important;
  }

  .fps-counter {
    position: fixed !important;
    left: max(7px, env(safe-area-inset-left)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    min-width: 46px !important;
    padding: 4px 5px !important;
    z-index: 45 !important;
    font-size: 9px !important;
  }
  .floating-controls {
    max-width: calc(100vw - 68px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
    gap: 2px !important;
    padding: 3px !important;
  }
  .floating-controls .btn-icon,
  .floating-display-controls .display-control,
  .floating-display-controls .display-check,
  .floating-display-controls .display-color-control {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    flex: 0 0 32px !important;
    padding: 3px !important;
  }
  .floating-display-controls {
    gap: 2px !important;
  }
}
@media (max-width: 360px) {
  .floating-controls {
    max-width: calc(100vw - 64px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
  }
  .floating-controls .btn-icon,
  .floating-display-controls .display-control,
  .floating-display-controls .display-check,
  .floating-display-controls .display-color-control {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    flex-basis: 30px !important;
  }
}

@media (max-width: 760px) {
  .header-actions {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain;
    touch-action: pan-x !important;
    scroll-padding-left: 48px;
  }

  #btnAutoTapListen {
    position: sticky;
    left: 0;
    z-index: 3;
    flex: 0 0 auto !important;
    box-shadow: 0 0 0 4px var(--panel-bg);
  }

  #audioReactivePanel,
  #audioRoutingPanel {
    top: calc(58px + env(safe-area-inset-top)) !important;
    box-sizing: border-box !important;
  }
  #audioReactivePanel {
    left: max(6px, env(safe-area-inset-left)) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 66px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #audioRoutingPanel {
    left: max(6px, env(safe-area-inset-left)) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    bottom: max(6px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
  }

  aside#settingsSidebar {
    top: calc(58px + env(safe-area-inset-top)) !important;
    bottom: env(safe-area-inset-bottom) !important;
    height: auto !important;
    max-height: calc(100dvh - 58px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  #settingsSidebar > .section-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'layer-title layer-master'
      'layer-actions layer-actions';
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 8px 54px 8px 10px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  #settingsSidebar .sidebar-section-title {
    grid-area: layer-title;
    min-width: 0;
  }
  #settingsSidebar .master-layer-btn {
    grid-area: layer-master;
    min-width: 0;
    max-width: 100%;
  }
  #settingsSidebar .sidebar-layer-actions {
    grid-area: layer-actions;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    overflow: hidden !important;
  }
  #settingsSidebar .mobile-sidebar-close {
    top: 7px !important;
    right: 8px !important;
    z-index: 20 !important;
  }
  #layerList {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    max-height: min(28dvh, 180px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #layerList .layer-item {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 6px;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  #layerList .layer-item > div:first-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  #layerList .layer-item > div:first-child > span:last-child {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #layerList .layer-item > div:last-child {
    flex: 0 0 auto !important;
  }
}

.mobile-layer-list-toggle {
  display: none;
}
@media (max-width: 760px) {
  #btnAutoTapListen {
    position: static !important;
    left: auto !important;
    z-index: auto !important;
    box-shadow: none !important;
    flex: 0 0 auto !important;
  }

  aside#settingsSidebar {
    left: 44px !important;
    right: 0 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  #settingsSidebar > .section-header {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 3px !important;
    min-height: 38px !important;
    width: 100% !important;
    padding: 5px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  #settingsSidebar .sidebar-section-title {
    flex: 1 1 auto !important;
    min-width: 26px !important;
    max-width: 42px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    font-size: 10px !important;
  }
  #settingsSidebar .master-layer-btn {
    position: static !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 44px !important;
    max-width: 48px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 2px 5px !important;
    font-size: 9px !important;
  }
  #settingsSidebar .sidebar-layer-actions {
    display: contents !important;
  }
  #settingsSidebar #layerCountBadge {
    flex: 0 0 auto !important;
    min-width: 20px !important;
    padding: 2px 4px !important;
    text-align: center !important;
    font-size: 9px !important;
  }
  #settingsSidebar #btnAddLayer,
  #settingsSidebar #btnDuplicateLayer,
  #settingsSidebar #btnDeleteLayer,
  #settingsSidebar .mobile-layer-list-toggle,
  #settingsSidebar .mobile-sidebar-close {
    position: static !important;
    display: inline-flex !important;
    flex: 0 0 28px !important;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1 !important;
  }
  #settingsSidebar .mobile-layer-list-toggle {
    color: #cbd5e1;
    font-size: 18px !important;
  }
  #settingsSidebar .mobile-sidebar-close {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    font-size: 20px !important;
  }

  #settingsSidebar.mobile-layers-collapsed #layerList {
    display: none !important;
  }
  #layerList {
    flex: 0 0 auto !important;
    max-height: min(26dvh, 156px) !important;
    padding: 5px !important;
    gap: 3px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  #layerList .layer-item {
    min-height: 27px !important;
    padding: 3px 7px !important;
    gap: 5px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
  }
  #layerList .layer-item button.btn-icon {
    width: 18px !important;
    min-width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    padding: 0 !important;
    font-size: 10px !important;
    line-height: 1 !important;
  }
  #layerList .layer-item > div:first-child {
    gap: 5px !important;
  }
  #layerList .layer-item > div:first-child > span[style*='width:10px'] {
    width: 8px !important;
    height: 8px !important;
  }
}

.project-morph-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}
.project-morph-btn,
.project-morph-settings-btn {
  width: 30px;
  height: 28px;
  min-height: 28px;
  padding: 5px;
  justify-content: center;
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.36);
  background: rgba(34, 197, 94, 0.07);
  font-size: 16px;
  line-height: 1;
}
.project-morph-btn:hover,
.project-morph-settings-btn:hover {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(74, 222, 128, 0.62);
}
.project-morph-btn.active {
  color: #052e16;
  background: #4ade80;
  border-color: #86efac;
  box-shadow:
    0 0 0 1px rgba(134, 239, 172, 0.18),
    0 0 14px rgba(34, 197, 94, 0.3);
}
.project-morph-settings-panel {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  padding: 10px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(74, 222, 128, 0.38);
  border-radius: 10px;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.48);
  z-index: 108;
  backdrop-filter: blur(10px);
}
.project-morph-settings-panel.hidden {
  display: none !important;
}
.project-morph-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.project-morph-settings-head strong {
  color: #86efac;
  font-size: 12px;
}
.project-morph-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 7px 0;
  padding: 7px;
  border: 1px solid rgba(51, 65, 85, 0.58);
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.36);
  font-size: 10px;
  color: var(--text-muted);
}
.project-morph-setting label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  cursor: pointer;
}
.project-morph-setting input[type='checkbox'] {
  accent-color: #22c55e;
}
.project-morph-setting input[type='number'] {
  width: 72px;
}
.project-morph-setting select {
  max-width: 178px;
  min-width: 0;
}
.project-morph-setting.image-softness-row {
  display: grid;
  grid-template-columns: minmax(118px, auto) minmax(80px, 1fr) 38px;
  gap: 7px;
}
.project-morph-setting.image-softness-row input[type='range'] {
  width: 100%;
  min-width: 0;
}
.project-morph-setting.image-softness-row .text-mono {
  text-align: right;
}
.project-morph-setting.image-softness-row.hidden {
  display: none !important;
}
.project-morph-status {
  margin-top: 7px;
  font-size: 9px;
  line-height: 1.4;
  color: #86efac;
}
@media (max-width: 760px) {
  .project-morph-settings-panel {
    top: calc(52px + env(safe-area-inset-top, 0px));
    width: calc(100vw - 16px);
  }
  .project-morph-btn,
  .project-morph-settings-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 7px;
  }
}

.playlist-chooser-panel {
  gap: 3px;
}
.playlist-chooser-panel > .btn-icon {
  flex: 0 0 28px;
}
.playlist-chooser-panel #btnSavePlaylistProject {
  color: #86efac;
}
.playlist-chooser-panel #btnQuickNewProject {
  color: #fff;
}
.playlist-chooser-panel #btnQuickNewProject svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.playlist-chooser-panel #btnSavePlaylistProjectAsNew {
  color: #67e8f9;
  font-weight: 800;
}
.playlist-chooser-panel #btnDeletePlaylistProject {
  color: #fca5a5;
  font-size: 18px;
}
#layerList .layer-item.isolated {
  border-color: rgba(245, 158, 11, 0.78);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.16);
}
#layerList .layer-item.isolated .toggle-vis {
  color: #fbbf24;
  font-weight: 900;
}
@media (max-width: 980px) {
  .playlist-chooser-panel #projectSelect {
    min-width: 125px;
    max-width: 155px;
  }
}

.palette-editor {
  position: fixed;
  z-index: 260;
  width: min(360px, calc(100vw - 20px));
  max-height: min(520px, calc(100dvh - 20px));
  overflow: auto;
  padding: 9px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.985);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
  overscroll-behavior: contain;
}
.palette-editor.hidden {
  display: none !important;
}
.palette-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.palette-editor-head strong {
  font-size: 11px;
  color: #f8fafc;
}
.palette-editor-note {
  margin-bottom: 7px;
  font-size: 8.5px;
  line-height: 1.35;
  color: var(--text-muted);
}
.palette-editor-colors {
  display: grid;
  gap: 5px;
}
.palette-editor-color {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
  padding: 5px;
  border: 1px solid rgba(51, 65, 85, 0.62);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.42);
}
.palette-editor-color input[type='color'] {
  width: 32px;
  height: 26px;
}
.palette-editor-hex {
  font:
    9px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  color: #cbd5e1;
}
.palette-editor-remove {
  width: 30px;
  height: 26px;
  padding: 0;
  justify-content: center;
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(127, 29, 29, 0.12);
}
.palette-editor-add {
  width: 100%;
  margin-top: 7px;
  justify-content: center;
  color: #dbeafe;
}
#minimalMorphLinePalette {
  justify-content: flex-end;
  flex: 1 1 320px;
}
.minimal-morph-palette-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.minimal-morph-palette-row > label {
  width: auto;
  flex: 0 0 auto;
}
.morph-line-palette-btn[data-line-morph-palette='holy'],
.morph-line-palette-btn[data-minimal-morph-palette='holy'] {
  border-color: rgba(250, 204, 21, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.morph-line-palette-btn[data-minimal-morph-palette='fire'] {
  border-color: rgba(249, 115, 22, 0.55);
}
.morph-line-palette-btn[data-minimal-morph-palette='ice'] {
  border-color: rgba(56, 189, 248, 0.55);
}
.morph-line-palette-btn[data-minimal-morph-palette='sex'] {
  border-color: rgba(244, 63, 94, 0.55);
}

#mobileParameterFocusOverlay {
  display: none;
}
@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  body.mobile-parameter-focus {
    background: var(--bg-dark) !important;
    overflow: hidden !important;
    touch-action: none;
  }
  #mobileParameterFocusOverlay.mobile-parameter-focus-active {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: block;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: transparent;
    padding: 0;
    margin: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-parameter-focus-dock {
    position: absolute;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(99, 102, 241, 0.52);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.56);
    backdrop-filter: blur(12px);
    transform: translate3d(0, 0, 0);
    opacity: 1;
    transition:
      transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
      opacity 0.2s ease;
    will-change: transform, opacity;
    box-sizing: border-box;
  }
  .mobile-parameter-focus-title {
    min-width: 0;
    margin: 0 0 10px;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.25;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }
  .mobile-parameter-focus-controls {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: center;
    min-width: 0;
  }
  .mobile-parameter-focus-step {
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    justify-content: center !important;
    border-radius: 10px !important;
    font:
      800 25px/1 system-ui,
      sans-serif !important;
    color: var(--text-main) !important;
    background: rgba(30, 41, 59, 0.96) !important;
    border-color: rgba(129, 140, 248, 0.42) !important;
    touch-action: manipulation;
  }
  .mobile-parameter-focus-step:active {
    transform: scale(0.94);
    background: var(--card-bg-light) !important;
  }
  .mobile-parameter-focus-range-slot {
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
    min-height: 44px;
  }
  .mobile-parameter-focus-range-slot > input[type='range'] {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 44px !important;
    margin: 0 !important;
    touch-action: none;
  }
  .mobile-parameter-focus-multiplier {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    margin-top: 9px;
  }
  .mobile-parameter-focus-multiplier.hidden {
    display: none !important;
  }
  .mobile-parameter-focus-multiplier > span {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
  }
  .mobile-parameter-focus-multiplier > input[type='number'] {
    width: 88px !important;
    min-width: 88px !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 5px 8px !important;
    font-size: 16px !important;
    text-align: center !important;
  }
  body.mobile-parameter-focus .mobile-parameter-focus-dock * {
    visibility: visible !important;
    opacity: 1;
  }
}

.sidebar-tool-separator {
  width: 28px;
  height: 1px;
  flex: 0 0 1px;
  background: rgba(71, 85, 105, 0.78);
  margin: 2px 0;
}
.sidebar-tool-btn[data-sidebar-mode='palette'].active {
  background: rgba(236, 72, 153, 0.16);
  border-color: rgba(244, 114, 182, 0.72);
  color: #fbcfe8;
}
#settingsSidebar.sidebar-mode-palette .sidebar-content > .control-group:not(.palette-settings-group) {
  display: none !important;
}
.palette-settings-group {
  border-color: rgba(244, 114, 182, 0.34);
}

.sidebar-tool-btn[data-sidebar-mode='motion'] .motion-arrow-icon {
  display: block;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
  transition:
    color 0.15s ease,
    text-shadow 0.15s ease,
    transform 0.15s ease;
}
#btnSidebarMotion.feature-enabled .motion-arrow-icon {
  color: #22c55e;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.78);
}
.sidebar-tool-btn[data-sidebar-mode='motion'].active {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(100, 116, 139, 0.72);
  color: #94a3b8;
}
.sidebar-tool-btn[data-sidebar-mode='motion'].active.feature-enabled {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(74, 222, 128, 0.72);
  color: #dcfce7;
}
#settingsSidebar.sidebar-mode-motion .sidebar-content > .control-group:not(.motion-settings-group) {
  display: none !important;
}
.motion-settings-group {
  border-color: rgba(34, 197, 94, 0.34);
}
.motion-settings-group .group-title-toggle input,
.motion-toggle input {
  accent-color: #22c55e;
}
.motion-block {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(51, 65, 85, 0.62);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.45);
}
.motion-block.disabled .motion-dependent {
  opacity: 0.4;
}
.motion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.motion-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 11px;
  min-width: 0;
}
.motion-direction {
  min-width: 154px !important;
  max-width: 190px !important;
  justify-content: center;
  white-space: nowrap;
}
.motion-direction[data-direction='ccw'] {
  color: #a7f3d0;
  border-color: rgba(74, 222, 128, 0.42);
  background: rgba(34, 197, 94, 0.08);
}
.motion-direction[data-direction='cw'] {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(59, 130, 246, 0.08);
}
.motion-lag-row {
  margin-top: 1px;
  padding-top: 7px;
  border-top: 1px solid rgba(51, 65, 85, 0.48);
}
.motion-slider-mult {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 62px;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.motion-slider-mult input[type='range'] {
  width: 100%;
  min-width: 0;
  accent-color: #22c55e;
}
.motion-slider-mult input[type='number'] {
  width: 62px !important;
  text-align: right !important;
}
.motion-palette-host {
  display: block;
  min-width: 0;
}
.motion-palette-host select {
  width: 100%;
  max-width: none !important;
  min-width: 0 !important;
}
.motion-note {
  font-size: 9px;
  line-height: 1.35;
  color: var(--text-muted);
}
@media (max-width: 760px) {
  .motion-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .motion-direction {
    width: 100%;
    max-width: none !important;
  }
  .motion-slider-mult {
    grid-template-columns: minmax(0, 1fr) auto 58px;
  }
}

.sidebar-tool-btn[data-sidebar-mode='fourier'] {
  font:
    700 12px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: -0.6px;
  color: #94a3b8;
}
.sidebar-tool-btn[data-sidebar-mode='fourier'].active {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(103, 232, 249, 0.52);
  color: #cffafe;
}
.sidebar-tool-btn[data-sidebar-mode='fourier'].fourier-on {
  color: #67e8f9;
  border-color: rgba(34, 211, 238, 0.72);
  background: rgba(8, 145, 178, 0.16);
  box-shadow:
    0 0 0 1px rgba(103, 232, 249, 0.1),
    0 0 12px rgba(34, 211, 238, 0.16);
}
.sidebar-tool-btn[data-sidebar-mode='fourier'].active.fourier-on {
  background: rgba(8, 145, 178, 0.28);
  border-color: #67e8f9;
  color: #ecfeff;
}
#settingsSidebar.sidebar-mode-fourier .sidebar-content > .control-group:not(.fourier-settings-group) {
  display: none !important;
}
.fourier-settings-group {
  border-color: rgba(34, 211, 238, 0.34);
}
.fourier-mode-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 11px;
}
.fourier-mode-toggle input {
  accent-color: #22d3ee;
}
.playlist-global-hue-control {
  display: grid;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 8px;
  background: rgba(14, 116, 144, 0.08);
}
.playlist-global-hue-control .row-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: #e2e8f0;
}
.playlist-global-hue-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 7px;
  align-items: center;
}
.playlist-global-hue-inputs input[type='range'] {
  width: 100%;
  min-width: 0;
}
.playlist-global-hue-inputs input[type='number'] {
  width: 58px !important;
  text-align: right !important;
}
.palette-studio-note {
  font-size: 9px;
  line-height: 1.4;
  color: var(--text-muted);
}
.palette-studio-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.palette-studio-item {
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.52);
  overflow: hidden;
}
.palette-studio-head {
  display: grid;
  grid-template-columns: 22px minmax(75px, 1fr) 112px;
  gap: 6px;
  align-items: center;
  padding: 6px;
  cursor: pointer;
}
.palette-studio-head:hover {
  background: rgba(51, 65, 85, 0.28);
}
.palette-studio-head input[type='checkbox'] {
  accent-color: #f472b6;
}
.palette-studio-name {
  font-size: 10px;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.palette-key-mini {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  width: 112px;
  height: 18px;
  overflow: hidden;
  background: transparent;
  padding-left: 5px;
  padding-right: 2px;
  box-sizing: border-box;
}
.palette-key-mini i {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.08);
}
.palette-studio-editor {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid rgba(51, 65, 85, 0.58);
  background: rgba(30, 41, 59, 0.32);
}
.palette-studio-editor.hidden {
  display: none !important;
}
.palette-name-input {
  width: 100% !important;
  text-align: left !important;
  color: #f8fafc !important;
  background: #0f172a !important;
  border: 1px solid #475569 !important;
  border-radius: 5px !important;
  padding: 5px 7px !important;
  font-size: 10px !important;
}
.palette-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  width: min(270px, 100%);
  max-width: 100%;
}
.palette-reset-btn {
  width: 30px;
  height: 28px;
  min-width: 30px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 16px !important;
  line-height: 1;
  color: #fbcfe8;
  border-color: rgba(244, 114, 182, 0.42);
  background: rgba(190, 24, 93, 0.08);
}
.palette-reset-btn:hover {
  background: rgba(190, 24, 93, 0.22);
  border-color: rgba(244, 114, 182, 0.72);
  color: #fff;
}
.palette-save-btn {
  height: 28px;
  padding: 0 8px;
  white-space: nowrap;
}
.palette-save-btn[hidden] {
  display: none;
}
.palette-key-strip {
  display: flex;
  width: 240px;
  max-width: 100%;
  height: 34px;
  border-radius: 6px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #020617;
  position: relative;
  touch-action: none;
  user-select: none;
}
.palette-key-segment {
  position: relative;
  flex: 1 1 0;
  min-width: 10px;
  height: 100%;
  cursor: grab;
  z-index: 1;
  touch-action: none;
}
.palette-key-segment:active {
  cursor: grabbing;
}
.palette-key-segment input[type='color'] {
  position: absolute;
  width: 1px;
  height: 1px;
  left: 50%;
  top: 50%;
  opacity: 0;
  pointer-events: none;
}
.palette-key-segment.selected {
  z-index: 4;
  outline: 3px solid #ef4444;
  outline-offset: 2px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 10px rgba(239, 68, 68, 0.55);
}
.palette-key-segment.left-dragging {
  z-index: 5;
  cursor: grabbing;
  box-shadow:
    0 0 0 2px rgba(96, 165, 250, 0.95),
    0 6px 16px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

.app-color-picker {
  position: fixed;
  z-index: 2147482500;
  width: min(430px, calc(100vw - 20px));
  max-height: calc(100dvh - 20px);
  overflow: auto;
  padding: 10px;
  border: 1px solid #64748b;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.992);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(12px);
  display: grid;
  gap: 8px;
  overscroll-behavior: contain;
}
.app-color-picker.hidden {
  display: none !important;
}
.app-color-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-color-picker-head strong {
  font-size: 11px;
  color: #f8fafc;
}
.app-color-picker-preview {
  width: 34px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}
.app-color-picker-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 2px;
  border: 1px solid #334155;
  border-radius: 7px;
  background: #0b1220;
}
.app-color-picker-mode button {
  justify-content: center;
  min-height: 27px;
  padding: 4px 7px;
  font-size: 10px;
  background: transparent;
  border: 0;
  color: #94a3b8;
}
.app-color-picker-mode button.active {
  background: #334155;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
}
.app-color-picker-view {
  display: grid;
  gap: 8px;
}
.app-color-picker-view.hidden {
  display: none !important;
}
.app-color-picker-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 52px;
  gap: 7px;
  align-items: center;
  font-size: 9px;
  color: #cbd5e1;
}
.app-color-picker-row input[type='range'] {
  width: 100%;
  min-width: 0;
  touch-action: none;
  cursor: ew-resize;
}
.app-color-picker-row input[type='number'] {
  width: 52px !important;
}
.app-color-picker-hex {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  font-size: 9px;
  color: #cbd5e1;
}
.app-color-picker-hex input {
  width: 100%;
  background: #0b1220;
  border: 1px solid #475569;
  border-radius: 5px;
  color: #f8fafc;
  padding: 5px 7px;
  font:
    10px ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  text-transform: uppercase;
}
.app-color-picker-standard-title {
  font-size: 9px;
  font-weight: 700;
  color: #e2e8f0;
  margin-top: 1px;
}
.app-color-picker-standard {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 4px;
}
.app-color-standard-swatch {
  aspect-ratio: 1/1;
  min-width: 0;
  padding: 0 !important;
  border-radius: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.app-color-standard-swatch:hover {
  transform: scale(1.12);
  z-index: 2;
  border-color: #fff !important;
}
.app-color-radial-layout {
  display: grid;
  grid-template-columns: 200px minmax(82px, 1fr) 34px;
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}
.app-color-wheel {
  width: 200px;
  height: 200px;
  max-width: 100%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  position: relative;
  cursor: crosshair;
  touch-action: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.32),
    0 8px 24px rgba(0, 0, 0, 0.38);
  background:
    radial-gradient(circle at 50% 50%, #fff 0%, rgba(255, 255, 255, 0.96) 2%, rgba(255, 255, 255, 0) 70.7%),
    conic-gradient(from 90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  overflow: hidden;
}
.app-color-wheel-point {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow:
    0 0 0 1px #020617,
    0 2px 5px rgba(0, 0, 0, 0.65);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.app-color-rgb-fields {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}
.app-color-rgb-field {
  display: grid;
  grid-template-columns: 18px minmax(48px, 1fr);
  gap: 5px;
  align-items: center;
  font-size: 10px;
  color: #cbd5e1;
}
.app-color-rgb-field input {
  width: 100% !important;
  min-width: 0 !important;
  padding: 4px 5px !important;
  text-align: center !important;
  font-variant-numeric: tabular-nums;
}
.app-color-rgb-field.r span {
  color: #f87171;
}
.app-color-rgb-field.g span {
  color: #4ade80;
}
.app-color-rgb-field.b span {
  color: #60a5fa;
}
.app-color-value-wrap {
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  gap: 5px;
  font-size: 8px;
  color: #94a3b8;
  min-height: 200px;
}
.app-color-value {
  appearance: none;
  -webkit-appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 24px !important;
  height: 176px !important;
  min-height: 130px;
  touch-action: none;
  cursor: ns-resize;
  border-radius: 7px;
  background: linear-gradient(to top, #000, #fff) !important;
}
.app-color-value::-webkit-slider-runnable-track {
  width: 8px;
  height: 100%;
  background: transparent !important;
}
.app-color-value::-webkit-slider-thumb {
  width: 20px;
  height: 10px;
  margin: 0 0 0 -6px;
  border-radius: 3px;
  background: #fff;
  border: 2px solid #0f172a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}
@media (max-width: 520px) {
  .app-color-picker {
    width: min(390px, calc(100vw - 12px));
  }
  .app-color-picker-standard {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
  .app-color-picker-row {
    grid-template-columns: 62px minmax(0, 1fr) 48px;
  }
  .app-color-radial-layout {
    grid-template-columns: minmax(150px, 190px) minmax(68px, 1fr) 30px;
    gap: 7px;
  }
  .app-color-wheel {
    width: 100%;
    height: auto;
  }
  .app-color-value {
    height: 155px !important;
  }
}
.palette-key-actions {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px !important;
}
.palette-key-actions button {
  min-width: 0;
  padding: 5px 4px;
  font-size: 9px !important;
  white-space: normal;
  line-height: 1.15;
}
.palette-delete-palette-btn {
  width: 100%;
  justify-content: center;
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(127, 29, 29, 0.12);
}
.palette-key-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.palette-key-actions button,
.palette-create-btn {
  justify-content: center;
  font-size: 10px;
}
.palette-create-btn {
  width: 100%;
  color: #fbcfe8;
  border-color: rgba(244, 114, 182, 0.4);
  background: rgba(190, 24, 93, 0.08);
}
.palette-editor-control {
  display: grid;
  grid-template-columns: minmax(94px, 1fr) minmax(90px, 1fr) 48px;
  gap: 6px;
  align-items: center;
  font-size: 9px;
  color: var(--text-muted);
}
.palette-editor-control input[type='range'] {
  width: 100%;
  min-width: 0;
}
.palette-editor-control input[type='number'] {
  width: 54px !important;
}
.palette-total-text {
  font:
    9px/1.3 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  color: #cbd5e1;
}
.palette-dropdown-host {
  display: flex !important;
  gap: 6px !important;
  align-items: center !important;
  min-width: 150px;
}
.palette-dropdown-host select {
  min-width: 145px !important;
  max-width: 210px !important;
  height: 24px !important;
  font-size: 9px !important;
}
.palette-cycle-check {
  width: auto !important;
  display: inline-flex !important;
  gap: 4px !important;
  align-items: center !important;
  white-space: nowrap;
  color: #cbd5e1 !important;
  font-size: 9px !important;
}
.palette-cycle-check input {
  accent-color: #f472b6;
}
.palette-quick-menu {
  position: fixed;
  z-index: 240;
  width: 220px;
  max-height: min(420px, calc(100vh - 30px));
  overflow: auto;
  padding: 6px;
  border: 1px solid #475569;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}
.palette-quick-item {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 112px;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  font-size: 9px;
  color: #e2e8f0;
}
.palette-quick-item:hover {
  background: rgba(51, 65, 85, 0.42);
}
.palette-quick-swatches {
  display: flex;
  gap: 2px;
  width: 112px;
  height: 18px;
  overflow: hidden;
  border-radius: 5px;
  background: #0b1220;
}
.palette-quick-swatch {
  flex: 1 1 0;
  min-width: 7px;
  cursor: context-menu;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 3px !important;
  padding: 0 !important;
  height: 18px !important;
}
@media (max-width: 760px) {
  .palette-studio-head {
    grid-template-columns: 22px minmax(0, 1fr) minmax(76px, 92px);
    gap: 5px;
    padding: 6px 5px;
  }
  .palette-key-mini,
  .palette-quick-swatches {
    width: 100%;
    min-width: 0;
  }
  .palette-key-mini {
    padding-left: 7px;
    padding-right: 1px;
  }
  .palette-studio-name {
    min-width: 0;
    font-size: 9.5px;
  }
  .palette-studio-editor {
    padding: 7px 6px;
    gap: 7px;
    overflow: hidden;
  }
  .palette-name-row {
    width: 100%;
  }
  .palette-name-input {
    min-width: 0 !important;
    width: 100% !important;
  }
  .palette-reset-btn {
    width: 32px;
    min-width: 32px;
    height: 30px;
  }
  .palette-key-strip {
    width: 100%;
    max-width: 100%;
    height: 38px;
  }
  .palette-key-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .palette-key-actions button {
    min-height: 32px;
    font-size: 9px !important;
  }
  .palette-editor-control {
    grid-template-columns: minmax(0, 1fr) 50px;
    gap: 5px;
  }
  .palette-editor-control > span:first-child {
    grid-column: 1/-1;
  }
  .palette-editor-control input[type='range'] {
    grid-column: 1;
    min-width: 0;
  }
  .palette-editor-control input[type='number'] {
    grid-column: 2;
    width: 50px !important;
  }
  .palette-total-text {
    white-space: normal;
    line-height: 1.45;
  }
  .palette-quick-menu {
    width: min(220px, calc(100vw - 16px));
    max-height: min(70dvh, 420px);
  }
}
@media (max-width: 430px) {
  .palette-studio-head {
    grid-template-columns: 20px minmax(0, 1fr) minmax(68px, 82px);
  }
  .palette-key-mini i {
    flex-basis: 10px;
    width: 10px;
    height: 10px;
  }
  .palette-studio-editor {
    padding: 6px 5px;
  }
  .palette-key-strip {
    height: 40px;
  }
  .palette-key-actions {
    gap: 4px !important;
  }
}

.line-display-group .control-group-title {
  gap: 6px;
  min-width: 0;
}
.line-display-group .line-raster-toggle {
  margin-left: auto;
  margin-right: 5px;
  min-width: 0;
}
.line-display-group .line-raster-toggle input {
  accent-color: #f59e0b;
}
.line-display-group .line-raster-toggle:has(input:checked) {
  color: #fde68a;
}
.line-display-group .line-raster-toggle span {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-morph-compact-row {
  display: grid !important;
  grid-template-columns: auto minmax(92px, 150px) auto !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 6px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}
.palette-morph-compact-row > label,
.palette-morph-compact-row .palette-morph-label,
.palette-morph-compact-row .palette-cycle-check {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.palette-morph-compact-row .palette-dropdown-host {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 150px !important;
  margin: 0 !important;
  overflow: hidden !important;
}
.palette-morph-compact-row .palette-dropdown-host select,
.palette-morph-compact-row .playlist-palette-select {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 24px !important;
  min-height: 24px !important;
  padding: 1px 22px 1px 6px !important;
  font-size: 9px !important;
  line-height: 20px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.palette-morph-compact-row .palette-cycle-check {
  gap: 3px !important;
  font-size: 9px !important;
}
.palette-morph-compact-row .palette-cycle-check input {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  margin: 0;
}
.minimal-morph-palette-row.palette-morph-compact-row {
  flex-wrap: nowrap !important;
}
@media (max-width: 760px) {
  .palette-morph-compact-row {
    grid-template-columns: auto minmax(82px, 1fr) auto !important;
    gap: 5px !important;
    padding: 4px 5px !important;
    min-height: 30px !important;
  }
  .palette-morph-compact-row .palette-dropdown-host {
    max-width: none !important;
    width: 100% !important;
  }
  .palette-morph-compact-row .palette-dropdown-host select,
  .palette-morph-compact-row .playlist-palette-select {
    font-size: 10px !important;
    height: 28px !important;
    min-height: 28px !important;
  }
  .palette-morph-compact-row .palette-morph-label,
  .palette-morph-compact-row .palette-cycle-check {
    font-size: 10px !important;
  }
  .line-display-group .line-raster-toggle span {
    max-width: 76px;
  }
}
@media (max-width: 390px) {
  .palette-morph-compact-row {
    grid-template-columns: auto minmax(70px, 1fr) auto !important;
    gap: 4px !important;
  }
  .palette-morph-compact-row .palette-morph-label span {
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .line-display-group .line-raster-toggle span {
    max-width: 62px;
  }
}

@media (min-width: 761px) {
  #audioReactivePanel.audio-panel {
    width: min(520px, calc(100vw - 16px));
    padding: 10px;
  }
  #audioReactivePanel .audio-custom-band-row {
    grid-template-columns: 72px minmax(0, 1fr) 116px;
    gap: 5px;
  }
  #audioReactivePanel .audio-custom-dual {
    min-width: 0;
  }
  #audioReactivePanel .audio-custom-band-values {
    grid-template-columns: 50px 10px 50px;
    gap: 3px;
  }
  #audioReactivePanel .audio-custom-band-values input[type='number'] {
    width: 50px !important;
    padding-left: 2px;
    padding-right: 2px;
  }
}
#audioReactivePanel,
#morphSettingsPanel,
#randomSettingsPanel,
#tunnelSettingsPanel,
#tapSettingsPanel,
#projectMorphSettingsPanel {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
#audioRoutingPanel .audio-routing-main,
#audioRoutingPanel .audio-routing-layers {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.morph-compact-control-line {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  font-size: 9px;
  color: var(--text-muted);
}
.morph-compact-control-line > label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  min-width: 0;
  cursor: pointer;
}
.morph-compact-control-line > label:first-child {
  color: #cbd5e1;
  flex: 0 0 auto;
}
.morph-inline-check-title {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  width: auto !important;
}
.morph-compact-control-line .morph-range-controls {
  margin-left: auto;
}
.morph-compact-control-line .morph-normalize-check {
  margin-left: auto;
  white-space: nowrap;
  color: var(--text-muted);
}
.morph-size-percent-input {
  width: 52px !important;
  text-align: right !important;
}
.morph-reset-compact {
  flex: 0 0 auto;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 1px 6px !important;
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(127, 29, 29, 0.18);
}
.morph-reset-compact:hover {
  color: white;
  border-color: #f87171;
  background: rgba(185, 28, 28, 0.36);
}
.morph-reset-cross {
  width: 24px;
  min-width: 24px;
  padding: 0 !important;
  font-size: 15px;
  justify-content: center;
}
.morph-opacity-rounding-row .morph-pair-cell {
  align-items: center;
}
.morph-opacity-rounding-row .morph-range-controls input {
  width: 44px !important;
}
.morph-orbit-rotation-row .morph-pair-cell {
  align-items: center;
}
.morph-orbit-rotation-row .morph-rotation-number-controls {
  display: grid;
  grid-template-columns: 40px auto 40px auto auto 42px;
  gap: 2px;
  align-items: center;
  margin-left: auto;
}
.morph-orbit-rotation-row .morph-rotation-number-controls input[type='number'] {
  width: 40px !important;
}
.morph-orbit-rotation-row .morph-rotation-number-controls .rotation-multiplier {
  width: 42px !important;
}
.morph-rotation-direction-compact {
  margin-left: 3px !important;
  white-space: nowrap;
  font-size: 8px;
}
.morph-lamp-chaos-row .morph-pair-cell {
  display: block;
  min-width: 0;
}
.morph-lamp-chaos-row .morph-lamp-morph-inner,
.morph-lamp-chaos-row .morph-chaos-morph-inner {
  gap: 5px;
  flex-wrap: wrap;
}
.morph-lamp-chaos-row .lamp-morph-settings {
  min-width: 0 !important;
  flex: 1 1 100% !important;
}
.morph-fill-harmony-select {
  flex: 1 1 170px;
  min-width: 150px;
  max-width: 240px;
  height: 25px;
  padding: 2px 5px;
  font-size: 9px;
}
#morphFillColorRow {
  flex-wrap: nowrap;
  gap: 5px;
  padding-top: 4px;
  padding-bottom: 4px;
}
#morphFillColorRow .morph-fill-counts {
  flex: 0 0 auto;
}
#morphFillColorRow .morph-fill-counts input {
  width: 40px !important;
}
@media (max-width: 760px) {
  #morphFillColorRow {
    flex-wrap: wrap;
  }
  .morph-orbit-rotation-row .morph-rotation-number-controls {
    grid-template-columns: 44px auto 44px auto auto 46px;
  }
  .morph-lamp-chaos-row {
    grid-template-columns: 1fr !important;
  }
}

.project-title-dropdown {
  position: relative;
  display: inline-flex;
  min-width: 0;
}
#projectNameButton {
  min-width: 190px;
  max-width: 250px;
  justify-content: space-between;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#projectNameButton.project-folder-empty {
  color: var(--text-muted);
}
#projectSelect {
  display: none !important;
}
.project-name-dropdown-menu,
.project-name-context-menu {
  position: fixed;
  z-index: 420;
  min-width: 190px;
  max-width: min(320px, calc(100vw - 16px));
  max-height: min(420px, calc(100vh - 16px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 5px;
  background: rgba(15, 23, 42, 0.99);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.project-name-dropdown-menu.hidden,
.project-name-context-menu.hidden {
  display: none !important;
}
.project-name-dropdown-menu button,
.project-name-context-menu button {
  width: 100%;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  padding: 7px 9px;
}
.project-name-dropdown-menu button:hover,
.project-name-context-menu button:hover {
  background: var(--card-bg-light);
}
.project-name-dropdown-menu button.active {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.16);
}
.library-item .library-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}
.library-item .library-actions button {
  padding: 5px 7px;
  font-size: 10px;
  white-space: nowrap;
}
.morph-size-multiplier {
  width: 46px !important;
  text-align: right !important;
}
.morph-size-mult-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
}
.morph-vertex-mult-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
}
.morph-vertex-multiplier {
  width: 42px !important;
  text-align: right !important;
}
@media (max-width: 980px) {
  #projectNameButton {
    min-width: 125px;
    max-width: 155px;
  }
}
@media (max-width: 760px) {
  .morph-stroke-size-row,
  .morph-orbit-rotation-row,
  .morph-opacity-rounding-row,
  .morph-lamp-chaos-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.morph-stroke-size-row,
.morph-orbit-rotation-row,
.morph-opacity-rounding-row,
.morph-lamp-chaos-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch;
}
.morph-stroke-size-row > .morph-pair-cell,
.morph-orbit-rotation-row > .morph-pair-cell,
.morph-opacity-rounding-row > .morph-pair-cell,
.morph-lamp-chaos-row > .morph-pair-cell {
  min-width: 0 !important;
  width: auto !important;
  overflow: hidden;
}
.morph-stroke-size-row .morph-compact-control-line,
.morph-orbit-rotation-row .morph-compact-control-line,
.morph-opacity-rounding-row .morph-compact-control-line {
  flex-wrap: nowrap;
}
.morph-stroke-size-row .morph-range-controls,
.morph-orbit-rotation-row .morph-range-controls,
.morph-opacity-rounding-row .morph-range-controls {
  min-width: 0;
}
.morph-stroke-size-row .morph-normalize-check {
  margin-left: 3px;
  font-size: 8px;
}
.morph-opacity-rounding-row .morph-pair-title {
  white-space: normal;
  line-height: 1.05;
}
@media (max-width: 560px) {
  .morph-stroke-size-row,
  .morph-orbit-rotation-row,
  .morph-opacity-rounding-row,
  .morph-lamp-chaos-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .morph-stroke-size-row .morph-pair-cell,
  .morph-orbit-rotation-row .morph-pair-cell,
  .morph-opacity-rounding-row .morph-pair-cell,
  .morph-lamp-chaos-row .morph-pair-cell {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
}

.morph-stroke-size-row,
.morph-orbit-rotation-row,
.morph-opacity-rounding-row,
.morph-lamp-chaos-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 3px !important;
}
.morph-stroke-size-row > .morph-pair-cell,
.morph-orbit-rotation-row > .morph-pair-cell,
.morph-opacity-rounding-row > .morph-pair-cell,
.morph-lamp-chaos-row > .morph-pair-cell {
  grid-column: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}
.morph-stroke-size-row .morph-size-row,
.morph-orbit-rotation-row .morph-rotation-row,
.morph-opacity-rounding-row .morph-opacity-row,
.morph-lamp-chaos-row .morph-lamp-morph-row,
.morph-lamp-chaos-row .morph-chaos-morph-row {
  grid-column: auto !important;
}
.library-head {
  gap: 8px;
}
.library-head-title {
  flex: 0 0 auto;
}
.library-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  min-width: 0;
}
.library-head-actions button:not(.btn-icon) {
  padding: 5px 8px;
  font-size: 10px;
  white-space: nowrap;
}
@media (max-width: 620px) {
  .library-head-actions button:not(.btn-icon) {
    padding: 5px 6px;
    font-size: 9px;
  }
}

.gpu-line-fx-block {
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: rgba(8, 47, 73, 0.15);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.gpu-line-fx-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-main);
}
.gpu-line-fx-head label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 650;
}
.gpu-line-fx-head input[type='checkbox'] {
  accent-color: #22d3ee;
}
.gpu-line-fx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.gpu-line-fx-grid .control-row {
  min-width: 0;
}
.gpu-line-fx-grid select {
  width: 100%;
  min-width: 0;
}
.gpu-line-fx-color {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
}
.gpu-line-fx-color label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.gpu-line-fx-color input[type='color'] {
  width: 25px;
  height: 25px;
}
.line-sprite-preview-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.42);
}
.line-sprite-preview-art {
  width: 100%;
  height: 58px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(8, 47, 73, 0.85));
  display: flex;
  align-items: center;
  justify-content: center;
}
.line-sprite-preview-art svg {
  width: 100%;
  height: 54px;
  display: block;
}
.line-sprite-preview-art img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: none;
}
.line-sprite-preview-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.line-sprite-preview-name {
  font-size: 10px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 120px;
}
.line-sprite-preview-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.line-sprite-preview-actions button {
  padding: 4px 6px;
  font-size: 9px;
  min-height: 24px;
}
.line-sprite-gallery-title {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.line-sprite-preset-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.line-sprite-preset {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border: 1px solid rgba(51, 65, 85, 0.72);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.55);
}
.line-sprite-preset:hover {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(34, 211, 238, 0.48);
}
.line-sprite-preset.active {
  background: rgba(8, 145, 178, 0.16);
  border-color: rgba(34, 211, 238, 0.82);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.15);
}
.line-sprite-preset svg {
  width: 100%;
  height: 37px;
  display: block;
  overflow: visible;
}
.line-sprite-preset span {
  font-size: 9px;
  text-align: right;
  white-space: nowrap;
  color: var(--text-muted);
}
.line-sprite-preset.active span {
  color: #cffafe;
}
.line-sprite-size-mult {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 58px;
  align-items: center;
  gap: 5px;
}
.line-sprite-size-mult input[type='range'] {
  width: 100%;
  min-width: 0;
}
.line-sprite-size-mult input[type='number'] {
  width: 58px !important;
  min-width: 0;
}
.gpu-line-fx-color.sprite-palette {
  grid-template-columns: auto 25px auto 25px auto;
}
.gpu-line-fx-color.sprite-palette .sprite-secondary-label {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
}
.gpu-line-fx-disabled > .gpu-line-fx-grid,
.gpu-line-fx-disabled > .gpu-line-fx-color,
.gpu-line-fx-disabled > .gpu-line-fx-extra {
  opacity: 0.42;
  pointer-events: none;
}

.web-branch-row {
  align-items: stretch;
}
.web-branch-toggles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}
.web-branch-toggle {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 5px;
  border: 1px solid rgba(51, 65, 85, 0.62);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.48);
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.18;
  cursor: pointer;
  text-align: center;
}
.web-branch-toggle:has(input:checked) {
  color: #f8fafc;
  border-color: rgba(226, 232, 240, 0.62);
  background: rgba(148, 163, 184, 0.15);
  box-shadow: 0 0 10px rgba(226, 232, 240, 0.05) inset;
}
.web-branch-toggle input {
  accent-color: #f8fafc;
  flex: 0 0 auto;
}
@media (max-width: 520px) {
  .web-branch-toggles {
    grid-template-columns: 1fr;
  }
  .web-branch-toggle {
    justify-content: flex-start;
  }
}

#particleGpuOverlayCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 6;
  pointer-events: none;
  opacity: 1;
  mix-blend-mode: normal;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.sidebar-tool-btn[data-sidebar-mode='particles'].active {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(100, 116, 139, 0.72);
  color: #cbd5e1;
}
.sidebar-tool-btn[data-sidebar-mode='particles'].feature-enabled {
  border-color: rgba(103, 232, 249, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(34, 211, 238, 0.22),
    0 0 11px rgba(34, 211, 238, 0.14);
}
.particle-star-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid #64748b;
  border-radius: 2px;
  background: #475569;
  box-shadow: none;
  filter: none;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}
.sidebar-tool-btn[data-sidebar-mode='particles'].feature-enabled .particle-star-icon {
  background: #67e8f9;
  border-color: #a5f3fc;
  box-shadow:
    0 0 5px rgba(34, 211, 238, 0.95),
    0 0 12px rgba(34, 211, 238, 0.62);
}
#settingsSidebar.sidebar-mode-particles .sidebar-content > .control-group:not(.particle-settings-group) {
  display: none !important;
}

.palette-quick-item.active-project-palette {
  outline: 1px solid currentColor;
  background: rgba(148, 163, 184, 0.16);
  font-weight: 650;
}
#btnSidebarPalette.palette-project-active {
  box-shadow:
    inset 0 0 0 1px currentColor,
    0 0 12px color-mix(in srgb, currentColor 30%, transparent);
}
#webSecondaryColorRow:not(.hidden),
#webSunDegreesRow:not(.hidden) {
  display: flex;
}

.audio-routing-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.audio-routing-head .audio-master-edit-btn {
  min-width: 132px !important;
  max-width: 170px;
  white-space: nowrap;
  color: #fde68a;
  border-color: rgba(234, 179, 8, 0.45);
  background: rgba(113, 63, 18, 0.12);
}
.audio-routing-head .audio-master-edit-btn.active {
  color: #fff7c2;
  background: rgba(234, 179, 8, 0.22);
  border-color: rgba(250, 204, 21, 0.9);
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.22);
}
.audio-routing-head .audio-master-edit-btn.hidden {
  display: none !important;
}
.rounding-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
}
.rounding-mode-row select {
  min-width: 122px;
}
.morph-spiral-type {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.morph-spiral-type select {
  max-width: 190px;
  min-width: 150px;
}

.morph-spiral-row-primary,
.morph-spiral-row-secondary {
  grid-column: 1 / -1;
}
.morph-spiral-row-primary {
  align-items: center;
}
.morph-spiral-row-secondary {
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}
.morph-spiral-rotation-compensation {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  width: auto !important;
  flex: 0 0 auto !important;
  white-space: nowrap;
  margin-left: auto;
}
@media (max-width: 760px) {
  .morph-spiral-row-secondary {
    align-items: flex-start;
  }
  .morph-spiral-row-secondary .morph-spiral-type {
    width: 100%;
    justify-content: space-between;
  }
  .morph-spiral-row-secondary .morph-spiral-type select {
    max-width: none;
    flex: 1 1 150px;
  }
  .morph-spiral-rotation-compensation {
    margin-left: 0;
  }
}

.lamp-freeze-block {
  margin-top: 6px;
  padding: 6px 7px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.28);
}
.lamp-freeze-rain-block {
  margin-top: 5px;
}
.lamp-freeze-block-toggle {
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
}
.lamp-freeze-rain-toggle {
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
}
.lamp-freeze-details {
  display: grid;
  gap: 5px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}
.lamp-freeze-details.hidden {
  display: none !important;
}
.lamp-freeze-row.hidden {
  display: none !important;
}
.lamp-freeze-row.disabled {
  opacity: 0.46;
}
.lamp-freeze-chromatic-toggle {
  margin-top: 2px !important;
}
.lamp-rain-angle-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px auto;
  gap: 5px;
  align-items: center;
}
.lamp-rain-angle-control input[type='range'] {
  width: 100%;
  min-width: 0;
}
.lamp-rain-angle-control input[type='number'] {
  width: 58px !important;
  text-align: right;
}
.lamp-rain-angle-control > span {
  font-size: 11px;
  color: var(--muted, #94a3b8);
}

#screenErrorOverlay {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  max-height: min(46vh, 420px);
  overflow: hidden;
  overscroll-behavior: contain;
  border: 1px solid rgba(248, 113, 113, 0.8);
  border-radius: 8px;
  background: rgba(20, 3, 7, 0.92);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(127, 29, 29, 0.28);
  user-select: text;
  -webkit-user-select: text;
  pointer-events: auto;
  touch-action: pan-y;
}
#screenErrorOverlay[hidden] {
  display: none !important;
}
#screenErrorOverlay.is-collapsed {
  max-height: none;
}
#screenErrorOverlayHeader {
  flex: 0 0 auto;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 6px 5px 10px;
  border-bottom: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(58, 7, 14, 0.72);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
#screenErrorOverlay.is-collapsed #screenErrorOverlayHeader {
  border-bottom: 0;
}
#screenErrorOverlayTitle {
  min-width: 0;
  color: #ff8585;
  font:
    700 12px/1.2 ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    'Liberation Mono',
    'Courier New',
    monospace;
}
#screenErrorOverlayCount {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.17);
  color: #ffaaaa;
  font-size: 11px;
}
#screenErrorOverlayActions {
  display: flex;
  align-items: center;
  gap: 5px;
}
#screenErrorOverlayActions button {
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(248, 113, 113, 0.42);
  border-radius: 5px;
  background: rgba(40, 5, 10, 0.78);
  color: #ffb0b0;
  font:
    700 11px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    'Liberation Mono',
    'Courier New',
    monospace;
  cursor: pointer;
}
#screenErrorOverlayActions button:hover {
  background: rgba(127, 29, 29, 0.5);
  color: #fff;
}
#screenErrorOverlayCopy {
  min-width: 112px !important;
}
#screenErrorOverlayClear {
  min-width: 94px !important;
}
#screenErrorOverlayClose {
  font-size: 18px !important;
  font-family: Arial, sans-serif !important;
}
#screenErrorOverlayBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 9px 12px 11px;
  scrollbar-gutter: stable;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}
#screenErrorOverlayBody[hidden] {
  display: none !important;
}
#screenErrorOverlayText {
  margin: 0;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #ff6b6b;
  font:
    600 12px/1.42 ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    'Liberation Mono',
    'Courier New',
    monospace;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.18);
  user-select: text;
  -webkit-user-select: text;
}
@media (max-width: 620px) {
  #screenErrorOverlay {
    left: 6px;
    right: 6px;
    bottom: 6px;
    max-height: 42%;
  }
  #screenErrorOverlayHeader {
    padding-left: 8px;
    gap: 5px;
  }
  #screenErrorOverlayBody {
    padding: 8px 9px 9px;
  }
  #screenErrorOverlayCopy {
    min-width: 92px !important;
    padding: 0 5px !important;
    font-size: 10px !important;
  }
  #screenErrorOverlayClear {
    min-width: 78px !important;
    padding: 0 5px !important;
    font-size: 10px !important;
  }
  #screenErrorOverlayText {
    font-size: 10px;
    line-height: 1.38;
  }
}

.fps-counter {
  pointer-events: auto !important;
  cursor: pointer;
  z-index: 2147482999 !important;
  user-select: none;
  -webkit-user-select: none;
}
.fps-counter:hover {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(15, 23, 42, 0.92);
}
.fps-counter:focus-visible {
  outline: 2px solid rgba(148, 163, 184, 0.9);
  outline-offset: 2px;
}
.fps-counter.has-errors {
  border-color: rgba(248, 113, 113, 0.9);
  color: #fecaca;
}
.fps-counter.has-errors::after {
  content: '!' attr(data-error-count);
  position: absolute;
  left: 100%;
  top: 0;
  transform: translate(-35%, -45%);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(254, 202, 202, 0.9);
  border-radius: 999px;
  background: #991b1b;
  color: #fff;
  font:
    700 9px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

#somataErrorCopyToast {
  position: fixed;
  left: 50%;
  bottom: calc(58px + env(safe-area-inset-bottom));
  transform: translate(-50%, 8px);
  z-index: 2147483001;
  pointer-events: none;
  opacity: 0;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.96);
  color: #e2e8f0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
  font:
    600 11px/1.2 system-ui,
    sans-serif;
  white-space: nowrap;
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
}
#somataErrorCopyToast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.file-self-test {
  display: grid;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.42);
}
.file-self-test-title {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
}
.file-self-test-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.file-self-test-actions button {
  min-width: 0;
  padding: 6px 7px;
  font-size: 11px;
}
.file-self-test-actions button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.file-self-test-status {
  font-size: 10px;
  line-height: 1.35;
  color: #94a3b8;
  overflow-wrap: anywhere;
}
.file-self-test-status.pass {
  color: #86efac;
}
.file-self-test-status.fail {
  color: #fca5a5;
}

#btnPseudoFullscreenExit {
  display: none;
}

html.app-pseudo-fullscreen,
html.app-pseudo-fullscreen body {
  width: var(--somata-viewport-width, 100vw) !important;
  height: var(--somata-viewport-height, 100dvh) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: #090d16 !important;
}

html.app-pseudo-fullscreen body {
  padding: 0 !important;
  margin: 0 !important;
}

html.app-pseudo-fullscreen header,
html.app-pseudo-fullscreen aside,
html.app-pseudo-fullscreen .sidebar-tool-rail,
html.app-pseudo-fullscreen .floating-controls,
html.app-pseudo-fullscreen .info-pill,
html.app-pseudo-fullscreen .audio-panel,
html.app-pseudo-fullscreen .audio-routing-panel,
html.app-pseudo-fullscreen .tunnel-settings-panel,
html.app-pseudo-fullscreen .tap-settings-panel,
html.app-pseudo-fullscreen .project-morph-settings-panel,
html.app-pseudo-fullscreen .library-modal,
html.app-pseudo-fullscreen .shortcut-toast,
html.app-pseudo-fullscreen .mobile-controls-toggle,
html.app-pseudo-fullscreen .mobile-sidebar-close,
html.app-pseudo-fullscreen .mobile-sidebar-backdrop {
  display: none !important;
}

html.app-pseudo-fullscreen .app-container {
  position: fixed !important;
  inset: 0 !important;
  width: var(--somata-viewport-width, 100vw) !important;
  height: var(--somata-viewport-height, 100dvh) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: none !important;
}

html.app-pseudo-fullscreen main#mainContainer {
  position: fixed !important;
  inset: 0 !important;
  width: var(--somata-viewport-width, 100vw) !important;
  height: var(--somata-viewport-height, 100dvh) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

html.app-pseudo-fullscreen #mainCanvas {
  width: var(--somata-viewport-width, 100vw) !important;
  height: var(--somata-viewport-height, 100dvh) !important;
}

html.app-pseudo-fullscreen .fps-counter {
  left: max(10px, env(safe-area-inset-left)) !important;
  bottom: max(10px, env(safe-area-inset-bottom)) !important;
}

html.app-pseudo-fullscreen #btnPseudoFullscreenExit {
  position: fixed;
  z-index: 2147483000;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  display: inline-flex !important;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.44);
  background: rgba(15, 23, 42, 0.68);
  color: #f8fafc;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: manipulation;
}

:-webkit-full-screen body {
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
}
:-webkit-full-screen .app-container {
  width: 100vw !important;
  height: 100vh !important;
  flex: none !important;
}
:-webkit-full-screen main#mainContainer {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
}
:-webkit-full-screen #mainCanvas {
  width: 100vw !important;
  height: 100vh !important;
}
:-webkit-full-screen .fps-counter {
  left: 12px !important;
  bottom: 12px !important;
}

.desktop-brand-logo-button,
.desktop-brand-logo {
  display: none;
}
@media (min-width: 761px) {
  header {
    gap: 10px;
  }
  .desktop-brand-logo-button {
    display: inline-flex;
    width: 52px;
    min-width: 52px;
    height: 28px;
    min-height: 28px;
    flex: 0 0 52px;
    padding: 0;
    overflow: visible;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .desktop-brand-logo-button:hover,
  .desktop-brand-logo-button.active {
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .desktop-brand-logo-button:hover .desktop-brand-logo,
  .desktop-brand-logo-button.active .desktop-brand-logo {
    filter: brightness(1.08);
    transform: scale(1.02);
  }
  .desktop-brand-logo {
    display: block;
    width: 52px;
    height: 28px;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center;
    transition:
      filter 0.15s ease,
      transform 0.15s ease;
  }
  .header-actions {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
  }
}
@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  .desktop-brand-logo-button,
  .desktop-brand-logo {
    display: none !important;
  }
}

.desktop-brand-stage {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}
.desktop-brand-stage.active {
  display: flex;
}
.desktop-brand-stage-logo {
  width: min(72%, 900px);
  max-width: calc(100% - 48px);
  max-height: 68%;
  object-fit: contain;
  border-radius: 0;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: none;
}

#mainContainer.desktop-output-local-hidden > .grid-pattern,
#mainContainer.desktop-output-local-hidden > #projectMorphBackgroundSource,
#mainContainer.desktop-output-local-hidden > #projectMorphBackgroundTarget,
#mainContainer.desktop-output-local-hidden > #viewportBackgroundImage,
#mainContainer.desktop-output-local-hidden > #sceneBlendCanvas,
#mainContainer.desktop-output-local-hidden > #mainCanvas,
#mainContainer.desktop-output-local-hidden > #finalGpuCanvas,
#mainContainer.desktop-output-local-hidden > #graffitiGpuOverlayCanvas,
#mainContainer.desktop-output-local-hidden > #pathFxOverlayCanvas,
#mainContainer.desktop-output-local-hidden > #particleGpuOverlayCanvas,
#mainContainer.desktop-output-local-hidden > #lampGlCanvas,
#mainContainer.desktop-output-local-hidden > #geometryGlCanvas,
#mainContainer.desktop-output-local-hidden > #sweepGlCanvas {
  opacity: 0 !important;
  pointer-events: none !important;
}
@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  .desktop-brand-stage {
    display: none !important;
  }
}

.minimal-morph-family-row label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.minimal-morph-family-row select {
  min-width: 128px;
  max-width: 170px;
}
.minimal-morph-pools-row {
  overflow: visible !important;
}
.orange-profile-group-dropdown {
  width: 100%;
  max-width: none;
}
#minimalMorphProfileGroupSummary {
  font-weight: 600;
  color: #fdba74;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.profile-library-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.profile-library-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box;
}
.profile-library-tab input[type='checkbox'] {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  margin: 0;
  accent-color: #38bdf8;
  cursor: pointer;
}
.profile-library-tab > span {
  min-width: 0;
}

.morph-profile-group-dropdown {
  position: relative;
  min-width: 155px;
  max-width: 250px;
}
.morph-profile-group-dropdown > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(71, 85, 105, 0.75);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.86);
  cursor: pointer;
  color: #cbd5e1;
}
.morph-profile-group-dropdown > summary::-webkit-details-marker {
  display: none;
}
.morph-profile-group-dropdown > summary::after {
  content: '▾';
  margin-left: auto;
  color: #94a3b8;
  font-size: 10px;
}
.morph-profile-group-dropdown[open] > summary::after {
  transform: rotate(180deg);
}
#morphProfileGroupSummary {
  font-weight: 600;
  color: #67e8f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 118px;
}
.morph-profile-group-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  min-width: 190px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 6px;
  border: 1px solid rgba(71, 85, 105, 0.9);
  border-radius: 8px;
  background: #0f172a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.morph-profile-group-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(30, 41, 59, 0.62);
}
.morph-profile-group-check.browsed {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.48);
  background: rgba(14, 165, 233, 0.1);
}
.morph-reset-defaults {
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.38);
  background: rgba(56, 189, 248, 0.08);
  font-size: 16px !important;
}
.morph-reset-defaults:hover {
  background: rgba(56, 189, 248, 0.18);
}

.control-row.blue-morph-enabled,
#profileSettingsGroup.blue-morph-enabled,
.fill-settings-block.blue-morph-enabled {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.58);
  background-color: rgba(14, 165, 233, 0.075);
}
.control-row.blue-morph-live,
#profileSettingsGroup.blue-morph-live,
.fill-settings-block.blue-morph-live {
  box-shadow:
    inset 0 0 0 1px rgba(103, 232, 249, 0.92),
    0 0 12px rgba(56, 189, 248, 0.1);
  background-color: rgba(14, 165, 233, 0.115);
}
.blue-morph-parameter-name {
  cursor: context-menu;
  border-radius: 4px;
}
.blue-morph-enabled .blue-morph-parameter-name {
  color: #bae6fd;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.22);
}

.blue-morph-range-host {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  width: 100%;
  isolation: isolate;
  pointer-events: auto;
}

.blue-morph-range-host > .blue-morph-current-slider {
  grid-area: 1/1 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  display: block !important;
  visibility: visible;
  opacity: 1;
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
}
.blue-morph-range-host > .blue-morph-dual {
  display: none !important;
  grid-area: 1/1;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none !important;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
}
.blue-morph-range-host.morph-live > .blue-morph-current-slider {
  visibility: hidden !important;
  opacity: 0;
  pointer-events: none !important;
}
.blue-morph-range-host.morph-live > .blue-morph-dual {
  display: block !important;
}
.blue-morph-range-host.morph-live::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #334155 0 var(--morph-low),
    #38bdf8 var(--morph-low) var(--morph-high),
    #334155 var(--morph-high) 100%
  );
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.28);
  z-index: 3;
  pointer-events: none;
}
.blue-morph-range-host > .blue-morph-dual::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border: 0;
}
.blue-morph-range-host > .blue-morph-dual::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5.5px;
  border-radius: 50%;
  border: 2px solid #e0f2fe;
  background: #38bdf8;
  box-shadow:
    0 0 0 2px rgba(56, 189, 248, 0.2),
    0 0 10px rgba(56, 189, 248, 0.4);
  pointer-events: auto;
  cursor: ew-resize;
}
.blue-morph-range-host > .blue-morph-dual::-moz-range-track {
  height: 4px;
  background: transparent;
  border: 0;
}
.blue-morph-range-host > .blue-morph-dual::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid #e0f2fe;
  background: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
  pointer-events: auto;
  cursor: ew-resize;
}

.row-inputs > .blue-morph-range-host {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
}
.control-row > .blue-morph-range-host {
  width: 100%;
  min-width: 0;
  display: grid !important;
}
.line-slider-mult > .blue-morph-range-host,
.lamp-slider-mult > .blue-morph-range-host {
  width: 100%;
  min-width: 0;
}

@media (max-width: 820px) {
  .profile-library-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .morph-profile-group-dropdown {
    max-width: none;
    width: 100%;
  }
  .morph-profile-group-menu {
    position: static;
    box-shadow: none;
    margin-top: 4px;
    min-width: 0;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  #floatingViewportControls.floating-controls {
    position: fixed !important;
    left: auto !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: calc(
      100vw - max(72px, env(safe-area-inset-left) + 64px) - max(8px, env(safe-area-inset-right))
    ) !important;
    min-height: 44px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
    z-index: 90 !important;
  }
  #floatingViewportControls.floating-controls::-webkit-scrollbar {
    display: none;
  }
  #floatingViewportControls .btn-icon,
  #floatingViewportControls button,
  #floatingViewportControls label {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    flex: 0 0 44px !important;
    touch-action: manipulation;
  }
  #fpsCounter.fps-counter {
    min-width: 52px !important;
    min-height: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation;
    cursor: pointer;
    z-index: 91 !important;
  }
}

@media (max-width: 360px) and (hover: none) and (pointer: coarse) {
  #floatingViewportControls.floating-controls {
    justify-content: flex-start !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  aside#settingsSidebar:not(.mobile-open),
  aside#settingsSidebar:not(.mobile-open) * {
    pointer-events: none !important;
  }
  .sidebar-tool-rail:not(.mobile-open):not(.mobile-rail-open),
  .sidebar-tool-rail:not(.mobile-open):not(.mobile-rail-open) * {
    pointer-events: none !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  header {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 56px !important;
    padding: 6px 8px !important;
    overflow: hidden !important;
  }
  .header-actions {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 5px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 0 3px !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }
  .header-actions::-webkit-scrollbar {
    display: none;
  }
  .header-actions > * {
    flex: 0 0 auto !important;
  }
  .header-actions button,
  .header-actions select {
    min-width: 44px !important;
    min-height: 44px !important;
    height: 44px !important;
    touch-action: manipulation;
  }
  .header-actions button.btn-icon,
  .header-actions .random-preset-btn,
  .header-actions .minimal-morph-btn,
  .header-actions .morph-settings-btn,
  .header-actions .morph-btn,
  .header-actions .project-morph-btn,
  .header-actions .project-morph-settings-btn,
  .header-actions .random-settings-btn {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  #audioReactivePanel,
  #audioRoutingPanel {
    top: calc(106px + env(safe-area-inset-top)) !important;
    box-sizing: border-box !important;
  }
  #audioReactivePanel {
    left: max(6px, env(safe-area-inset-left)) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #audioRoutingPanel {
    left: max(6px, env(safe-area-inset-left)) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    bottom: max(6px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
  }
  #btnCloseAudioPanel,
  #btnCloseAudioRouting {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    touch-action: manipulation;
  }
  .audio-routing-head {
    min-height: 44px !important;
    height: auto !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  .contour-mode-toggle button {
    min-height: 44px !important;
    height: 44px !important;
    touch-action: manipulation;
  }
  .spiral-settings-row input[type='number'],
  .spiral-settings-row select {
    min-height: 44px !important;
    height: 44px !important;
    touch-action: manipulation;
  }
  #spiralSettingsBlock .spiral-step-link,
  #spiralSettingsBlock .spiral-tangent-toggle,
  #spiralSettingsBlock .spiral-seam-round-toggle,
  #spiralSettingsBlock .spiral-fill-toggle {
    min-height: 44px !important;
    touch-action: manipulation;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  #projectMorphSettingsPanel {
    top: calc(60px + env(safe-area-inset-top)) !important;
    left: max(6px, env(safe-area-inset-left)) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 66px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    box-sizing: border-box !important;
    transform: none !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #projectMorphSettingsPanel .project-morph-setting {
    min-height: 44px !important;
  }
  #projectMorphSettingsPanel .project-morph-setting > label {
    min-height: 44px !important;
    align-items: center !important;
  }
  #projectMorphSettingsPanel .project-morph-setting input[type='number'],
  #projectMorphSettingsPanel .project-morph-setting select {
    min-height: 44px !important;
    height: 44px !important;
    touch-action: manipulation;
  }
}

#screenErrorOverlayTabs {
  display: flex;
  align-items: center;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -9px -12px 10px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.96);
  user-select: none;
  -webkit-user-select: none;
}
#screenErrorOverlayTabs button {
  height: 26px;
  min-width: 78px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
  font:
    700 11px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    'Liberation Mono',
    'Courier New',
    monospace;
  cursor: pointer;
}
#screenErrorOverlayTabs button:hover {
  background: rgba(30, 41, 59, 0.95);
  color: #fff;
}
#screenErrorOverlayTabs button.is-active {
  border-color: rgba(56, 189, 248, 0.72);
  background: rgba(8, 47, 73, 0.78);
  color: #bae6fd;
}
#screenErrorOverlayAnalyze {
  margin-left: auto;
  min-width: 112px !important;
}
#screenErrorOverlayAnalyze.is-enabled {
  border-color: rgba(74, 222, 128, 0.72) !important;
  background: rgba(20, 83, 45, 0.72) !important;
  color: #bbf7d0 !important;
}
#screenErrorOverlayErrorsPanel[hidden],
#screenErrorOverlayLoadPanel[hidden] {
  display: none !important;
}
#screenErrorOverlayLoadText {
  margin: 0;
  min-width: 0;
  white-space: pre;
  overflow-wrap: normal;
  color: #cbd5e1;
  font:
    600 11px/1.48 ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    'Liberation Mono',
    'Courier New',
    monospace;
  user-select: text;
  -webkit-user-select: text;
}
#screenErrorOverlayLoadPanel {
  min-width: max-content;
}
@media (max-width: 620px) {
  #screenErrorOverlayTabs {
    margin: -8px -9px 8px;
    padding: 6px 7px;
    gap: 4px;
    overflow-x: auto;
  }
  #screenErrorOverlayTabs button {
    min-width: 70px;
    padding: 0 6px;
    font-size: 10px;
  }
  #screenErrorOverlayAnalyze {
    min-width: 100px !important;
    margin-left: 0;
  }
  #screenErrorOverlayLoadText {
    font-size: 9.5px;
    line-height: 1.38;
  }
}

#screenErrorOverlay.is-load-tab {
  border-color: rgba(56, 189, 248, 0.72);
  background: rgba(3, 12, 24, 0.94);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(14, 116, 144, 0.24);
}
#screenErrorOverlay.is-load-tab #screenErrorOverlayHeader {
  border-bottom-color: rgba(56, 189, 248, 0.25);
  background: rgba(8, 47, 73, 0.72);
}
#screenErrorOverlay.is-load-tab #screenErrorOverlayTitle {
  color: #7dd3fc;
}

.effect-order-setting {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  min-width: 260px;
}
.effect-order-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}
.effect-order-heading button {
  font-size: 11px;
  padding: 3px 7px;
  white-space: nowrap;
}
.effect-order-hint {
  font-size: 10px;
  opacity: 0.68;
  margin-bottom: 6px;
}
.effect-order-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.effect-order-row {
  display: grid;
  grid-template-columns: 20px 24px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.46);
  cursor: grab;
  user-select: none;
}
.effect-order-row:active {
  cursor: grabbing;
}
.effect-order-row.dragging {
  opacity: 0.42;
}
.effect-order-row.drag-over {
  outline: 1px solid currentColor;
  outline-offset: 1px;
}
.effect-order-handle {
  font-size: 14px;
  opacity: 0.72;
  text-align: center;
}
.effect-order-index {
  font:
    10px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  opacity: 0.62;
  text-align: right;
}
.effect-order-label {
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
}

.morph-profile-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  margin: 4px 0 6px;
  padding: 6px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 8px;
  background: rgba(8, 15, 28, 0.62);
}
.morph-profile-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  color: var(--text-muted);
  font-size: 10px;
}
.morph-profile-select-wrap select {
  min-width: 120px;
  max-width: 220px;
  flex: 1;
}
.morph-profile-action {
  min-height: 28px;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
}
.morph-profile-engine-badge {
  font-size: 9px;
  color: #67e8f9;
  border: 1px solid rgba(103, 232, 249, 0.3);
  border-radius: 999px;
  padding: 2px 6px;
  white-space: nowrap;
}
.morph-profile-create-menu {
  position: fixed;
  z-index: 12050;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 8px;
  background: #0b1220;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.morph-profile-create-menu.hidden {
  display: none !important;
}
.morph-profile-create-menu button {
  text-align: left;
  min-width: 190px;
}
.morph-parameter-routing-panel {
  margin: 0 0 6px;
  padding: 6px;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.42);
}
.morph-routing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 10px;
}
.morph-routing-head button {
  min-height: 26px;
}
.morph-parameter-picker {
  margin-bottom: 6px;
  padding: 5px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.7);
}
.morph-parameter-picker.hidden {
  display: none !important;
}
.morph-parameter-picker input {
  width: 100%;
  margin-bottom: 4px;
}
.morph-parameter-options {
  max-height: 180px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.morph-param-group-title {
  position: sticky;
  top: 0;
  padding: 3px 4px;
  color: #94a3b8;
  background: #0b1220;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.morph-param-option {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}
.morph-param-option.active {
  color: #67e8f9;
}
.morph-profile-bindings {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.morph-binding-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  padding: 4px 5px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: inset 2px 0 0 rgba(34, 211, 238, 0.72);
}
.morph-binding-label {
  min-width: 0;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.morph-binding-range {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.morph-binding-range input {
  width: 58px !important;
  min-width: 0;
}
.morph-binding-legacy {
  font-size: 9px;
  color: #67e8f9;
}
.morph-binding-remove {
  width: 26px;
  height: 26px;
  padding: 0;
}
.morph-orange-profile-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  color: var(--text-muted);
}
.morph-orange-profile-summary.hidden {
  display: none !important;
}
#morphSettingsPanel.morph-profile-orange .morph-settings-grid {
  display: none !important;
}
#morphSettingsPanel.morph-profile-orange #btnAddMorphParameter {
  display: none !important;
}
#morphSettingsPanel.morph-profile-orange .morph-profile-bindings {
  display: none !important;
}
.blue-morph-parameter-name.morph-route-enabled {
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.65);
  border-radius: 4px;
}
.control-row.morph-route-enabled,
.fill-settings-block.morph-route-enabled {
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.55) !important;
}
@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  .morph-profile-toolbar {
    flex-wrap: wrap;
  }
  .morph-profile-select-wrap {
    flex-basis: 100%;
  }
  .morph-profile-action {
    min-width: 44px;
    min-height: 44px;
  }
  .morph-binding-row {
    grid-template-columns: 1fr auto;
  }
  .morph-binding-range {
    grid-column: 1/-1;
  }
  .morph-binding-remove {
    width: 44px;
    height: 44px;
  }
}

#morphSettingsPanel.morph-profile-orange .morph-checkbox-tools {
  display: none !important;
}

.morph-route-control-enabled {
  outline: 1px solid rgba(34, 211, 238, 0.85);
  outline-offset: 2px;
  border-radius: 4px;
}

#morphSettingsPanel.morph-audio-routing-panel {
  top: 48px !important;
  bottom: 8px !important;
  left: 8px !important;
  right: auto !important;
  width: 50vw !important;
  min-width: 640px !important;
  max-width: calc(100vw - 16px) !important;
  max-height: none !important;
  padding: 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.985);
  border: 1px solid rgba(34, 211, 238, 0.42);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
  z-index: 86;
}
#morphSettingsPanel.morph-audio-routing-panel.hidden {
  display: none !important;
}
#morphSettingsPanel.morph-audio-routing-panel .morph-settings-title {
  height: 38px;
  margin: 0;
  padding: 6px 8px 6px 10px;
  border-bottom: 1px solid rgba(71, 85, 105, 0.58);
  background: rgba(8, 145, 178, 0.11);
  font-size: 12px;
}
#morphSettingsPanel.morph-audio-routing-panel .morph-settings-title > span:first-child {
  color: #cffafe;
}
#morphSettingsPanel.morph-audio-routing-panel .morph-settings-subtitle {
  color: #67e8f9;
  opacity: 0.72;
}
#morphSettingsPanel.morph-audio-routing-panel .morph-checkbox-tools {
  display: none !important;
}
.morph-routing-layout {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.morph-routing-targets {
  padding: 7px;
  overflow: auto;
  border-right: 1px solid rgba(71, 85, 105, 0.58);
  background: rgba(2, 6, 23, 0.4);
}
.morph-routing-target {
  color: #cbd5e1;
}
.morph-routing-target.active {
  color: #fff;
  border-color: #22d3ee;
  background: rgba(8, 145, 178, 0.34);
}
.morph-routing-target {
  cursor: pointer;
}
.morph-routing-target:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(100, 116, 139, 0.8);
}
.morph-routing-target.active:hover {
  background: rgba(8, 145, 178, 0.4);
  border-color: #22d3ee;
}
.morph-routing-target-badge {
  margin-left: auto;
  padding: 0 5px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 15px;
  color: #fbbf24;
  background: rgba(120, 53, 15, 0.45);
}
.morph-route-layer-participation {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.morph-route-layer-participation input {
  margin: 0;
}
.morph-binding-row.morph-route-layer-off
  > :not(.morph-route-layer-participation):not(.morph-route-drag-handle) {
  opacity: 0.45;
}
.morph-route-layer-focus-hint {
  margin: 0 0 6px;
  padding: 5px 8px;
  border-left: 2px solid #22d3ee;
  background: rgba(8, 145, 178, 0.12);
}
.morph-routing-main {
  min-width: 0;
  overflow: auto;
  padding: 8px;
}
#morphSettingsPanel .morph-profile-toolbar.morph-routing-preset-bar {
  margin: 0 0 8px;
  padding: 6px;
  border-color: rgba(34, 211, 238, 0.24);
  background: rgba(8, 145, 178, 0.07);
  display: flex;
  flex-wrap: wrap;
}
#morphSettingsPanel .morph-profile-select-wrap {
  min-width: 190px;
  flex: 1;
}
#morphSettingsPanel .morph-profile-select-wrap select {
  max-width: none !important;
  min-width: 130px;
  height: 27px;
  font-size: 10px;
}
#morphSettingsPanel .morph-profile-engine-badge {
  color: #67e8f9;
  border-color: rgba(34, 211, 238, 0.4);
}
#morphSettingsPanel .morph-order-mode {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(71, 85, 105, 0.62);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.34);
}
#morphSettingsPanel .morph-order-mode.hidden {
  display: none !important;
}
#morphSettingsPanel .morph-order-mode-btn {
  height: 25px;
  min-height: 25px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #94a3b8;
  font-size: 9px;
  white-space: nowrap;
}
#morphSettingsPanel .morph-order-mode-btn:hover {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.55);
}
#morphSettingsPanel .morph-order-mode-btn.active {
  color: #ecfeff;
  border-color: rgba(34, 211, 238, 0.52);
  background: rgba(8, 145, 178, 0.28);
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.08);
}
#morphSettingsPanel .morph-routing-shell {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
#morphSettingsPanel .morph-routing-groups {
  margin-bottom: 4px;
}
#morphSettingsPanel .morph-routing-groups .audio-route-group-btn {
  border-color: rgba(34, 211, 238, 0.34);
  background: rgba(8, 145, 178, 0.09);
  color: #cffafe;
}
#morphSettingsPanel .morph-routing-groups .audio-route-group-btn:hover {
  border-color: #22d3ee;
  background: rgba(8, 145, 178, 0.2);
}
#morphSettingsPanel .audio-route-group-menu {
  border-color: rgba(34, 211, 238, 0.44);
}
#morphSettingsPanel .audio-param-option:hover,
#morphSettingsPanel .audio-param-option.active {
  background: rgba(8, 145, 178, 0.24);
  color: #ecfeff;
}
#morphSettingsPanel .audio-param-group-title {
  color: #67e8f9;
}
#morphProfileBindings.audio-routing-rows {
  margin-top: 7px;
  display: grid;
  gap: 6px;
}
#morphProfileBindings .morph-route-row {
  grid-template-columns: 16px 22px 14px minmax(150px, 1.55fr) 72px 72px 72px 24px !important;
  min-width: 540px !important;
  padding: 5px;
  border-color: rgba(71, 85, 105, 0.5);
  background: rgba(30, 41, 59, 0.34);
}
#morphProfileBindings .morph-route-row::before {
  background: #22d3ee;
}
#morphProfileBindings .morph-route-dot {
  background: #22d3ee !important;
  color: #22d3ee !important;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.75);
}
#morphProfileBindings .morph-route-mode {
  font-size: 8px;
  color: #67e8f9;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#morphProfileBindings .morph-route-number {
  width: 100% !important;
  min-width: 0;
  color: #cffafe;
}
#morphProfileBindings .morph-route-discrete {
  grid-column: 6/8;
  color: #94a3b8;
  font-size: 9px;
  text-align: center;
  white-space: nowrap;
}
#morphProfileBindings .morph-route-drag-handle {
  width: 14px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 12px;
  line-height: 1;
  user-select: none;
  cursor: grab;
}
#morphProfileBindings.morph-order-free .morph-route-row {
  cursor: grab;
}
#morphProfileBindings.morph-order-free .morph-route-row:active,
#morphProfileBindings.morph-order-free .morph-route-drag-handle:active {
  cursor: grabbing;
}
#morphProfileBindings.morph-order-type .morph-route-drag-handle {
  color: #475569;
}
#morphProfileBindings.morph-order-drag-locked .morph-route-row,
#morphProfileBindings .morph-drag-forbidden {
  cursor: not-allowed !important;
}
#morphProfileBindings .morph-route-row.dragging {
  opacity: 0.48;
}
#morphProfileBindings .morph-route-row.morph-drag-before::after,
#morphProfileBindings .morph-route-row.morph-drag-after::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  border-radius: 2px;
  background: #22d3ee;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.75);
  z-index: 4;
}
#morphProfileBindings .morph-route-row.morph-drag-before::after {
  top: -4px;
}
#morphProfileBindings .morph-route-row.morph-drag-after::after {
  bottom: -4px;
}
#morphProfileBindings .morph-binding-remove {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  color: #fca5a5;
}
#morphSettingsPanel #btnAddMorphParameter {
  width: auto;
  margin-top: 8px;
  border-color: #22d3ee;
  background: rgba(8, 145, 178, 0.36);
  color: #fff;
}
#morphSettingsPanel #btnAddMorphParameter:hover {
  background: #0891b2;
}
#morphSettingsPanel #morphParameterPicker {
  position: fixed !important;
  z-index: 12050;
  width: min(330px, 70vw);
  max-height: 360px;
  overflow: auto;
  margin: 0 !important;
  padding: 6px !important;
  background: #0b1220 !important;
  border: 1px solid rgba(34, 211, 238, 0.46) !important;
  border-radius: 7px !important;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55) !important;
}
#morphSettingsPanel #morphParameterPicker.hidden {
  display: none !important;
}
#morphSettingsPanel #morphParameterOptions {
  max-height: 300px;
}
#morphSettingsPanel .morph-orange-profile-summary {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(251, 146, 60, 0.35);
  border-radius: 7px;
  background: rgba(124, 45, 18, 0.12);
}
#morphSettingsPanel .morph-compat-grid {
  display: none !important;
}

.morph-sidebar-section {
  margin-top: 8px;
  padding: 7px;
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 7px;
  background: rgba(8, 15, 28, 0.42);
}
.morph-sidebar-section-title {
  margin: -1px 0 6px;
  color: #67e8f9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.morph-sidebar-section > .morph-setting-row,
.morph-sidebar-section > .morph-mode-card,
.morph-sidebar-section > .morph-compact-pair-row,
.morph-sidebar-section > .morph-fill-block {
  margin-bottom: 5px;
  width: 100%;
  box-sizing: border-box;
}
.morph-sidebar-section .morph-compact-pair-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}
.morph-sidebar-section .morph-pair-cell {
  width: 100%;
  box-sizing: border-box;
}
.morph-sidebar-section .morph-setting-row {
  min-height: 30px;
  font-size: 10px;
}
.morph-sidebar-section .morph-setting-row select {
  max-width: 100%;
  font-size: 10px;
}
.morph-sidebar-section .morph-mode-card {
  padding: 5px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 5px;
  background: rgba(30, 41, 59, 0.45);
}
.morph-sidebar-section .morph-shape-meta-line {
  display: grid;
  gap: 5px;
}
.morph-sidebar-section .morph-profile-group-dropdown {
  width: 100%;
}
.morph-sidebar-section .morph-compat-hidden {
  display: none !important;
}
.morph-sidebar-section .morph-fill-counts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 1300px) and (min-width: 761px) {
  #morphSettingsPanel.morph-audio-routing-panel {
    width: calc(100vw - 16px) !important;
    min-width: 0 !important;
  }
}
@media (max-width: 760px) {
  #morphSettingsPanel.morph-audio-routing-panel {
    top: 6px !important;
    bottom: 6px !important;
    left: 6px !important;
    width: calc(100vw - 12px) !important;
    min-width: 0 !important;
  }
  .morph-routing-layout {
    grid-template-columns: 104px minmax(0, 1fr);
  }
  #morphProfileBindings .morph-route-row {
    min-width: 520px !important;
  }
  .morph-sidebar-section .morph-setting-row {
    min-height: 42px;
  }
}
.morph-binding-compat-label {
  display: none !important;
}
#morphSettingsPanel.morph-audio-routing-panel:not(.hidden) {
  display: flex !important;
}
.morph-sidebar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  margin: 2px 0 8px !important;
  padding: 0 !important;
}
.morph-sidebar-actions .morph-clear-checks,
.morph-sidebar-actions .morph-undo-checks,
.morph-sidebar-actions .morph-reset-defaults {
  position: static !important;
  inset: auto !important;
}

.sidebar-tool-btn[data-sidebar-mode='lightning'].active {
  background: rgba(147, 197, 253, 0.14);
  border-color: rgba(191, 219, 254, 0.76);
  color: #f8fbff;
}
.sidebar-tool-btn .lightning-icon {
  width: 21px;
  height: 21px;
  display: block;
  overflow: visible;
}
.sidebar-tool-btn .lightning-icon .lightning-bolt {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.45;
  stroke-linejoin: round;
}
.sidebar-tool-btn .lightning-icon .lightning-branch {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

#btnSidebarLightning.feature-enabled {
  color: #ff312e;
  background: rgba(255, 35, 35, 0.16);
  border-color: rgba(255, 69, 58, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(255, 120, 110, 0.22),
    0 0 10px rgba(255, 35, 35, 0.28),
    0 0 18px rgba(255, 35, 35, 0.12);
}
#btnSidebarLightning.feature-enabled .lightning-bolt {
  fill: #ff312e;
  stroke: #ffd1ce;
}
#btnSidebarLightning.feature-enabled .lightning-branch {
  stroke: #ff746b;
  opacity: 1;
}
#btnSidebarLightning.feature-enabled .lightning-icon {
  filter: drop-shadow(0 0 3px rgba(255, 214, 210, 0.95)) drop-shadow(0 0 7px rgba(255, 49, 46, 0.95))
    drop-shadow(0 0 13px rgba(255, 20, 20, 0.58));
}
#settingsSidebar.sidebar-mode-lightning .sidebar-content > .control-group:not(.lightning-settings-group) {
  display: none !important;
}
.lightning-settings-group {
  border-color: rgba(147, 197, 253, 0.42);
}
.lightning-settings-group .group-title-toggle input {
  accent-color: #93c5fd;
}
#settingsSidebar.sidebar-mode-lines .lightning-settings-group {
  display: none;
}

.morph-routing-group-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  pointer-events: none;
}
.morph-routing-group-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.morph-routing-group-icon,
.morph-route-row-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  pointer-events: none;
  user-select: none;
}
.morph-route-row-icon {
  width: 14px;
  height: 18px;
  flex-basis: 14px;
}
.morph-routing-group-icon .shape-star-icon,
.morph-route-row-icon .shape-star-icon {
  font-size: 16px;
  transform: none;
}
.morph-routing-group-icon .rainbow-line-icon,
.morph-route-row-icon .rainbow-line-icon {
  width: 15px;
  height: 3px;
  transform: rotate(-18deg);
  background: linear-gradient(90deg, #ef4444, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef);
  box-shadow: 0 0 5px rgba(103, 232, 249, 0.45);
}
.morph-routing-group-icon .lamp-dot-icon,
.morph-route-row-icon .lamp-dot-icon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fde047;
  box-shadow:
    0 0 5px #fde047,
    0 0 9px rgba(245, 158, 11, 0.75);
}
.morph-routing-group-icon .web-icon,
.morph-route-row-icon .web-icon {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
}
.morph-routing-group-icon .sweep-icon,
.morph-route-row-icon .sweep-icon {
  position: relative;
  width: 10px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 2px;
  overflow: hidden;
  display: block;
}
.morph-routing-group-icon .sweep-icon::after,
.morph-route-row-icon .sweep-icon::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 3px;
  left: -4px;
  top: 6px;
  transform: rotate(-35deg);
  background: currentColor;
  box-shadow: 0 0 5px currentColor;
}
.morph-routing-group-icon .lightning-icon,
.morph-route-row-icon .lightning-icon {
  width: 16px;
  height: 16px;
  display: block;
}
.morph-routing-group-icon .lightning-bolt,
.morph-route-row-icon .lightning-bolt {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.4;
}
.morph-routing-group-icon .lightning-branch,
.morph-route-row-icon .lightning-branch {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.morph-routing-group-icon .particle-star-icon,
.morph-route-row-icon .particle-star-icon {
  font-size: 15px;
  line-height: 1;
}
.morph-routing-group-icon .motion-arrow-icon,
.morph-route-row-icon .motion-arrow-icon {
  font-size: 14px;
  line-height: 1;
}
.morph-routing-fill-icon {
  width: 11px;
  height: 11px;
  display: block;
  border-radius: 3px 7px 7px 7px;
  transform: rotate(45deg);
  background: currentColor;
  opacity: 0.9;
}
.morph-routing-graffiti-icon {
  width: 15px;
  height: 6px;
  display: block;
  border-radius: 70% 30% 70% 30%;
  transform: rotate(-18deg);
  background: currentColor;
  box-shadow: 0 0 4px currentColor;
}
.morph-routing-corridor-icon {
  font-size: 15px;
  line-height: 1;
  font-family: system-ui, sans-serif;
}
.morph-routing-snake-icon {
  font-size: 15px;
  line-height: 1;
  filter: saturate(0.85);
}
#morphProfileBindings .morph-route-row {
  grid-template-columns: 16px 22px 14px minmax(150px, 1.55fr) 72px 72px 72px 24px !important;
}
#morphProfileBindings .morph-route-dot {
  display: none !important;
}
.morph-symbol-star::before {
  content: '☆';
}
.morph-symbol-motion::before {
  content: '➜';
}
.morph-symbol-particle::before {
  content: '✦';
}
.morph-routing-corridor-icon::before {
  content: '◎';
}
.morph-routing-snake-icon::before {
  content: '🐍';
}
.morph-routing-fallback-icon::before {
  content: '•';
}

#morphSettingsPanel .morph-routing-groups .audio-route-group-btn.morph-group-active {
  border-color: rgba(74, 222, 128, 0.92);
  color: #dcfce7;
  background: rgba(22, 163, 74, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(74, 222, 128, 0.12),
    0 0 8px rgba(34, 197, 94, 0.12);
}
#morphSettingsPanel .morph-routing-groups .audio-route-group-btn.morph-group-active:hover {
  border-color: #4ade80;
  background: rgba(22, 163, 74, 0.34);
}
#morphSettingsPanel .morph-routing-groups .audio-route-group-btn.morph-group-idle {
  border-color: rgba(250, 204, 21, 0.9);
  color: #fef9c3;
  background: rgba(161, 98, 7, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(250, 204, 21, 0.1),
    0 0 7px rgba(234, 179, 8, 0.1);
}
#morphSettingsPanel .morph-routing-groups .audio-route-group-btn.morph-group-idle:hover {
  border-color: #facc15;
  background: rgba(161, 98, 7, 0.34);
}

.audio-routing-group-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  pointer-events: none;
  width: 100%;
}
.audio-routing-group-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#audioRoutingPanel .audio-routing-group-icon {
  width: 16px;
  height: 18px;
  flex: 0 0 16px;
}
#audioRoutingPanel .audio-route-row-icon {
  width: 14px;
  height: 18px;
  flex: 0 0 14px;
  color: #cbd5e1;
}
#audioRoutingPanel .audio-routing-tools {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 4px;
}
#audioRoutingPanel .audio-route-group-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}
#audioRoutingPanel .audio-master-route-label {
  display: flex;
  align-items: center;
  gap: 5px;
}
#audioRoutingPanel .audio-master-route-label > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 1201px) {
  #audioRoutingPanel.audio-routing-panel {
    width: 68vw !important;
    max-width: 1180px !important;
    min-width: 760px !important;
  }
  #audioRoutingPanel .audio-route-row {
    grid-template-columns:
      22px 18px 18px minmax(68px, 88px) minmax(155px, 1.55fr) minmax(108px, 0.95fr)
      minmax(105px, 1fr) 64px 24px !important;
    min-width: 0 !important;
  }
}
@media (max-width: 1200px) and (min-width: 761px) {
  #audioRoutingPanel.audio-routing-panel {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
  }
  #audioRoutingPanel .audio-route-row {
    grid-template-columns: 22px 18px 18px 76px minmax(0, 1fr) minmax(90px, 1fr) 64px 24px !important;
    grid-template-rows: auto auto;
    min-width: 0 !important;
  }
  #audioRoutingPanel .audio-route-row > :nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  #audioRoutingPanel .audio-route-row > :nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  #audioRoutingPanel .audio-route-row > :nth-child(3) {
    grid-column: 3;
    grid-row: 1;
  }
  #audioRoutingPanel .audio-route-row > :nth-child(4) {
    grid-column: 4;
    grid-row: 1;
  }
  #audioRoutingPanel .audio-route-row > :nth-child(5) {
    grid-column: 5 / 8;
    grid-row: 1;
  }
  #audioRoutingPanel .audio-route-row > :nth-child(6) {
    grid-column: 1 / 5;
    grid-row: 2;
    justify-content: flex-start;
  }
  #audioRoutingPanel .audio-route-row > :nth-child(7) {
    grid-column: 5 / 7;
    grid-row: 2;
  }
  #audioRoutingPanel .audio-route-row > :nth-child(8) {
    grid-column: 7;
    grid-row: 2;
    width: 100% !important;
  }
  #audioRoutingPanel .audio-route-row > :nth-child(9) {
    grid-column: 8;
    grid-row: 1;
  }
}
@media (max-width: 760px) {
  #audioRoutingPanel .audio-route-row {
    min-width: 690px !important;
    grid-template-columns: 22px 18px 18px 76px minmax(150px, 1fr) 92px 112px 64px 24px !important;
  }
  #audioRoutingPanel .audio-routing-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#audioRoutingPanel .audio-routing-tools .audio-route-group-btn.audio-group-active {
  border-color: rgba(74, 222, 128, 0.92);
  color: #dcfce7;
  background: rgba(22, 163, 74, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(74, 222, 128, 0.12),
    0 0 8px rgba(34, 197, 94, 0.12);
}
#audioRoutingPanel .audio-routing-tools .audio-route-group-btn.audio-group-active:hover {
  border-color: #4ade80;
  background: rgba(22, 163, 74, 0.34);
}
#audioRoutingPanel .audio-routing-tools .audio-route-group-btn.audio-group-idle {
  border-color: rgba(250, 204, 21, 0.9);
  color: #fef9c3;
  background: rgba(161, 98, 7, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(250, 204, 21, 0.1),
    0 0 7px rgba(234, 179, 8, 0.1);
}
#audioRoutingPanel .audio-routing-tools .audio-route-group-btn.audio-group-idle:hover {
  border-color: #facc15;
  background: rgba(161, 98, 7, 0.34);
}

.parameter-routing-capable {
  --routing-border: rgba(248, 250, 252, 0.62);
  --routing-fill: rgba(248, 250, 252, 0.055);
  border-radius: 6px !important;
  box-shadow:
    0 0 0 1px var(--routing-border),
    inset 0 0 0 1px rgba(255, 255, 255, 0.018) !important;
  background-color: var(--routing-fill) !important;
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    filter 0.16s ease;
}
.parameter-routing-capable.parameter-routing-neutral {
  --routing-border: rgba(248, 250, 252, 0.62);
  --routing-fill: rgba(248, 250, 252, 0.055);
}
.parameter-routing-capable.parameter-routing-morph {
  --routing-border: rgba(103, 232, 249, 0.92);
  --routing-fill: rgba(14, 165, 233, 0.2);
  box-shadow:
    0 0 0 1px rgba(103, 232, 249, 0.92),
    0 0 10px rgba(14, 165, 233, 0.12),
    inset 0 0 10px rgba(14, 165, 233, 0.08) !important;
}
.parameter-routing-capable.parameter-routing-audio {
  --routing-border: rgba(190, 54, 98, 0.96);
  --routing-fill: rgba(117, 20, 55, 0.24);
  box-shadow:
    0 0 0 1px rgba(190, 54, 98, 0.96),
    0 0 10px rgba(145, 25, 65, 0.14),
    inset 0 0 10px rgba(117, 20, 55, 0.1) !important;
}
.parameter-routing-capable.parameter-routing-orange {
  --routing-border: rgba(251, 146, 60, 0.96);
  --routing-fill: rgba(154, 52, 18, 0.22);
  box-shadow:
    0 0 0 1px rgba(251, 146, 60, 0.96),
    0 0 10px rgba(249, 115, 22, 0.14),
    inset 0 0 10px rgba(154, 52, 18, 0.1) !important;
}
.parameter-routing-capable.parameter-routing-both {
  --routing-border: rgba(181, 98, 185, 0.94);
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.22) 0%,
    rgba(14, 165, 233, 0.16) 44%,
    rgba(117, 20, 55, 0.19) 56%,
    rgba(117, 20, 55, 0.27) 100%
  ) !important;
  box-shadow:
    -1px 0 0 rgba(103, 232, 249, 0.95),
    1px 0 0 rgba(190, 54, 98, 0.95),
    0 0 11px rgba(91, 92, 196, 0.16),
    inset 0 0 10px rgba(97, 49, 127, 0.1) !important;
}
.parameter-routing-capable.parameter-routing-blue-orange {
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.2) 0 46%,
    rgba(154, 52, 18, 0.18) 54% 100%
  ) !important;
  box-shadow:
    -1px 0 0 rgba(103, 232, 249, 0.95),
    1px 0 0 rgba(251, 146, 60, 0.95),
    0 0 11px rgba(125, 100, 90, 0.15) !important;
}
.parameter-routing-capable.parameter-routing-audio-orange {
  background: linear-gradient(
    135deg,
    rgba(117, 20, 55, 0.22) 0 46%,
    rgba(154, 52, 18, 0.18) 54% 100%
  ) !important;
  box-shadow:
    -1px 0 0 rgba(190, 54, 98, 0.95),
    1px 0 0 rgba(251, 146, 60, 0.95),
    0 0 11px rgba(140, 65, 75, 0.15) !important;
}
.parameter-routing-capable.parameter-routing-all {
  background: linear-gradient(
    120deg,
    rgba(14, 165, 233, 0.2) 0 31%,
    rgba(117, 20, 55, 0.2) 35% 64%,
    rgba(154, 52, 18, 0.2) 68% 100%
  ) !important;
  box-shadow:
    -1px 0 0 rgba(103, 232, 249, 0.95),
    1px 0 0 rgba(251, 146, 60, 0.95),
    0 -1px 0 rgba(190, 54, 98, 0.92),
    0 0 12px rgba(122, 74, 111, 0.16) !important;
}

.blue-morph-range-host.parameter-routing-capable {
  padding: 3px 5px;
  border-radius: 7px !important;
  box-sizing: border-box;
  min-height: 25px;
}
.blue-morph-range-host.parameter-routing-capable > .blue-morph-current-slider {
  border-radius: 5px;
}

input.parameter-routing-capable:not([type='range']):not([type='color']),
select.parameter-routing-capable,
button.parameter-routing-capable {
  padding-inline: 5px;
}
input[type='color'].parameter-routing-capable {
  background: transparent !important;
  outline: 0 !important;
}
input[type='checkbox'].parameter-routing-capable {
  outline: 1px solid var(--routing-border);
  outline-offset: 2px;
  background: transparent !important;
}

.control-row.morph-route-enabled,
.fill-settings-block.morph-route-enabled {
  box-shadow: none !important;
}
.control-row.blue-morph-enabled,
.fill-settings-block.blue-morph-enabled {
  background-color: transparent;
}

.morph-slider-value-bubble {
  position: absolute;
  z-index: 18;
  top: -34px;
  transform: translateX(-50%) translateY(4px);
  min-width: 34px;
  max-width: 92px;
  padding: 5px 8px;
  border-radius: 11px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(186, 230, 253, 0.76);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.4),
    0 0 13px rgba(56, 189, 248, 0.22);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.11s ease,
    transform 0.11s ease,
    visibility 0s linear 0.11s;
}
.morph-slider-value-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 9px;
  height: 9px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(15, 23, 42, 0.96);
  border-right: 1px solid rgba(186, 230, 253, 0.66);
  border-bottom: 1px solid rgba(186, 230, 253, 0.66);
  border-radius: 0 0 2px 0;
}
.morph-slider-value-bubble.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s;
}

.standard-slider-value-bubble {
  position: fixed;
  top: 0;
  z-index: 14040;
  transform: translate(-50%, -100%) translateY(-4px);
}
.standard-slider-value-bubble.visible {
  transform: translate(-50%, -100%) translateY(-8px);
}
.standard-slider-value-bubble::after {
  bottom: -5px;
}
.blue-morph-range-host.morph-live {
  overflow: visible !important;
}

.parameter-routing-context-menu {
  position: fixed;
  z-index: 14050;
  width: 262px;
  padding: 7px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.985), rgba(8, 15, 28, 0.985));
  box-shadow:
    0 24px 65px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(18px);
  color: #e5e7eb;
}
.parameter-routing-context-menu.hidden {
  display: none !important;
}
.parameter-routing-popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}
.parameter-routing-popup-head .morph-route-row-icon {
  width: 18px;
  height: 20px;
  flex-basis: 18px;
}
.parameter-routing-popup-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.parameter-routing-popup-title strong {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.parameter-routing-popup-title span {
  font-size: 9px;
  color: #94a3b8;
}
.parameter-routing-popup-option {
  width: 100%;
  display: grid;
  grid-template-columns: 20px 10px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(30, 41, 59, 0.46);
  text-align: left;
  color: #e5e7eb;
  min-height: 43px;
}
.parameter-routing-popup-option:hover:not(:disabled) {
  background: rgba(51, 65, 85, 0.62);
  border-color: rgba(148, 163, 184, 0.24);
}
.parameter-routing-popup-option[aria-checked='true'].routing-morph {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(103, 232, 249, 0.42);
}
.parameter-routing-popup-option[aria-checked='true'].routing-audio {
  background: rgba(117, 20, 55, 0.22);
  border-color: rgba(190, 54, 98, 0.48);
}
.parameter-routing-popup-option[aria-checked='true'].routing-orange {
  background: rgba(154, 52, 18, 0.2);
  border-color: rgba(251, 146, 60, 0.52);
}
.parameter-routing-popup-option:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.parameter-routing-popup-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(203, 213, 225, 0.42);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(2, 6, 23, 0.56);
}
.routing-morph[aria-checked='true'] .parameter-routing-popup-check {
  color: #e0f2fe;
  border-color: #67e8f9;
  background: #0284c7;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.28);
}
.routing-audio[aria-checked='true'] .parameter-routing-popup-check {
  color: #fff1f2;
  border-color: #fb7185;
  background: #881337;
  box-shadow: 0 0 8px rgba(190, 24, 93, 0.32);
}
.routing-orange[aria-checked='true'] .parameter-routing-popup-check {
  color: #fff7ed;
  border-color: #fdba74;
  background: #9a3412;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.3);
}
.parameter-routing-popup-swatch {
  width: 8px;
  height: 24px;
  border-radius: 999px;
  background: var(--routing-accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--routing-accent) 55%, transparent);
}
.parameter-routing-popup-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.parameter-routing-popup-option-text strong {
  font-size: 10px;
}
.parameter-routing-popup-option-text small {
  font-size: 8px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.parameter-routing-popup-foot {
  padding: 6px 8px 3px;
  color: #64748b;
  font-size: 8px;
  text-align: center;
}
.parameter-routing-control {
  cursor: context-menu;
}
@media (max-width: 760px) {
  .parameter-routing-context-menu {
    width: min(290px, calc(100vw - 16px));
    padding: 8px;
  }
  .parameter-routing-popup-option {
    min-height: 48px;
  }
  .morph-slider-value-bubble {
    font-size: 11px;
    padding: 6px 9px;
    top: -38px;
  }
}

#morphSettingsPanel .morph-header-master {
  margin-left: auto;
  min-width: 72px;
  height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.5);
  background: rgba(8, 145, 178, 0.16);
  color: #cffafe;
  font:
    700 10px/1 system-ui,
    sans-serif;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.06);
}
#morphSettingsPanel .morph-header-master.active {
  background: rgba(8, 145, 178, 0.34);
  border-color: #22d3ee;
  box-shadow:
    0 0 14px rgba(34, 211, 238, 0.16),
    inset 0 0 0 1px rgba(207, 250, 254, 0.08);
}
#morphSettingsPanel .morph-profile-save,
#morphSettingsPanel .morph-profile-reset {
  padding-inline: 9px;
}
#morphSettingsPanel .morph-profile-save.dirty {
  color: #d9f99d;
  border-color: rgba(163, 230, 53, 0.58);
  background: rgba(77, 124, 15, 0.22);
  box-shadow: 0 0 12px rgba(163, 230, 53, 0.1);
}
#morphSettingsPanel.morph-profile-dirty .morph-profile-toolbar {
  border-color: rgba(250, 204, 21, 0.4);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.05);
}
#morphSettingsPanel .morph-profile-reset:not(:disabled) {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.46);
  background: rgba(120, 53, 15, 0.18);
}
#morphSettingsPanel .morph-profile-action:disabled {
  opacity: 0.38;
  cursor: default;
}
@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  #morphSettingsPanel .morph-header-master {
    min-width: 76px;
    height: 34px;
  }
  #morphSettingsPanel .morph-profile-save,
  #morphSettingsPanel .morph-profile-reset {
    flex: 1 1 145px;
  }
}

.parameter-group-icon .palette-routing-icon,
.morph-routing-group-icon .palette-routing-icon,
.audio-routing-group-icon .palette-routing-icon {
  width: 14px;
  height: 14px;
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.parameter-group-icon .palette-routing-icon circle,
.morph-routing-group-icon .palette-routing-icon circle,
.audio-routing-group-icon .palette-routing-icon circle {
  fill: currentColor;
  stroke: none;
}

.morph-profile-action.morph-profile-icon {
  width: 30px;
  min-width: 30px;
  height: 28px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.morph-profile-action.morph-profile-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
#morphSettingsPanel .morph-routing-visible-head {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 5px 6px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 7px;
  background: rgba(8, 145, 178, 0.065);
}
#morphSettingsPanel .morph-routing-visible-head strong {
  margin-right: auto;
  color: #cffafe;
}
#morphSettingsPanel .morph-order-mode-prominent {
  display: inline-flex !important;
  flex: 0 0 auto;
  border-color: rgba(34, 211, 238, 0.52);
  background: rgba(2, 6, 23, 0.7);
}
#morphSettingsPanel .morph-order-label {
  padding: 0 5px;
  color: #94a3b8;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#morphSettingsPanel .morph-order-mode-btn {
  min-width: 58px;
}
#morphProfileBindings .morph-route-drag-handle {
  cursor: grab;
  border: 1px solid transparent;
  border-radius: 4px;
}
#morphProfileBindings .morph-route-drag-handle:hover {
  color: #e0f2fe;
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(8, 145, 178, 0.16);
}
#morphProfileBindings.morph-order-type .morph-route-drag-handle {
  cursor: not-allowed;
}
.morph-legacy-geometry-compat {
  display: none !important;
}

.random-settings-panel {
  width: min(980px, 72vw);
  max-width: calc(100vw - 18px);
  padding: 0 !important;
  border-color: rgba(249, 115, 22, 0.42) !important;
  background: rgba(7, 12, 22, 0.98) !important;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.48);
}
.random-settings-panel .orange-morph-title {
  height: 38px;
  margin: 0;
  padding: 6px 8px 6px 10px;
  border-bottom: 1px solid rgba(249, 115, 22, 0.32);
  background: rgba(194, 65, 12, 0.11);
}
.random-settings-panel .orange-master {
  margin-left: auto;
  border-color: rgba(249, 115, 22, 0.48);
  background: rgba(194, 65, 12, 0.22);
  color: #ffedd5;
}
.random-settings-panel .orange-master.active {
  border-color: #fb923c;
  background: rgba(234, 88, 12, 0.36);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.16);
}
.random-settings-panel .orange-profile-toolbar {
  margin: 7px 8px 6px;
  border-color: rgba(249, 115, 22, 0.25);
  background: rgba(124, 45, 18, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.random-settings-panel .orange-profile-toolbar .morph-profile-save.dirty {
  color: #fed7aa;
  border-color: #fb923c;
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.12);
}
.random-settings-panel .orange-create-composition {
  margin-left: auto;
  color: #fdba74;
  border-color: rgba(249, 115, 22, 0.4);
}
.random-settings-panel .orange-create-composition svg {
  width: 17px;
  height: 17px;
}
.random-settings-panel .orange-routing-shell {
  margin: 0 8px 7px;
  padding: 6px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 8px;
  background: rgba(67, 20, 7, 0.12);
}
.random-settings-panel .orange-routing-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.random-settings-panel .orange-routing-head strong {
  color: #ffedd5;
}
.random-settings-panel .orange-routing-head .hint-text {
  margin-left: auto;
  font-size: 9px;
}
.random-settings-panel .orange-routing-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.random-settings-panel .orange-routing-groups .audio-route-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-color: rgba(249, 115, 22, 0.28);
  background: rgba(124, 45, 18, 0.14);
  color: #fed7aa;
}
.random-settings-panel .orange-routing-groups .audio-route-group-btn:hover,
.random-settings-panel .orange-routing-groups .audio-route-group-btn.active-filter {
  border-color: #fb923c;
  background: rgba(234, 88, 12, 0.28);
  color: #fff7ed;
}
.random-settings-panel .orange-routing-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.random-settings-panel .orange-route-row {
  grid-template-columns: 16px 22px 14px minmax(150px, 1.55fr) 72px 72px 24px;
  align-items: center;
  gap: 5px;
  min-width: 540px;
  padding: 5px;
  border-color: rgba(71, 85, 105, 0.5);
  background: rgba(30, 41, 59, 0.34);
  box-shadow: inset 2px 0 0 rgba(251, 146, 60, 0.72);
}
.random-settings-panel .orange-route-row > .morph-binding-remove {
  margin-left: auto;
}
.random-settings-panel .orange-route-picker {
  min-width: 0;
}
.random-settings-panel .orange-route-picker > .audio-param-picker-button {
  width: 100%;
  text-align: left;
}
.random-settings-panel .orange-route-row.disabled {
  opacity: 0.56;
}
.random-settings-panel .orange-route-param-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
}
.random-settings-panel .orange-route-param-label small {
  font-size: 8px;
  color: #b98b6f;
}
.random-settings-panel .orange-route-param-label strong {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff7ed;
}
.random-settings-panel .orange-route-range {
  display: flex;
  align-items: center;
  gap: 4px;
}
.random-settings-panel .orange-route-range input {
  width: 62px;
}
.random-settings-panel .orange-route-static-note {
  font-size: 9px;
  color: #fdba74;
}
.random-settings-panel .orange-routing-empty {
  padding: 8px;
  border: 1px dashed rgba(251, 146, 60, 0.22);
  border-radius: 7px;
}

.random-settings-panel .orange-fixed-settings {
  margin: 0 8px 8px;
  padding: 6px;
  border: 1px solid rgba(71, 85, 105, 0.45);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.46);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.random-settings-panel .orange-fixed-settings > .morph-setting-row {
  margin: 0;
  min-width: 0;
}
.random-settings-panel .orange-group-filter-hidden {
  display: none !important;
}
.random-settings-panel .orange-group-empty-note {
  grid-column: 1/-1;
  padding: 10px;
  text-align: center;
}
@media (max-width: 760px) {
  .random-settings-panel {
    width: calc(100vw - 8px) !important;
    max-width: none !important;
  }
  .random-settings-panel .orange-fixed-settings {
    grid-template-columns: 1fr;
  }
  .random-settings-panel .orange-profile-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .random-settings-panel .orange-routing-groups {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }
}

#morphSettingsPanel .morph-header-master {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1 !important;
  margin-left: auto !important;
  align-self: center;
  min-width: 78px;
}
#morphSettingsPanel .morph-routing-target-master {
  opacity: 1 !important;
  font-weight: 800;
  color: #ecfeff;
  border-color: rgba(71, 85, 105, 0.55);
  background: rgba(30, 41, 59, 0.45);
}
#morphSettingsPanel .morph-routing-target-master.active {
  border-color: #22d3ee;
  background: rgba(8, 145, 178, 0.3);
}
#morphSettingsPanel .morph-master-dot {
  background: #22d3ee !important;
  color: #22d3ee !important;
  box-shadow: 0 0 9px rgba(34, 211, 238, 0.7);
}
#morphSettingsPanel .morph-routing-visible-head {
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 5px 6px;
}
#morphSettingsPanel .morph-compact-profile-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
}
#morphSettingsPanel .morph-compact-profile-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 27px;
  padding: 2px 5px;
  border: 1px solid rgba(71, 85, 105, 0.56);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.42);
  font-size: 8px;
  color: #94a3b8;
}
#morphSettingsPanel .morph-compact-profile-field > span {
  white-space: nowrap;
}
#morphSettingsPanel .morph-compact-profile-field select {
  height: 23px;
  min-height: 23px;
  max-width: 132px;
  padding: 1px 4px;
  font-size: 8px;
}
#morphSettingsPanel .morph-compact-profile-check {
  cursor: pointer;
  color: #cbd5e1;
}
#morphSettingsPanel .morph-compact-profile-check input {
  margin: 0;
  width: 13px;
  height: 13px;
}
#morphSettingsPanel .morph-compact-source-row {
  display: none !important;
}
#morphSettingsPanel .morph-mode-card-compact-source > .morph-top-row {
  display: none !important;
}
#morphSettingsPanel .morph-routing-tools-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 27px;
  margin: 0 0 6px;
  padding: 1px 2px;
}
#morphSettingsPanel .morph-routing-tools-meta .audio-routing-tools-hint {
  flex: 1 1 auto;
  font-size: 9px;
  color: #94a3b8;
}
#morphSettingsPanel .morph-order-mode-prominent {
  display: inline-flex !important;
  flex: 0 0 auto;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
#morphSettingsPanel .morph-order-toggle {
  height: 25px;
  min-height: 25px;
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid rgba(34, 211, 238, 0.42);
  background: rgba(8, 145, 178, 0.12);
  color: #cffafe;
  font-size: 9px;
  white-space: nowrap;
}
#morphSettingsPanel .morph-order-toggle:hover {
  border-color: #22d3ee;
  background: rgba(8, 145, 178, 0.24);
}
#morphSettingsPanel .morph-order-toggle.free {
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(30, 64, 175, 0.18);
}
#morphSettingsPanel #btnAddMorphParameter {
  flex: 0 0 auto;
  white-space: nowrap;
}

.morph-transient-decision-overlay {
  position: fixed;
  inset: 0;
  z-index: 15050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.56);
  backdrop-filter: blur(5px);
}
.morph-transient-decision-card {
  width: min(430px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 13px;
  background: linear-gradient(180deg, #111827, #08101d);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
  color: #e5e7eb;
}
.morph-transient-decision-card > strong {
  font-size: 13px;
  color: #f8fafc;
}
.morph-transient-decision-card > span {
  font-size: 10px;
  line-height: 1.4;
  color: #94a3b8;
}
.morph-transient-decision-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.morph-transient-decision-actions button {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 8px;
}
.morph-transient-decision-actions .primary {
  color: #ecfeff;
  border-color: #22d3ee;
  background: rgba(8, 145, 178, 0.28);
}
.morph-transient-decision-actions .danger {
  color: #fee2e2;
  border-color: #ef4444;
  background: rgba(127, 29, 29, 0.24);
}
#morphSettingsPanel.morph-profile-transient .morph-profile-toolbar {
  border-color: rgba(250, 204, 21, 0.52);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.07);
}
.random-settings-panel.morph-profile-transient .orange-profile-toolbar {
  border-color: rgba(250, 204, 21, 0.48);
}

.parameter-group-icon .spiral-routing-icon,
.morph-routing-group-icon .spiral-routing-icon,
.audio-routing-group-icon .spiral-routing-icon {
  width: 15px;
  height: 15px;
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.parameter-group-icon .spiral-routing-icon circle,
.morph-routing-group-icon .spiral-routing-icon circle,
.audio-routing-group-icon .spiral-routing-icon circle {
  fill: currentColor;
  stroke: none;
}
#morphSettingsPanel .morph-spiral-fixed-settings {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(34, 211, 238, 0.2);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 330px;
}
#morphSettingsPanel .morph-spiral-fixed-title {
  font-size: 8px;
  color: #67e8f9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 3px;
}
#morphSettingsPanel .morph-spiral-fixed-settings .morph-setting-row {
  margin: 0 !important;
  padding: 5px !important;
  background: rgba(8, 145, 178, 0.05);
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 6px;
}

@media (max-width: 900px) {
  #morphSettingsPanel .morph-compact-profile-controls {
    min-width: 560px;
  }
  #morphSettingsPanel .morph-routing-visible-head {
    overflow-x: auto;
  }
}

@media (min-width: 1301px) {
  #morphSettingsPanel.morph-audio-routing-panel {
    width: 68vw !important;
    max-width: 1180px !important;
    min-width: 860px !important;
  }
}

#morphSettingsPanel .morph-profile-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}
#morphSettingsPanel .morph-profile-select-wrap {
  flex: 0 1 330px !important;
  min-width: 180px !important;
  max-width: 330px !important;
}
#morphSettingsPanel .morph-profile-select-wrap select {
  width: 220px !important;
  min-width: 130px !important;
  max-width: 240px !important;
  flex: 0 1 240px !important;
}
#morphSettingsPanel .morph-profile-toolbar-flags {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
#morphSettingsPanel .morph-profile-toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 2px 7px;
  border: 1px solid rgba(71, 85, 105, 0.55);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.38);
  font-size: 8px;
  color: #cbd5e1;
  white-space: nowrap;
  cursor: pointer;
}
#morphSettingsPanel .morph-profile-toolbar-check input {
  width: 13px;
  height: 13px;
  margin: 0;
}
#morphSettingsPanel .morph-compact-profile-controls {
  gap: 4px !important;
  min-width: 0 !important;
  flex-wrap: nowrap;
}
#morphSettingsPanel .morph-compact-profile-field {
  padding: 2px 4px !important;
}
#morphSettingsPanel .morph-compact-profile-field select {
  max-width: 118px !important;
  min-width: 88px !important;
}
#morphSettingsPanel .morph-compact-profile-field:has(#morphSpiralMorphType) select {
  max-width: 150px !important;
  min-width: 120px !important;
}

#morphProfileBindings .morph-route-row {
  display: flex !important;
  align-items: center;
  gap: 5px;
  grid-template-columns: none !important;
  min-width: 0 !important;
  width: 100%;
  padding: 5px 6px !important;
}
#morphProfileBindings .morph-route-drag-handle {
  flex: 0 0 14px;
}
#morphProfileBindings .morph-route-drag-placeholder {
  opacity: 0.25;
  cursor: default !important;
}
#morphProfileBindings .morph-route-row > input[type='checkbox'] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
}
#morphProfileBindings .morph-route-row-icon {
  flex: 0 0 15px;
}
#morphProfileBindings .morph-route-compact-picker {
  flex: 0 1 260px;
  width: auto;
  min-width: 118px;
  max-width: 280px;
}
#morphProfileBindings .morph-route-compact-picker .audio-param-picker-button {
  width: 100%;
  font-size: 9px;
  font-weight: 650;
}
#morphProfileBindings .morph-route-number {
  flex: 0 0 56px !important;
  width: 56px !important;
  min-width: 48px !important;
  text-align: center;
}
#morphProfileBindings .morph-route-range-sep {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 9px;
}
#morphProfileBindings .morph-route-inline-control,
#morphProfileBindings .morph-route-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 0;
  height: 25px;
  padding: 1px 4px;
  border: 1px solid rgba(71, 85, 105, 0.42);
  border-radius: 5px;
  background: rgba(2, 6, 23, 0.34);
  font-size: 8px;
  color: #94a3b8;
  white-space: nowrap;
}
#morphProfileBindings .morph-route-inline-control > span {
  font-size: 8px;
  color: #94a3b8;
}
#morphProfileBindings .morph-route-inline-number {
  width: 48px !important;
  height: 21px !important;
  min-height: 21px !important;
  padding: 1px 3px !important;
  text-align: center;
  font-size: 9px !important;
}
#morphProfileBindings .morph-route-inline-select select,
#morphProfileBindings .morph-route-palette-select select,
#morphProfileBindings .morph-route-harmony-select select {
  height: 21px;
  min-height: 21px;
  max-width: 125px;
  min-width: 70px;
  padding: 1px 3px;
  font-size: 8px;
}
#morphProfileBindings .morph-route-palette-select select {
  max-width: 115px;
}
#morphProfileBindings .morph-route-harmony-select select {
  max-width: 120px;
}
#morphProfileBindings .morph-route-inline-check {
  padding: 1px 5px;
  color: #cbd5e1;
  cursor: pointer;
}
#morphProfileBindings .morph-route-inline-check input {
  width: 13px;
  height: 13px;
  margin: 0;
}
#morphProfileBindings .morph-route-multiplier {
  margin-left: auto;
  border-color: rgba(34, 211, 238, 0.3);
  color: #cffafe;
}
#morphProfileBindings .morph-route-multiplier + .morph-binding-remove {
  margin-left: 0;
}
#morphProfileBindings .morph-route-multiplier > span {
  color: #67e8f9;
  font-weight: 800;
}
#morphProfileBindings .morph-binding-remove {
  flex: 0 0 24px;
  margin-left: auto;
}
#morphProfileBindings .morph-special-config-row {
  border-color: rgba(167, 139, 250, 0.34) !important;
  background: rgba(76, 29, 149, 0.08) !important;
}
#morphProfileBindings .morph-special-config-name {
  flex: 0 1 150px;
  min-width: 108px;
  font-size: 9px;
  font-weight: 700;
  color: #ddd6fe;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#morphProfileBindings .morph-special-config-range {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}
#morphProfileBindings .morph-special-config-range .morph-route-inline-control {
  border-color: rgba(139, 92, 246, 0.24);
}
#morphProfileBindings .morph-special-order-range {
  margin-left: 2px;
}
#morphProfileBindings .morph-route-mode {
  display: none !important;
}
#morphProfileBindings .morph-binding-compat-label {
  display: none !important;
}

#morphSettingsPanel .morph-spiral-fixed-settings {
  display: none !important;
}

@media (max-width: 1050px) {
  #morphSettingsPanel .morph-profile-toolbar {
    overflow-x: auto;
  }
  #morphSettingsPanel .morph-profile-toolbar-flags {
    margin-left: 0;
  }
  #morphProfileBindings .morph-route-row {
    min-width: 760px !important;
  }
}

#morphProfileBindings .morph-route-compact-picker {
  flex: 0 1 220px;
  max-width: 220px;
}
#morphProfileBindings .morph-route-binding-multiplier {
  order: 98;
}
#morphProfileBindings .morph-binding-remove {
  order: 99;
}

#morphProfileBindings .morph-route-child-binding {
  border-color: rgba(56, 189, 248, 0.24);
  background: rgba(14, 116, 144, 0.08);
}
#morphProfileBindings .morph-route-dependent-check > span {
  font-weight: 700;
  color: #bae6fd;
}
#morphProfileBindings .morph-route-row[data-morph-parameter='spiral.step'] .morph-route-dependent-check,
#morphProfileBindings
  .morph-route-row[data-morph-parameter='spiral.fillEnabled']
  .morph-route-dependent-check {
  margin-left: 2px;
}
#morphProfileBindings .morph-shape-inline-groups {
  position: relative;
  flex: 0 0 auto;
}
#morphProfileBindings .morph-shape-inline-groups-btn {
  height: 25px;
  min-width: 92px;
  max-width: 126px;
  padding: 2px 7px;
  border: 1px solid rgba(139, 92, 246, 0.26);
  border-radius: 5px;
  background: rgba(2, 6, 23, 0.34);
  color: #ddd6fe;
  font-size: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.morph-shape-inline-groups-menu {
  min-width: 150px !important;
  padding: 5px !important;
}
.morph-shape-inline-group-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  color: #cbd5e1;
  font-size: 9px;
  cursor: pointer;
}
.morph-shape-inline-group-option:hover {
  background: rgba(56, 189, 248, 0.08);
}
.morph-shape-inline-group-option input {
  width: 13px;
  height: 13px;
  margin: 0;
}

#morphProfileBindings .morph-route-inline-range {
  gap: 3px;
}
#morphProfileBindings .morph-route-inline-range .morph-route-inline-number {
  width: 42px !important;
}
#morphProfileBindings .morph-route-inline-range-sep {
  color: #64748b;
  font-size: 8px;
}
#morphProfileBindings .morph-route-dependent-range {
  border-color: rgba(56, 189, 248, 0.2);
  background: rgba(14, 116, 144, 0.06);
}
#morphProfileBindings .morph-route-row[data-morph-parameter='layer.radius'] .morph-route-dependent-check {
  border-color: rgba(56, 189, 248, 0.24);
  background: rgba(14, 116, 144, 0.08);
}

#morphProfileBindings .morph-route-compound-binding {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-height: 25px;
  padding: 2px 5px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 5px;
  background: rgba(8, 47, 73, 0.14);
  white-space: nowrap;
}
#morphProfileBindings .morph-route-compound-toggle,
#morphProfileBindings .morph-route-compound-range,
#morphProfileBindings .morph-route-compound-amplitude {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
#morphProfileBindings .morph-route-compound-toggle {
  font-size: 8px;
  color: #bae6fd;
  font-weight: 700;
  cursor: pointer;
}
#morphProfileBindings .morph-route-compound-toggle input {
  width: 13px;
  height: 13px;
  margin: 0;
}
#morphProfileBindings .morph-route-compound-caption,
#morphProfileBindings .morph-route-compound-amplitude > span {
  font-size: 8px;
  color: #94a3b8;
}
#morphProfileBindings .morph-route-compound-number {
  width: 44px !important;
}
#morphProfileBindings .morph-route-compound-amplitude {
  padding-left: 4px;
  border-left: 1px solid rgba(71, 85, 105, 0.45);
}
#morphProfileBindings .morph-route-dependent-control > span,
#morphProfileBindings .morph-route-dependent-check > span {
  font-size: 8px;
  line-height: 1.1;
}
#morphProfileBindings .morph-route-multiplier > span {
  font-weight: 700;
  white-space: nowrap;
}
#morphProfileBindings .morph-route-row {
  overflow: visible;
}

#morphProfileBindings .morph-route-always-on-multiplier {
  gap: 5px;
  background: rgba(15, 23, 42, 0.28);
}
#morphProfileBindings .morph-route-compound-static-label {
  font-size: 8px;
  color: #bae6fd;
  font-weight: 700;
  white-space: nowrap;
}
#morphProfileBindings .morph-route-compound-static-multiplier {
  width: 52px !important;
}

#morphProfileBindings .morph-route-multiplier > span,
#morphProfileBindings .morph-route-compound-static-label {
  min-width: 9px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
}
#morphProfileBindings .morph-route-row > .morph-binding-remove {
  margin-left: auto;
}
#morphProfileBindings .morph-route-row > .morph-route-multiplier ~ .morph-binding-remove {
  margin-left: 0;
}

#morphProfileBindings .morph-route-row > .morph-route-always-on-multiplier,
#morphProfileBindings .morph-route-row > .morph-route-multiplier {
  margin-left: auto !important;
  order: 98 !important;
}
#morphProfileBindings .morph-route-row > .morph-route-always-on-multiplier ~ .morph-binding-remove,
#morphProfileBindings .morph-route-row > .morph-route-multiplier ~ .morph-binding-remove {
  margin-left: 0 !important;
  order: 99 !important;
}

#morphProfileBindings .morph-special-profile-groups {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  min-width: 0;
}
#morphProfileBindings .morph-special-config-caption {
  font-size: 8px;
  color: #94a3b8;
  white-space: nowrap;
}
#morphProfileBindings .morph-special-profile-check {
  padding: 1px 4px;
}

#morphSettingsPanel .morph-speed-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0 6px;
  padding: 5px 7px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 8px;
  background: rgba(8, 145, 178, 0.07);
}
#morphSettingsPanel .morph-speed-toolbar-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 310px;
  color: #cffafe;
  font-size: 10px;
  font-weight: 700;
}
#morphSettingsPanel .morph-speed-toolbar-field > span {
  white-space: nowrap;
}
#morphSettingsPanel .morph-speed-toolbar-field select {
  min-width: 220px;
  max-width: 340px;
  height: 28px;
  min-height: 28px;
  padding: 2px 7px;
  font-size: 10px;
}
@media (max-width: 760px) {
  #morphSettingsPanel .morph-speed-toolbar {
    overflow-x: auto;
  }
  #morphSettingsPanel .morph-speed-toolbar-field {
    min-width: 360px;
  }
}

.parameter-routing-popup-audio {
  margin: 3px 0;
  padding: 8px;
  border: 1px solid rgba(190, 54, 98, 0.34);
  border-radius: 9px;
  background: rgba(117, 20, 55, 0.12);
}
.parameter-routing-popup-audio.disabled {
  opacity: 0.42;
}
.parameter-routing-popup-audio-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.parameter-routing-popup-audio-head strong {
  font-size: 10px;
  color: #fff1f2;
}
.parameter-routing-popup-audio-head small {
  font-size: 8px;
  color: #b98a9a;
  text-align: right;
}
.parameter-routing-popup-target-bubbles {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.parameter-routing-target-bubble {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(251, 113, 133, 0.46);
  background: rgba(55, 13, 28, 0.72);
  color: #fecdd3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font:
    800 10px/1 system-ui,
    sans-serif;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  cursor: pointer;
}
.parameter-routing-target-bubble:hover:not(:disabled) {
  border-color: #fb7185;
  background: rgba(117, 20, 55, 0.72);
}
.parameter-routing-target-bubble.active {
  color: #fff;
  border-color: #fda4af;
  background: #881337;
  box-shadow:
    0 0 9px rgba(190, 24, 93, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.parameter-routing-target-bubble:disabled {
  cursor: not-allowed;
}

.parameter-routing-badge-row {
  position: relative !important;
  padding-bottom: 7px !important;
}
.parameter-routing-audio-bubbles {
  position: absolute;
  z-index: 12;
  bottom: 0;
  transform: translateY(42%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  pointer-events: none;
  overflow: visible;
}
.parameter-routing-audio-bubble {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 13px;
  color: #fff1f2;
  background: #881337;
  border: 1px solid #fb7185;
  box-shadow: 0 0 5px rgba(190, 24, 93, 0.38);
  font:
    800 7px/1 system-ui,
    sans-serif;
}

#morphSettingsPanel .morph-speed-toolbar {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}
#morphSettingsPanel .morph-speed-toolbar-field {
  width: 100%;
  min-width: 0;
}
#morphSettingsPanel .morph-top-cycle-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0 !important;
  padding: 5px 7px !important;
  border: 1px solid rgba(71, 85, 105, 0.42) !important;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.48) !important;
  color: #cbd5e1;
  font-size: 10px;
}
#morphSettingsPanel .morph-top-cycle-row > .morph-cycle-controls {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}
#morphSettingsPanel .morph-top-cycle-row .tap-auto-badge {
  flex: 0 0 auto;
}

#morphProfileBindings .morph-special-config-row {
  border-color: rgba(34, 211, 238, 0.18) !important;
  background: rgba(15, 23, 42, 0.72) !important;
}
#morphProfileBindings .morph-special-config-name {
  color: #e2e8f0 !important;
}
#morphProfileBindings .morph-special-config-range .morph-route-inline-control {
  border-color: rgba(71, 85, 105, 0.42) !important;
}
#morphProfileBindings .morph-shape-route-profile-dropdown {
  flex: 0 1 245px;
  min-width: 165px;
  max-width: 245px;
}
#morphProfileBindings .morph-shape-route-profile-dropdown > summary {
  min-height: 25px;
  height: 25px;
  padding: 2px 6px;
  font-size: 8px;
}
#morphProfileBindings .morph-shape-route-profile-dropdown > summary strong {
  color: #67e8f9;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 128px;
}
#morphProfileBindings .morph-shape-route-profile-dropdown .morph-profile-group-menu {
  z-index: 16060;
}

#resourceSettingsPanel .audio-route-group.hidden,
#audioRoutingPanel .audio-routing-tools .audio-route-group.hidden {
  display: none !important;
}

.header-brand-zone {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row {
  display: flex !important;
  align-items: center;
  gap: 5px;
  grid-template-columns: none !important;
  min-width: 0 !important;
  width: 100%;
  padding: 5px 6px !important;
  overflow: visible;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-drag-handle {
  flex: 0 0 14px;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-drag-placeholder {
  opacity: 0.25;
  cursor: default !important;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > input[type='checkbox'] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row-icon {
  flex: 0 0 15px;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-compact-picker {
  flex: 0 1 220px;
  width: auto;
  min-width: 118px;
  max-width: 220px;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-compact-picker .audio-param-picker-button {
  width: 100%;
  font-size: 9px;
  font-weight: 650;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-number {
  flex: 0 0 56px !important;
  width: 56px !important;
  min-width: 48px !important;
  text-align: center;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-range-sep {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 9px;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-inline-control,
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 0;
  height: 25px;
  padding: 1px 4px;
  border: 1px solid rgba(71, 85, 105, 0.42);
  border-radius: 5px;
  background: rgba(2, 6, 23, 0.34);
  font-size: 8px;
  color: #94a3b8;
  white-space: nowrap;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-inline-control > span {
  font-size: 8px;
  color: #94a3b8;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-inline-number {
  width: 48px !important;
  height: 21px !important;
  min-height: 21px !important;
  padding: 1px 3px !important;
  text-align: center;
  font-size: 9px !important;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-inline-select select,
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-palette-select select,
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-harmony-select select {
  height: 21px;
  min-height: 21px;
  max-width: 125px;
  min-width: 70px;
  padding: 1px 3px;
  font-size: 8px;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-palette-select select {
  max-width: 115px;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-inline-check {
  padding: 1px 5px;
  color: #cbd5e1;
  cursor: pointer;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-inline-check input {
  width: 13px;
  height: 13px;
  margin: 0;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-binding-remove {
  flex: 0 0 24px;
  margin-left: auto;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-compound-binding {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-height: 25px;
  padding: 2px 5px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 5px;
  background: rgba(8, 47, 73, 0.14);
  white-space: nowrap;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-compound-toggle,
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-compound-range {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-compound-toggle {
  font-size: 8px;
  color: #bae6fd;
  font-weight: 700;
  cursor: pointer;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-compound-toggle input {
  width: 13px;
  height: 13px;
  margin: 0;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-compound-caption {
  font-size: 8px;
  color: #94a3b8;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-compound-number {
  width: 44px !important;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-inline-range-sep {
  color: #64748b;
  font-size: 8px;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-always-on-multiplier {
  gap: 5px;
  background: rgba(15, 23, 42, 0.28);
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-compound-static-label {
  font-size: 10px;
  color: #bae6fd;
  font-weight: 800;
  min-width: 9px;
  text-align: center;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-compound-static-multiplier {
  width: 52px !important;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-route-always-on-multiplier {
  margin-left: auto !important;
  order: 98 !important;
}
:is(#morphProfileBindings, #orangeMorphBindings)
  .morph-route-row
  > .morph-route-always-on-multiplier
  ~ .morph-binding-remove {
  margin-left: 0 !important;
  order: 99 !important;
}
#orangeMorphBindings .morph-route-compound-binding {
  border-color: rgba(251, 146, 60, 0.24);
  background: rgba(124, 45, 18, 0.12);
}
#orangeMorphBindings .morph-route-compound-toggle {
  color: #fed7aa;
}
#orangeMorphBindings .morph-route-always-on-multiplier {
  background: rgba(15, 23, 42, 0.28);
}
@media (max-width: 1050px) {
  #orangeMorphBindings .morph-route-row {
    min-width: 760px !important;
  }
}
@media (max-width: 760px) {
  .random-settings-panel .orange-routing-rows {
    overflow-x: auto;
    overflow-y: visible;
  }
}

.random-settings-panel .orange-routing-rows {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.audio-param-menu .audio-param-option:disabled {
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.68;
}

:is(#morphProfileBindings, #orangeMorphBindings) .morph-orbit-plain-label {
  display: flex;
  align-items: center;
  flex: 0 1 220px;
  min-width: 118px;
  max-width: 220px;
  min-height: 25px;
  padding: 2px 5px;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font-size: 9px;
  font-weight: 650;
  cursor: default;
  user-select: text;
}

#randomSettingsPanel.orange-unified-header .orange-compat-hidden {
  display: none !important;
}
#randomSettingsPanel.orange-unified-header .orange-profile-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
#randomSettingsPanel.orange-unified-header .morph-profile-toolbar-flags {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}
#randomSettingsPanel.orange-unified-header .morph-profile-toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 2px 7px;
  border: 1px solid rgba(71, 85, 105, 0.55);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.38);
  font-size: 9px;
  color: #fed7aa;
  white-space: nowrap;
  cursor: pointer;
}
#randomSettingsPanel.orange-unified-header .morph-profile-toolbar-check input {
  width: 13px;
  height: 13px;
  margin: 0;
}
#orangeMorphHeaderTiming {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 3px 8px 8px;
  padding: 7px;
  border: 1px solid rgba(249, 115, 22, 0.28);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.34);
}
#orangeMorphHeaderTiming .orange-top-cycle-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 5px;
  margin: 0;
  flex-wrap: wrap;
}
#orangeMorphHeaderTiming .orange-top-cycle-row > .morph-cycle-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
#orangeMorphHeaderTiming .morph-quick-btn {
  font-size: 9px;
  min-width: 25px;
  min-height: 24px;
  padding: 2px 5px;
}
#orangeMorphHeaderTiming .morph-quick-btn.active {
  color: #fed7aa;
  border-color: #fb923c;
  background: rgba(194, 65, 12, 0.3);
}
#orangeMorphHeaderTiming .orange-header-basics {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
#orangeMorphHeaderTiming .orange-header-basics > .morph-setting-row {
  margin: 0;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid rgba(71, 85, 105, 0.45);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.48);
}
#orangeMorphHeaderTiming .orange-header-basics .morph-interval {
  max-width: 70px;
}
#randomSettingsPanel.orange-unified-header .orange-routing-shell {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#randomSettingsPanel.orange-unified-header #btnAddOrangeMorphParameter {
  align-self: flex-start;
  margin-top: 4px;
  padding: 5px 10px;
  border: 1px solid rgba(251, 146, 60, 0.5);
  border-radius: 6px;
  background: rgba(124, 45, 18, 0.14);
  font-size: 10px;
  color: #fed7aa;
}
#randomSettingsPanel.orange-unified-header #btnAddOrangeMorphParameter:hover {
  background: rgba(194, 65, 12, 0.3);
}
#randomSettingsPanel.orange-unified-header .orange-morph-title {
  height: auto;
  min-height: 38px;
}
@media (max-width: 760px) {
  #orangeMorphHeaderTiming .orange-header-basics {
    align-items: stretch;
  }
  #orangeMorphHeaderTiming .orange-header-basics > .morph-setting-row {
    flex: 1 1 145px;
  }
}

body:has(#randomSettingsPanel:not(.hidden)) #fpsCounter,
body:has(#morphSettingsPanel:not(.hidden)) #fpsCounter,
body:has(#projectMorphSettingsPanel:not(.hidden)) #fpsCounter {
  display: none !important;
}

:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-layer-coverage {
  gap: 3px;
  flex: 0 0 auto;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-layer-coverage > span {
  white-space: nowrap;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-layer-percent {
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 21px !important;
  min-height: 21px !important;
  padding: 1px 2px !important;
  text-align: center;
  font-size: 9px !important;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row {
    flex-wrap: wrap;
  }
}

:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row[data-morph-special='shape'],
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row[data-orange-special='shape'],
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row[data-morph-special='orbits'],
:is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row[data-orange-special='orbits'] {
  background: rgba(30, 41, 59, 0.34) !important;
  border-color: rgba(71, 85, 105, 0.5) !important;
}
:is(#morphProfileBindings, #orangeMorphBindings)
  .morph-route-row:is(
    [data-morph-special='shape'],
    [data-orange-special='shape'],
    [data-morph-special='orbits'],
    [data-orange-special='orbits']
  )
  .morph-special-config-name {
  display: flex;
  align-items: center;
  flex: 0 1 220px !important;
  width: auto !important;
  min-width: 118px !important;
  max-width: 220px !important;
  min-height: 25px;
  height: 25px;
  padding: 2px 6px !important;
  border: 1px solid rgba(71, 85, 105, 0.58) !important;
  border-radius: 6px !important;
  background: #1e293b !important;
  color: #e2e8f0 !important;
  font-size: 9px !important;
  font-weight: 650 !important;
  line-height: 19px;
  box-sizing: border-box;
  white-space: nowrap;
}
:is(#morphProfileBindings, #orangeMorphBindings)
  .morph-route-row:is(
    [data-morph-special='shape'],
    [data-orange-special='shape'],
    [data-morph-special='orbits'],
    [data-orange-special='orbits']
  )
  .morph-route-layer-coverage {
  margin-left: 0;
}
:is(#morphProfileBindings, #orangeMorphBindings)
  .morph-route-row:is(
    [data-morph-special='shape'],
    [data-orange-special='shape'],
    [data-morph-special='orbits'],
    [data-orange-special='orbits']
  )
  .morph-binding-remove {
  margin-left: auto !important;
}

#settingsSidebar.sidebar-mode-ambient .sidebar-content > .control-group:not(.ambient-settings-group),
#settingsSidebar.sidebar-mode-prism .sidebar-content > .control-group:not(.prism-settings-group) {
  display: none !important;
}
.sidebar-tool-btn[data-sidebar-mode='ambient'].active {
  background: #ec489939;
  border-color: #f472b6;
  color: #fbcfe8;
}
.sidebar-tool-btn[data-sidebar-mode='prism'].active {
  background: #eab30839;
  border-color: #facc15;
  color: #fef08a;
}
.ambient-settings-group .ambient-effect-row {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(244, 114, 182, 0.2);
  border-radius: 8px;
  padding: 10px;
  margin: 5px 0;
}
.ambient-settings-group .ambient-effect-row label {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.ambient-settings-group .ambient-effect-row input[type='range'] {
  width: min(150px, 60%);
}
.ambient-settings-group .ambient-effect-row input[type='number'] {
  width: 72px;
}
.ambient-settings-group .ambient-colors {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.prism-settings-group .control-row {
  display: flex;
  justify-content: space-between;
}
.prism-settings-group .control-row label {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
}
.prism-settings-group input[type='range'] {
  width: 48%;
}
.test-morph-heading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  white-space: nowrap;
}
.test-morph-controls {
  border: 1px solid #818cf680;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  gap: 8px;
}
.test-morph-controls.hidden,
.test-morph-controls .hidden {
  display: none !important;
}
.test-morph-controls label {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
#ambientOverlayCanvas,
#prismOverlayCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 7;
  pointer-events: none;
}
#prismOverlayCanvas {
  z-index: 8;
}
#ambientOverlayCanvas.is-off,
#prismOverlayCanvas.is-off {
  display: none;
}

.ambient-tool-btn svg {
  display: block;
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 3px #f472b677);
}

.somata-effect-multiplier {
  margin-inline-start: 6px;
  min-width: 69px;
  max-width: 78px;
  padding: 4px 2px;
  border: 1px solid #536278;
  border-radius: 6px;
  background: #18253b;
  color: #eef3ff;
  font: inherit;
  font-size: 12px;
  vertical-align: middle;
  cursor: pointer;
}
.ambient-effect-row label:has(.somata-effect-multiplier),
.prism-settings-group .control-row label:has(.somata-effect-multiplier) {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}
.ambient-effect-row input[type='range'],
.prism-settings-group input[type='range'] {
  min-width: 88px;
  flex: 1 1 80px;
}

.prism-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 10px 0;
}
.prism-mode-switch button {
  background: #19263a;
  border: 1px solid #61738d;
  border-radius: 7px;
  color: #e4ebff;
  padding: 9px 7px;
  cursor: pointer;
}
.prism-mode-switch button.active {
  background: #274174;
  border-color: #8daeff;
  color: white;
  box-shadow: inset 0 0 0 1px #7397e5;
}
.prism-2d-controls {
  padding: 7px;
  border: 1px solid #394a66;
  border-radius: 7px;
  margin: 8px 0;
}
.prism-2d-controls input[type='file'] {
  max-width: 194px;
  font-size: 11px;
}
.prism-2d-controls .control-row {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.prism-2d-controls .control-row label {
  align-items: center;
  flex-wrap: wrap;
}
.prism-2d-controls button {
  color: #f3efff;
  background: #283853;
  border: 1px solid #566d91;
  border-radius: 6px;
  padding: 5px 9px;
}
.prism-settings-group [hidden] {
  display: none !important;
}

#btnSidebarPrism,
#btnSidebarAmbient,
#btnSidebarPrism.active,
#btnSidebarAmbient.active {
  color: #9aa4b3 !important;
  border-color: rgba(91, 108, 135, 0.48) !important;
  background: rgba(15, 23, 42, 0.56) !important;
  box-shadow: none !important;
}
#btnSidebarPrism {
  font-size: 23px;
}
#btnSidebarPrism .prism-skull-icon {
  display: block;
  filter: grayscale(1) brightness(0.65);
}
#btnSidebarPrism:not(.feature-enabled) {
  opacity: 0.67;
}
#btnSidebarPrism.feature-enabled {
  opacity: 1;
  color: #fff !important;
  text-shadow:
    0 0 6px #fff,
    0 0 13px rgba(226, 232, 240, 0.85);
}
#btnSidebarAmbient:not(.feature-enabled) svg {
  filter: grayscale(1) brightness(0.57) !important;
  opacity: 0.7;
}
#btnSidebarAmbient.feature-enabled svg {
  filter: drop-shadow(0 0 4px #f9a8d4) drop-shadow(0 0 9px #ec4899) !important;
  opacity: 1;
}
#btnSidebarAmbient.feature-enabled {
  border-color: rgba(244, 114, 182, 0.46) !important;
}
.prism-live-status {
  font-size: 11px;
  line-height: 1.35;
  padding: 5px 7px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(71, 85, 105, 0.6);
  color: #cbd5e1;
  margin: 5px 0;
}
.prism-live-status[data-status='failed'] {
  border-color: rgba(248, 113, 113, 0.75);
  color: #fecaca;
}
.prism-live-status[data-status='ready'] {
  border-color: rgba(45, 212, 191, 0.4);
  color: #a7f3d0;
}

#btnSidebarPrism.feature-enabled .prism-skull-icon {
  filter: grayscale(1) brightness(2.8) drop-shadow(0 0 3px #fff) drop-shadow(0 0 8px #fff);
}

#prismSettingsGroup .somata-effect-control,
#ambientSettingsGroup .somata-effect-control {
  display: block;
  margin: 8px 0;
  min-width: 0;
}
#prismSettingsGroup .somata-effect-control .row-label,
#ambientSettingsGroup .somata-effect-control .row-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 12px;
}
#prismSettingsGroup .somata-effect-control .row-label .text-mono,
#ambientSettingsGroup .somata-effect-control .row-label .text-mono {
  font-size: 11px;
  color: #b6c7df;
  white-space: nowrap;
}
#prismSettingsGroup .somata-effect-control .lamp-slider-mult,
#ambientSettingsGroup .somata-effect-control .lamp-slider-mult {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 62px;
  align-items: center;
  gap: 7px;
  width: 100%;
}
#prismSettingsGroup .somata-effect-control input[type='range'],
#ambientSettingsGroup .somata-effect-control input[type='range'] {
  width: 100%;
  min-width: 0;
  max-width: none;
  flex: 1 1 auto;
}
#prismSettingsGroup .somata-effect-control .lamp-slider-mult input[type='number'],
#ambientSettingsGroup .somata-effect-control .lamp-slider-mult input[type='number'] {
  width: 62px !important;
  min-width: 0 !important;
  padding: 5px !important;
}
#prismSettingsGroup .somata-effect-control .prism-hue-slider {
  width: 100%;
  background: linear-gradient(to right, #f33, #ff3, #3f3, #3ff, #33f, #f3f, #f33);
}
#prismShapeRow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}
#prismShapeRow .row-label {
  margin: 0;
  font-size: 13px;
}
.prism-shape-picker {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.prism-shape-picker button {
  border: 1px solid #536b93;
  border-radius: 7px;
  min-height: 34px;
  background: #182b45;
  color: #e8f5ff;
  cursor: pointer;
}
.prism-shape-picker button:active {
  background: #405b86;
}
.prism-shape-picker select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.prism-color-grid {
  padding: 6px 9px;
  margin: 7px 0;
  border: 1px solid #394c66;
  border-radius: 7px;
}

#ambientSettingsGroup .ambient-numeric-control .lamp-slider-mult {
  grid-template-columns: minmax(0, 1fr) auto 62px;
}
#ambientSettingsGroup .ambient-numeric-control .lamp-slider-mult input[type='number']:first-child {
  width: 100% !important;
  max-width: none !important;
}

#prismSettingsGroup {
  padding: 9px 11px !important;
}
#prismSettingsGroup .control-group-title {
  margin: 0 0 5px !important;
  padding: 0 !important;
  line-height: 1.15 !important;
  font-size: 12px !important;
}
#prismSettingsGroup .prism-mode-switch {
  margin: 5px 0 !important;
  gap: 4px !important;
}
#prismSettingsGroup .prism-mode-switch button {
  padding: 5px 6px !important;
  min-height: 28px !important;
  font-size: 12px !important;
}
#prismSettingsGroup #prismModeExplanation {
  margin: 2px 0 5px !important;
  line-height: 1.2 !important;
  font-size: 10px !important;
}
#prismSettingsGroup .somata-effect-control {
  margin: 3px 0 5px !important;
  padding: 0 !important;
  gap: 2px !important;
}
#prismSettingsGroup .somata-effect-control .row-label {
  margin: 0 0 2px !important;
  line-height: 1.15 !important;
  font-size: 11.5px !important;
}
#prismSettingsGroup .somata-effect-control .row-label .text-mono {
  font-size: 10.5px !important;
}
#prismSettingsGroup .somata-effect-control .lamp-slider-mult {
  grid-template-columns: minmax(0, 1fr) auto 52px !important;
  gap: 4px !important;
}
#prismSettingsGroup .somata-effect-control .lamp-slider-mult:not(:has(> .lamp-mult-label)) {
  grid-template-columns: minmax(0, 1fr) !important;
}
#prismSettingsGroup .somata-effect-control .lamp-slider-mult input[type='number'] {
  width: 52px !important;
  padding: 2px 3px !important;
  font-size: 11px !important;
  height: 25px !important;
}
#prismSettingsGroup .somata-effect-control input[type='range'] {
  height: 20px !important;
  min-height: 20px !important;
}
#prismSettingsGroup .prism-color-grid {
  padding: 3px 6px !important;
  margin: 4px 0 !important;
}
#prismSettingsGroup .prism-shape-picker {
  grid-template-columns: 27px minmax(0, 1fr) 27px;
  gap: 4px;
}
#prismSettingsGroup .prism-shape-picker button {
  min-height: 26px !important;
  border-radius: 5px !important;
}
#prismSettingsGroup #prismShapeRow {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px !important;
  align-items: center !important;
  margin: 3px 0 7px !important;
}
#prismSettingsGroup #prismShapeRow .row-label {
  font-size: 12px !important;
  line-height: 1.15 !important;
  margin: 0 !important;
}
#prismSettingsGroup #prismShapeRow select {
  min-height: 27px !important;
  font-size: 12px !important;
}
#prismSettingsGroup > .control-row:not(.somata-effect-control):not(#prismShapeRow) {
  margin: 3px 0 !important;
  min-height: 23px !important;
}
#prismSettingsGroup #prism3dLiveStatus,
#prismSettingsGroup #prism3dBackendInfo {
  display: none !important;
}
#prismSettingsGroup .prism-2d-controls {
  margin: 4px 0 !important;
  padding: 5px !important;
}

#ambientSettingsGroup {
  padding: 9px 11px !important;
}
#ambientSettingsGroup .control-group-title {
  margin: 0 0 5px !important;
  padding: 0 !important;
  line-height: 1.15 !important;
  font-size: 12px !important;
}
#ambientSettingsGroup .ambient-effect-row {
  gap: 3px !important;
  padding: 6px 7px !important;
  margin: 4px 0 !important;
  border-radius: 6px !important;
}
#ambientSettingsGroup .ambient-effect-row > label:first-child {
  min-height: 24px !important;
  font-size: 12px !important;
  justify-content: flex-start !important;
  gap: 7px !important;
}
#ambientSettingsGroup .somata-effect-control {
  margin: 3px 0 5px !important;
  padding: 0 !important;
  gap: 2px !important;
}
#ambientSettingsGroup .somata-effect-control .row-label {
  margin: 0 0 2px !important;
  line-height: 1.15 !important;
  font-size: 11.5px !important;
}
#ambientSettingsGroup .somata-effect-control .row-label .text-mono {
  font-size: 10.5px !important;
}
#ambientSettingsGroup .somata-effect-control .lamp-slider-mult {
  grid-template-columns: minmax(0, 1fr) auto 52px !important;
  gap: 4px !important;
}
#ambientSettingsGroup .somata-effect-control .lamp-slider-mult:not(:has(> .lamp-mult-label)) {
  grid-template-columns: minmax(0, 1fr) !important;
}
#ambientSettingsGroup .somata-effect-control .lamp-slider-mult input[type='number'] {
  width: 52px !important;
  padding: 2px 3px !important;
  font-size: 11px !important;
  height: 25px !important;
}
#ambientSettingsGroup .somata-effect-control input[type='range'] {
  height: 20px !important;
  min-height: 20px !important;
  width: 100% !important;
  max-width: none !important;
}
#ambientSettingsGroup
  .ambient-numeric-control
  .lamp-slider-mult:not(:has(> .lamp-mult-label))
  input[type='number'] {
  width: 100% !important;
  max-width: none !important;
}
#ambientSettingsGroup .ambient-colors {
  gap: 4px !important;
}

#ambientSettingsGroup .ambient-rain-toggle input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  width: 25px;
  height: 14px;
  min-width: 25px;
  margin: 0;
  position: relative;
  cursor: pointer;
  background: #475569;
  border: 1px solid #64748b;
  border-radius: 9px;
  transition: background 0.15s;
}
#ambientSettingsGroup .ambient-rain-toggle input[type='checkbox']::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform 0.15s;
}
#ambientSettingsGroup .ambient-rain-toggle input[type='checkbox']:checked {
  background: #db2777;
  border-color: #f472b6;
}
#ambientSettingsGroup .ambient-rain-toggle input[type='checkbox']:checked::after {
  transform: translateX(11px);
  background: white;
}
#ambientSettingsGroup .ambient-rain-toggle input[type='checkbox']:focus-visible {
  outline: 2px solid #f9a8d4;
  outline-offset: 2px;
}

#ambientSettingsGroup .control-group-title.ambient-heading {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px;
  padding-bottom: 6px !important;
}
#ambientSettingsGroup .ambient-over-lens {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  color: #fbcfe8;
  cursor: pointer;
}
#ambientSettingsGroup .ambient-over-lens input {
  accent-color: #ec4899;
  width: 14px;
  height: 14px;
  margin: 0;
}
#ambientSettingsGroup .ambient-effect-row {
  padding: 6px 8px !important;
  gap: 2px !important;
}
#ambientSettingsGroup .ambient-effect-row .row-label {
  font-size: 11px !important;
}
#ambientSettingsGroup .ambient-vignette-row .lamp-slider-mult {
  width: 100%;
}
#ambientSettingsGroup .ambient-vignette-row input[type='range'] {
  min-width: 0;
}

.lightning-trigger-header {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.lightning-trigger-header .lightning-trigger-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 11px;
  white-space: nowrap;
  min-width: 0;
}
.lightning-trigger-header .lightning-trigger-control select {
  min-width: 112px;
  max-width: 154px;
  font-size: 11px;
  padding: 3px 4px;
}
.lightning-trigger-header .badge {
  margin-left: 0;
}

#testMorphControls {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}
#testMorphControls .control-row {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
#testMorphControls .control-row > label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  justify-items: stretch;
  white-space: normal;
  overflow-wrap: anywhere;
}
#testMorphControls select,
#testMorphControls input[type='number'] {
  box-sizing: border-box;
  display: block;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  margin: 0;
  font-size: 11px;
}
#testMorphSpiralRow select {
  font-size: 10px;
}

#presetChooserPanel,
#morphTypeTopNav,
.somata-removed-menu,
.somata-removed-row,
#gcdNotice,
#fileSettingsBlock > input[hidden] {
  display: none !important;
}

#geometrySettingsGroup > .morph-sidebar-section {
  display: none !important;
}
#geometrySettingsGroup .geometry-n-row {
  width: 100%;
  min-width: 0;
}
#geometrySettingsGroup .geometry-n-heading {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
#geometrySettingsGroup .geometry-n-title {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}
#geometrySettingsGroup .geometry-n-result {
  flex: 0 0 auto;
  margin-left: auto;
  position: relative;
  top: -4px;
  color: #b6c1da;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}
#geometrySettingsGroup .geometry-n-values {
  display: grid;
  grid-template-columns: 42px 8px 61px;
  gap: 4px;
  flex: 0 0 auto;
  align-items: center;
  min-width: 0;
}
#geometrySettingsGroup .geometry-n-values > #numN {
  box-sizing: border-box;
  width: 42px !important;
  min-width: 0 !important;
  height: 27px;
  padding: 2px 3px;
  font-size: 11px;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}
#geometrySettingsGroup .geometry-n-values > #numN::-webkit-inner-spin-button,
#geometrySettingsGroup .geometry-n-values > #numN::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#geometrySettingsGroup .geometry-n-values > .lamp-mult-label {
  min-width: 0;
  width: 8px;
  justify-self: center;
  margin: 0;
  padding: 0;
}
#geometrySettingsGroup .geometry-n-slider-controls {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
}
#geometrySettingsGroup .geometry-n-slider-controls > #paramN {
  width: 100%;
  min-width: 0;
  margin: 0;
}
#geometrySettingsGroup .geometry-n-slider-controls > .geometry-n-step {
  width: 28px;
  min-width: 0;
  height: 28px;
  min-height: 28px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  border-radius: 6px;
}
#geometrySettingsGroup .geometry-n-multiplier-stepper {
  width: 61px;
  min-width: 0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--panel-bg);
}
#geometrySettingsGroup .geometry-n-multiplier-stepper > #paramNMultiplier {
  appearance: textfield;
  -moz-appearance: textfield;
  box-sizing: border-box;
  flex: 1 1 auto;
  width: 40px !important;
  min-width: 0 !important;
  height: 25px;
  margin: 0;
  padding: 2px 1px 2px 3px;
  border: 0;
  border-radius: 0;
  text-align: center;
  font-size: 11px;
}
#geometrySettingsGroup .geometry-n-multiplier-stepper > #paramNMultiplier::-webkit-inner-spin-button,
#geometrySettingsGroup .geometry-n-multiplier-stepper > #paramNMultiplier::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#geometrySettingsGroup .geometry-n-spin-actions {
  display: flex;
  flex: 0 0 17px;
  flex-direction: column;
  min-width: 0;
  border-left: 1px solid var(--border-light);
}
#geometrySettingsGroup .geometry-n-spin-actions button {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  flex: 1 1 50%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: rgba(75, 89, 122, 0.15);
  color: #cbd5e1;
  font: 8px/1 sans-serif;
  cursor: pointer;
}
#geometrySettingsGroup .geometry-n-spin-actions button + button {
  border-top: 1px solid var(--border-light);
}
#geometrySettingsGroup .geometry-n-spin-actions button:hover {
  background: rgba(99, 102, 241, 0.45);
  color: #fff;
}
#geometrySettingsGroup .geometry-n-spin-actions button:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: -2px;
}
@media (max-width: 430px) {
  #geometrySettingsGroup .geometry-n-title {
    font-size: 10px;
  }
  #geometrySettingsGroup .geometry-n-heading {
    gap: 3px;
  }
  #geometrySettingsGroup .geometry-n-values {
    grid-template-columns: 37px 8px 55px;
    gap: 3px;
  }
  #geometrySettingsGroup .geometry-n-values > #numN {
    width: 37px !important;
  }
  #geometrySettingsGroup .geometry-n-multiplier-stepper {
    width: 55px;
  }
  #geometrySettingsGroup .geometry-n-slider-controls {
    grid-template-columns: 27px minmax(0, 1fr) 27px;
    gap: 5px;
  }
  #geometrySettingsGroup .geometry-n-slider-controls > .geometry-n-step {
    width: 27px;
    height: 27px;
    min-height: 27px;
  }
}
#geometrySettingsGroup .geometry-radius-rotation {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  width: 100%;
}
#geometrySettingsGroup .geometry-radius-rotation > .control-row {
  width: 100%;
  min-width: 0;
}
#geometrySettingsGroup .geometry-radius-rotation .lamp-slider-mult {
  width: 100%;
  min-width: 0;
}
#geometrySettingsGroup .geometry-radius-rotation #paramRotation {
  width: 100%;
}

.contour-family-toggle {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 4px;
}
.contour-family-toggle button {
  min-width: 0;
  font-size: 10px;
  white-space: normal;
}
.contour-variant-toggle {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 4px;
}
.rounding-extension-guide {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  font-size: 10px;
}
#btnSidebarMirror {
  font-size: 24px;
  line-height: 1;
  color: #93c5fd;
}
#btnSidebarMirror.active {
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.19);
  box-shadow:
    inset 0 0 0 1px rgba(56, 189, 248, 0.65),
    0 0 12px rgba(14, 165, 233, 0.25);
}
#somataMirrorCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: none;
  z-index: 8;
  transform: translateZ(0);
}

#geometrySettingsGroup #testMorphControls {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  border-radius: 7px;
}
#geometrySettingsGroup #testMorphControls .test-morph-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 55%);
  align-items: center;
  column-gap: 8px;
  min-width: 0;
  min-height: 27px;
  margin: 0 !important;
  padding: 0 !important;
}
#geometrySettingsGroup #testMorphControls .test-morph-row.hidden {
  display: none !important;
}
#geometrySettingsGroup #testMorphControls .test-morph-row > label {
  display: block;
  width: auto;
  min-width: 0;
  padding: 0;
  margin: 0;
  font-size: 10.5px;
  line-height: 1.15;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: normal;
}
#geometrySettingsGroup #testMorphControls .test-morph-row > select,
#geometrySettingsGroup #testMorphControls .test-morph-row input[type='number'] {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 27px;
  min-height: 0;
  margin: 0;
  padding: 2px 23px 2px 7px;
  font-size: 10.5px;
  line-height: 1.1;
}
#geometrySettingsGroup #testMorphControls .test-morph-row > select {
  text-overflow: ellipsis;
}
#geometrySettingsGroup #testMorphControls .test-morph-duration {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}
#geometrySettingsGroup #testMorphControls .test-morph-duration input[type='number'] {
  width: 78px;
  flex: 0 1 78px;
  text-align: center;
  padding: 2px 5px;
}
#geometrySettingsGroup #testMorphControls .test-morph-duration span {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: var(--text-muted);
}
@media (max-width: 360px) {
  #geometrySettingsGroup #testMorphControls .test-morph-row {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 52%);
    column-gap: 4px;
  }
  #geometrySettingsGroup #testMorphControls .test-morph-row > label {
    font-size: 10px;
  }
  #geometrySettingsGroup #testMorphControls .test-morph-row > select {
    font-size: 10px;
  }
}

#geometrySettingsGroup #testMorphControls .test-morph-duration-row #testMorphAutoBadge {
  display: block;
  margin-top: 2px;
  color: #ef4444;
}
#geometrySettingsGroup #testMorphControls .test-morph-duration-row #testMorphAutoBadge.hidden {
  display: none;
}
#geometrySettingsGroup #testMorphControls .test-morph-duration-row {
  grid-template-columns: max-content minmax(45px, 1fr) auto;
  gap: 5px;
}
#geometrySettingsGroup #testMorphControls .test-morph-duration-row .test-morph-duration {
  justify-content: flex-start;
}
#geometrySettingsGroup #testMorphControls .test-morph-duration-row .test-morph-duration input[type='number'] {
  flex: 0 1 60px;
  width: 60px;
  padding: 2px 4px;
}
#geometrySettingsGroup #testMorphControls .test-morph-duration-row .test-morph-sync-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
  font-weight: 400;
  cursor: pointer;
  min-width: 0;
}
#geometrySettingsGroup
  #testMorphControls
  .test-morph-duration-row
  .test-morph-sync-label
  input[type='checkbox'] {
  margin: 0;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  accent-color: #39c7f2;
}
#geometrySettingsGroup #testMorphControls .test-morph-duration-row .test-morph-sync-label span {
  font-size: 10px;
  color: var(--text);
}
#geometrySettingsGroup #testMorphControls .test-morph-duration-row .test-morph-duration input:disabled {
  opacity: 0.6;
  cursor: default;
}
@media (max-width: 380px) {
  #geometrySettingsGroup #testMorphControls .test-morph-duration-row {
    grid-template-columns: max-content minmax(44px, 1fr) auto;
    gap: 3px;
  }
  #geometrySettingsGroup #testMorphControls .test-morph-duration-row .test-morph-sync-label span {
    font-size: 9px;
  }
}

.rounding-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: 7px;
}
.rounding-mode-row #paramRoundingMode {
  display: none !important;
}
.rounding-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  min-width: 178px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 6px;
  padding: 2px;
}
.rounding-mode-btn {
  padding: 4px 6px;
  font: inherit;
  font-size: 10px;
  line-height: 1.2;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  border: 0;
  cursor: pointer;
}
.rounding-mode-btn.active {
  background: #2563eb;
  color: #fff;
}

.morph-spiral-slide-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.morph-spiral-slide-label select {
  max-width: 160px;
}

.morph-spiral-row-primary {
  display: none !important;
}
#morphProfileBindings
  .morph-special-config-row[data-morph-special='spiralLayers']
  .morph-spiral-compact-range {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}
#morphProfileBindings
  .morph-special-config-row[data-morph-special='spiralLayers']
  .morph-spiral-compact-range
  > span:first-child {
  font-size: 10px;
  color: var(--text-muted);
  margin-right: 2px;
}
#morphProfileBindings
  .morph-special-config-row[data-morph-special='spiralLayers']
  .morph-special-config-name {
  flex: 0 0 auto;
}

.lightning-color-row .lightning-color-pair {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.lightning-color-row input[type='color'] {
  width: 42px;
  height: 29px;
  padding: 2px;
  flex: none;
}

.lightning-v922-layout {
  gap: 9px;
}
.lightning-v922-layout .lightning-text-settings {
  display: grid;
  gap: 6px;
  padding: 5px 4px;
}
.lightning-v922-layout .lightning-text-settings .control-row {
  margin: 0;
  min-width: 0;
}
.lightning-v922-layout .lightning-text-settings .control-row > select {
  max-width: 62%;
  min-width: 0;
}
.lightning-v922-layout .lightning-text-settings .control-row > input[type='number'] {
  width: 72px;
  margin-left: auto;
}
.lightning-v922-layout .lightning-slider-block {
  gap: 7px;
}
.lightning-v922-layout .lightning-slider-block .row-inputs {
  min-width: 0;
  width: 100%;
}
.lightning-v922-layout .lightning-slider-block .row-inputs input[type='range'] {
  flex: 1;
  min-width: 0;
}
.lightning-v922-layout .lightning-slider-block .row-inputs input[type='number'] {
  flex: 0 0 58px;
}

.lightning-v924-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lightning-v924-layout .lightning-rate-top {
  padding: 4px 2px 5px;
  border-bottom: 1px solid rgba(147, 197, 253, 0.18);
}
.lightning-v924-layout .lightning-rate-top > .control-row {
  margin: 0;
}
.lightning-v924-layout .lightning-text-settings {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 3px 2px;
}
.lightning-v924-layout .lightning-top-pair,
.lightning-v924-layout .lightning-colors-micro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}
.lightning-v924-layout .lightning-top-pair > label,
.lightning-v924-layout .lightning-colors-micro > label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.lightning-v924-layout .lightning-top-pair select {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  max-width: 100%;
}
.lightning-v924-layout .lightning-color-pair {
  display: flex;
  gap: 6px;
  align-items: center;
}
.lightning-v924-layout .lightning-color-pair input[type='color'] {
  width: 40px;
  min-width: 0;
  height: 29px;
  padding: 2px;
}
.lightning-v924-layout .lightning-micro-compact input[type='number'] {
  width: 76px;
  max-width: 100%;
  height: 29px;
}
.lightning-v924-layout .lightning-duration-top {
  padding: 4px 2px 9px;
  margin: 0;
  border-bottom: 1px solid rgba(147, 197, 253, 0.18);
}
.lightning-v924-layout .lightning-duration-top .row-inputs,
.lightning-v924-layout .lightning-slider-block .row-inputs {
  min-width: 0;
  width: 100%;
}
.lightning-v924-layout .lightning-duration-top input[type='range'],
.lightning-v924-layout .lightning-slider-block input[type='range'] {
  flex: 1;
  min-width: 0;
}
.lightning-v924-layout .lightning-duration-top input[type='number'],
.lightning-v924-layout .lightning-slider-block .row-inputs input[type='number'] {
  flex: 0 0 58px;
}
.lightning-v924-layout .lightning-slider-block {
  gap: 7px;
}

#sweepLightningRateMultiplier,
#sweepLightningDurationMultiplier {
  box-sizing: border-box;
  width: 72px !important;
  min-width: 60px;
  max-width: 80px;
  flex: 0 0 72px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

#morphProfileBindings .morph-route-row[data-morph-special='spiralLayers'],
#morphProfileBindings .morph-route-row[data-morph-special='spiralOrder'] {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 4px 7px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  padding: 5px 8px !important;
  overflow: visible !important;
}
#morphProfileBindings .morph-route-row[data-morph-special='spiralLayers'] > .morph-special-config-name,
#morphProfileBindings .morph-route-row[data-morph-special='spiralOrder'] > .morph-special-config-name {
  flex: 0 0 auto;
  min-width: 130px !important;
  white-space: nowrap !important;
  font-size: 11px !important;
}
#morphProfileBindings .morph-route-row[data-morph-special='spiralLayers'] > .morph-binding-remove,
#morphProfileBindings .morph-route-row[data-morph-special='spiralOrder'] > .morph-binding-remove {
  flex: 0 0 26px !important;
  margin: 0 0 0 auto !important;
}
#morphProfileBindings .morph-spiral-compact-controls {
  display: flex;
  flex: 1 1 390px;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  min-width: 0;
  width: auto;
  overflow: visible;
}
#morphProfileBindings .morph-spiral-compact-controls .morph-spiral-compact-range {
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  gap: 3px !important;
}
#morphProfileBindings .morph-spiral-compact-controls .morph-spiral-compact-range > span:first-child {
  min-width: 0 !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  margin-right: 1px;
  font-size: 10px !important;
}
#morphProfileBindings
  .morph-spiral-compact-controls
  .morph-spiral-compact-range
  > .morph-route-inline-control {
  width: 43px !important;
  min-width: 43px !important;
  max-width: 43px !important;
  flex: 0 0 43px !important;
  padding: 0 !important;
  box-sizing: border-box;
}
#morphProfileBindings .morph-spiral-compact-controls .morph-route-inline-number {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 23px !important;
  font-size: 11px !important;
  padding: 1px 3px !important;
}
#morphProfileBindings .morph-spiral-compact-controls .morph-route-layer-coverage {
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: 0;
}
.lightning-v924-layout .lightning-top-pair > label:only-child {
  grid-column: 1/-1;
}

#morphProfileBindings .morph-route-row[data-morph-special='spiralLayers'] > .morph-spiral-picker,
#morphProfileBindings .morph-route-row[data-morph-special='spiralOrder'] > .morph-spiral-picker {
  flex: 0 1 205px !important;
  min-width: 130px !important;
  max-width: 205px !important;
  width: auto !important;
  margin: 0 !important;
}
#morphProfileBindings
  .morph-route-row[data-morph-special='spiralLayers']
  > .morph-spiral-picker
  .audio-param-picker-button,
#morphProfileBindings
  .morph-route-row[data-morph-special='spiralOrder']
  > .morph-spiral-picker
  .audio-param-picker-button {
  font-size: 9px !important;
  font-weight: 650 !important;
  color: #e2e8f0 !important;
  min-height: 25px;
  height: 25px;
  padding: 2px 6px;
}
#morphProfileBindings .morph-spiral-picker > .audio-param-picker-button {
  cursor: pointer;
}

:is(#morphProfileBindings, #orangeMorphBindings)
  .morph-special-config-row:is(
    [data-morph-special='spiralLayers'],
    [data-morph-special='spiralOrder'],
    [data-orange-special='spiralLayers'],
    [data-orange-special='spiralOrder']
  ) {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 4px 7px !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  overflow: visible !important;
  padding: 5px 8px !important;
  box-sizing: border-box;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-special-config-row .morph-spiral-compact-controls {
  display: flex;
  flex: 1 1 250px;
  flex-wrap: wrap;
  gap: 4px 7px;
  align-items: center;
  min-width: 0;
  width: auto;
  overflow: visible;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-special-config-row .morph-spiral-compact-range {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  max-width: none;
  flex: 0 0 auto;
  white-space: nowrap;
}
:is(#morphProfileBindings, #orangeMorphBindings)
  .morph-special-config-row
  .morph-spiral-compact-range
  .morph-route-inline-number {
  box-sizing: border-box;
  width: 43px !important;
  min-width: 43px !important;
  max-width: 43px !important;
  height: 23px !important;
  padding: 1px 3px !important;
  font-size: 11px !important;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-special-config-row > .morph-binding-remove {
  margin: 0 0 0 auto !important;
  flex: 0 0 26px !important;
}
:is(#morphProfileBindings, #orangeMorphBindings) .morph-special-config-row > .morph-spiral-picker {
  flex: 0 1 205px !important;
  min-width: 130px !important;
  max-width: 205px !important;
  width: auto !important;
}
:is(#morphProfileBindings, #orangeMorphBindings)
  .morph-special-config-row
  > .morph-spiral-picker
  .audio-param-picker-button {
  font-size: 9px !important;
  font-weight: 650 !important;
  color: #e2e8f0 !important;
  min-height: 25px;
  height: 25px;
  padding: 2px 6px;
}

#morphSettingsPanel .morph-routing-shell > #morphFadeDurationRow.morph-fade-live-row {
  width: calc(100% - 12px);
  box-sizing: border-box;
  margin: 0 6px;
  border-radius: 7px;
  background: rgba(8, 145, 178, 0.11);
  border-color: rgba(34, 211, 238, 0.3);
  color: #cffafe;
  flex: 0 0 auto;
}
#morphSettingsPanel .morph-routing-shell > #morphFadeDurationRow.morph-fade-live-row label {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
#morphSettingsPanel
  .morph-routing-shell
  > #morphFadeDurationRow.morph-fade-live-row
  label
  > span:first-child {
  white-space: nowrap;
  font-size: 10px;
}
#morphSettingsPanel .morph-routing-shell > #morphFadeDurationRow.morph-fade-live-row .morph-fade-controls {
  flex: 1;
  width: auto;
  min-width: 0;
  max-width: 470px;
  grid-template-columns: minmax(70px, 1fr) 54px auto;
}
@media (max-width: 520px) {
  #morphSettingsPanel .morph-routing-shell > #morphFadeDurationRow.morph-fade-live-row label {
    flex-wrap: wrap;
  }
  #morphSettingsPanel .morph-routing-shell > #morphFadeDurationRow.morph-fade-live-row .morph-fade-controls {
    width: 100%;
    max-width: none;
  }
}

#morphProfileBindings .morph-route-row.morph-spiral-paused {
  border-color: rgba(71, 85, 105, 0.32);
}
#morphProfileBindings .morph-route-row.morph-spiral-paused .morph-spiral-picker,
#morphProfileBindings .morph-route-row.morph-spiral-paused .morph-spiral-compact-controls {
  opacity: 0.62;
}

.rounding-mode-row #paramRoundingShape {
  display: none !important;
}
.rounding-shape-btn {
  padding: 4px 6px;
  font: inherit;
  font-size: 10px;
  line-height: 1.2;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  border: 0;
  cursor: pointer;
}
.rounding-shape-btn.active {
  background: #0d9488;
  color: #fff;
}

.rounding-mode-row:has(.rounding-shape-btn) .rounding-mode-toggle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 205px;
}

.somata-focus-setting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.somata-focus-setting label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
  color: var(--text-muted);
  font-size: 12px;
}
.somata-focus-setting label span {
  white-space: nowrap;
}
.somata-focus-setting input[type='number'] {
  width: 54px !important;
  min-width: 54px;
  text-align: center;
}
.somata-focus-count {
  flex: 1 1 110px;
  min-width: 85px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.somata-focus-highlight-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.somata-focus-highlight-toggle input {
  accent-color: #22d3ee;
}

#suborbitsContainer.suborbits-routing-target input:disabled,
#suborbitsContainer.suborbits-routing-target button:disabled {
  pointer-events: none;
}
#suborbitsContainer.suborbits-routing-target .row-label > span:first-child {
  cursor: context-menu;
}

.somata-focus-layout,
#tunnelFocusSettings {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.somata-focus-count {
  display: block;
  flex: auto;
  min-height: 14px;
}
.somata-focus-toggles {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 12px;
}
.somata-focus-toggles .somata-focus-highlight-toggle {
  white-space: nowrap;
}
.somata-focus-manual-controls {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 3px 0 5px;
}
.somata-focus-manual-controls.hidden {
  display: none;
}
.somata-focus-manual-controls label {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.somata-focus-manual-controls input[type='range'] {
  width: 100%;
  cursor: pointer;
  accent-color: #22d3ee;
}
.somata-focus-manual-controls output {
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}
.somata-focus-manual-controls label span {
  font-size: 11px;
}

#suborbitsContainer {
  opacity: 1 !important;
}
#suborbitsContainer .row-label {
  width: 100%;
}
#suborbitsContainer .row-inputs > .suborbits-routing-range-host {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
}
#suborbitsContainer .suborbits-routing-range-host > input:disabled {
  pointer-events: none !important;
  opacity: 0.66;
}
#suborbitsContainer input:disabled,
#suborbitsContainer button:disabled {
  opacity: 0.66;
}

#morphProfileBindings .morph-route-row.disabled,
#orangeMorphBindings .morph-route-row.disabled {
  opacity: 0.5;
  filter: grayscale(0.55);
}
#morphProfileBindings .morph-route-row.disabled > input[type='checkbox'],
#orangeMorphBindings .morph-route-row.disabled > input[type='checkbox'] {
  opacity: 1;
  filter: none;
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  html,
  body {
    max-width: 100%;
  }

  body.mobile-parameter-focus {
    touch-action: auto;
  }
  #mobileParameterFocusOverlay.mobile-parameter-focus-active {
    background: linear-gradient(
      to bottom,
      rgba(2, 6, 23, 0.02) 0%,
      rgba(2, 6, 23, 0.03) 60%,
      rgba(2, 6, 23, 0.22) 100%
    ) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .mobile-parameter-focus-dock {
    background: #101a30 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    will-change: auto !important;
    padding: 12px 14px max(14px, env(safe-area-inset-bottom)) !important;
  }
  .mobile-parameter-focus-range-slot .mobile-focus-proxy {
    touch-action: none;
    accent-color: #67e8f9;
  }

  #sidebarToolRail.sidebar-tool-rail {
    position: fixed !important;
    top: calc(50px + env(safe-area-inset-top)) !important;
    left: max(4px, env(safe-area-inset-left)) !important;
    right: max(4px, env(safe-area-inset-right)) !important;
    bottom: auto !important;
    width: auto !important;
    height: 52px !important;
    max-height: 52px !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    padding: 4px 7px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
    border-radius: 10px !important;
    z-index: 245 !important;
    box-sizing: border-box !important;
  }
  #sidebarToolRail::-webkit-scrollbar {
    display: none;
  }
  #sidebarToolRail .sidebar-tool-btn {
    flex: 0 0 42px !important;
    width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 6px !important;
    touch-action: manipulation !important;
  }
  #sidebarToolRail .sidebar-tool-separator {
    flex: 0 0 1px !important;
    width: 1px !important;
    height: 26px !important;
    margin: 0 3px !important;
  }

  aside#settingsSidebar {
    position: fixed !important;
    top: calc(107px + env(safe-area-inset-top)) !important;
    bottom: max(4px, env(safe-area-inset-bottom)) !important;
    left: max(4px, env(safe-area-inset-left)) !important;
    right: max(4px, env(safe-area-inset-right)) !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 12px 12px 0 0;
  }
  #settingsSidebar > .section-header {
    position: relative !important;
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: center !important;
    gap: 5px 7px !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 7px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }
  #settingsSidebar .sidebar-section-title {
    flex: 1 1 74px !important;
    min-width: 50px !important;
    max-width: none !important;
    font-size: 12px !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  #settingsSidebar .master-layer-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 5px 7px !important;
  }
  #settingsSidebar .sidebar-layer-actions {
    display: flex !important;
    flex: 1 1 100% !important;
    order: 5;
    flex-flow: row wrap !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  #settingsSidebar .sidebar-layer-actions .btn-icon,
  #settingsSidebar #btnToggleLayerList,
  #settingsSidebar #btnMobileCloseSidebar {
    display: inline-flex !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 4px !important;
    position: static !important;
  }
  #settingsSidebar #btnMobileCloseSidebar {
    margin-left: 0 !important;
  }
  #settingsSidebar #layerCountBadge {
    min-width: 25px !important;
    max-width: none !important;
    flex: 0 0 auto !important;
  }
  #settingsSidebar #layerList {
    width: 100% !important;
    min-width: 0 !important;
    max-height: min(22dvh, 130px) !important;
    flex: 0 1 auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  #settingsSidebar .sidebar-content {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    padding: 9px 9px calc(26px + env(safe-area-inset-bottom)) !important;
    scrollbar-gutter: stable;
    box-sizing: border-box !important;
  }
  #settingsSidebar .control-group,
  #settingsSidebar .control-row,
  #settingsSidebar .row-inputs,
  #settingsSidebar .grid-2,
  #settingsSidebar .profile-canvas-container {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  #settingsSidebar .control-group {
    width: 100% !important;
  }
  #settingsSidebar .row-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }
  #settingsSidebar .row-inputs > input[type='range'] {
    flex: 1 1 110px;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #settingsSidebar :is(select, input[type='number'], input[type='text'], input[type='range'], textarea) {
    max-width: 100% !important;
  }
  #settingsSidebar :is(.graffiti-range-with-multiplier, .graffiti-rotation-strength, .motion-slider-mult) {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #settingsSidebar .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #morphSettingsPanel.morph-audio-routing-panel {
    position: fixed !important;
    top: max(4px, env(safe-area-inset-top)) !important;
    bottom: max(4px, env(safe-area-inset-bottom)) !important;
    left: max(4px, env(safe-area-inset-left)) !important;
    right: max(4px, env(safe-area-inset-right)) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    box-sizing: border-box !important;
    z-index: 270 !important;
  }
  #morphSettingsPanel .morph-settings-title,
  #randomSettingsPanel .morph-settings-title {
    position: relative !important;
    top: auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    gap: 6px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
  }
  #morphSettingsPanel .morph-settings-title > span:first-child,
  #randomSettingsPanel .morph-settings-title > span:first-child {
    flex: 1 1 auto;
    min-width: 0;
  }
  #morphSettingsPanel .morph-settings-subtitle,
  #randomSettingsPanel .morph-settings-subtitle {
    display: none !important;
  }
  #morphSettingsPanel .mobile-panel-close,
  #randomSettingsPanel .mobile-panel-close {
    position: static !important;
    top: auto !important;
    right: auto !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 0 0 auto !important;
  }
  #morphSettingsPanel .morph-routing-layout {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  #morphSettingsPanel .morph-routing-targets {
    display: flex !important;
    align-items: stretch !important;
    flex-flow: row nowrap !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: 64px !important;
    gap: 5px !important;
    padding: 7px 9px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    border-right: 0 !important;
    border-bottom: 1px solid rgba(71, 85, 105, 0.58);
  }
  #morphSettingsPanel .morph-routing-targets::-webkit-scrollbar {
    display: none;
  }
  #morphSettingsPanel .morph-routing-targets > * {
    flex: 0 0 auto !important;
    min-width: 42px !important;
    min-height: 44px !important;
    max-width: min(48vw, 175px) !important;
    width: auto !important;
    padding: 7px 9px !important;
    white-space: nowrap;
  }
  #morphSettingsPanel .morph-routing-main {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    box-sizing: border-box !important;
  }
  #morphSettingsPanel
    :is(
      .morph-profile-toolbar,
      .morph-routing-preset-bar,
      .morph-speed-toolbar,
      .morph-routing-shell,
      .morph-routing-groups,
      .morph-routing-head,
      .morph-routing-tools-meta
    ) {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  #morphSettingsPanel .morph-profile-toolbar,
  #morphSettingsPanel .morph-profile-toolbar.morph-routing-preset-bar {
    display: flex !important;
    flex-flow: row wrap !important;
    gap: 7px !important;
    padding: 8px !important;
    margin: 0 0 8px !important;
    overflow: visible !important;
  }
  #morphSettingsPanel .morph-profile-select-wrap {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-wrap: wrap;
  }
  #morphSettingsPanel .morph-profile-select-wrap select {
    flex: 1 1 140px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    font-size: 16px !important;
  }
  #morphSettingsPanel .morph-profile-toolbar-flags {
    display: flex !important;
    flex: 1 1 100% !important;
    flex-wrap: wrap !important;
    margin-left: 0 !important;
    gap: 6px !important;
  }
  #morphSettingsPanel .morph-profile-toolbar-check {
    min-height: 40px !important;
    height: auto !important;
    font-size: 12px !important;
  }
  #morphSettingsPanel .morph-profile-action {
    flex: 0 0 auto !important;
    min-width: 42px !important;
    min-height: 42px !important;
    height: auto !important;
    font-size: 13px !important;
  }
  #morphSettingsPanel .morph-profile-reset {
    flex: 1 1 110px !important;
  }
  #morphSettingsPanel .morph-speed-toolbar {
    overflow: visible !important;
  }
  #morphSettingsPanel .morph-top-cycle-row {
    flex-wrap: wrap !important;
    align-items: center !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #morphSettingsPanel .morph-top-cycle-row > .morph-cycle-controls {
    display: flex !important;
    flex-flow: row wrap !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    justify-content: flex-start !important;
    white-space: normal !important;
    gap: 6px !important;
  }
  #morphSettingsPanel .morph-cycle-controls .morph-quick-btn {
    min-width: 42px !important;
    min-height: 38px !important;
    height: 38px !important;
    flex: 0 0 auto !important;
  }
  #morphSettingsPanel .morph-speed-toolbar-field {
    min-width: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-flow: row wrap !important;
    gap: 6px !important;
  }
  #morphSettingsPanel .morph-speed-toolbar-field select {
    flex: 1 1 130px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 42px !important;
    font-size: 16px !important;
  }
  #morphSettingsPanel .morph-compact-profile-controls {
    display: flex !important;
    flex-flow: row wrap !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 6px !important;
  }
  #morphSettingsPanel .morph-compact-profile-field {
    flex: 1 1 135px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 42px !important;
    height: auto !important;
    flex-wrap: wrap !important;
  }
  #morphSettingsPanel .morph-compact-profile-field select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 40px !important;
    height: auto !important;
    font-size: 16px !important;
  }
  #morphSettingsPanel .morph-routing-visible-head,
  #morphSettingsPanel .morph-routing-head {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    height: auto !important;
    gap: 7px !important;
  }
  #morphSettingsPanel .morph-routing-groups,
  #randomSettingsPanel .orange-routing-groups {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  #morphSettingsPanel .morph-routing-groups .audio-route-group-btn,
  #randomSettingsPanel .orange-routing-groups .audio-route-group-btn {
    display: flex !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 7px !important;
    white-space: normal !important;
    font-size: 12px !important;
    overflow-wrap: anywhere;
  }
  #morphSettingsPanel .morph-routing-tools-meta {
    flex-wrap: wrap;
    white-space: normal;
  }
  #morphSettingsPanel #btnAddMorphParameter {
    width: 100% !important;
    min-height: 44px !important;
    font-size: 13px !important;
  }
  #morphSettingsPanel #morphParameterPicker {
    width: min(92vw, 360px) !important;
    max-height: 70dvh !important;
  }
  #morphSettingsPanel #morphProfileBindings {
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #morphProfileBindings .morph-route-row,
  #orangeMorphBindings .orange-route-row,
  #morphProfileBindings .morph-route-row[data-morph-special='spiralLayers'],
  #morphProfileBindings .morph-route-row[data-morph-special='spiralOrder'] {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    padding: 10px !important;
    gap: 8px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
  }
  #morphProfileBindings .morph-route-row > *,
  #orangeMorphBindings .orange-route-row > * {
    max-width: 100% !important;
    box-sizing: border-box;
  }
  #morphProfileBindings .morph-route-compact-picker,
  #orangeMorphBindings .morph-route-compact-picker {
    flex: 1 1 120px !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
  }
  #morphProfileBindings .morph-route-compact-picker .audio-param-picker-button,
  #orangeMorphBindings .morph-route-compact-picker .audio-param-picker-button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    height: auto !important;
    font-size: 13px !important;
    text-align: left;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  #morphProfileBindings .morph-route-drag-handle,
  #orangeMorphBindings .morph-route-drag-handle {
    flex: 0 0 16px !important;
  }
  #morphProfileBindings .morph-route-row > input[type='checkbox'],
  #orangeMorphBindings .orange-route-row > input[type='checkbox'] {
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
  }
  #morphProfileBindings .morph-route-row-icon,
  #orangeMorphBindings .morph-route-row-icon {
    width: 20px !important;
    flex: 0 0 20px !important;
  }
  #morphProfileBindings .morph-route-number,
  #orangeMorphBindings .morph-route-number {
    width: clamp(55px, 23%, 90px) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 66px !important;
    min-height: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }
  #morphProfileBindings .morph-route-inline-control,
  #morphProfileBindings .morph-route-inline-check,
  #orangeMorphBindings .morph-route-inline-control,
  #orangeMorphBindings .morph-route-inline-check {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 40px !important;
    white-space: normal !important;
    padding: 5px 7px !important;
    font-size: 12px !important;
    gap: 6px !important;
  }
  #morphProfileBindings .morph-route-inline-control > span,
  #orangeMorphBindings .morph-route-inline-control > span {
    font-size: 12px !important;
  }
  #morphProfileBindings .morph-route-inline-number,
  #orangeMorphBindings .morph-route-inline-number {
    width: 66px !important;
    max-width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    font-size: 16px !important;
  }
  #morphProfileBindings .morph-route-inline-select select,
  #orangeMorphBindings .morph-route-inline-select select,
  #morphProfileBindings .morph-route-palette-select select,
  #orangeMorphBindings .morph-route-palette-select select {
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    height: auto !important;
    font-size: 16px !important;
  }
  #morphProfileBindings .morph-special-config-name,
  #orangeMorphBindings .morph-special-config-name {
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 120px !important;
    font-size: 12px !important;
    white-space: normal !important;
  }
  #morphProfileBindings .morph-special-config-range,
  #orangeMorphBindings .morph-special-config-range,
  #morphProfileBindings .morph-spiral-compact-controls,
  #orangeMorphBindings .morph-spiral-compact-controls {
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    flex-wrap: wrap !important;
  }
  #morphProfileBindings .morph-binding-remove,
  #orangeMorphBindings .morph-binding-remove {
    flex: 0 0 42px !important;
    width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 0 0 auto !important;
    order: 99 !important;
    font-size: 20px !important;
  }

  #randomSettingsPanel.random-settings-panel {
    position: fixed !important;
    top: max(4px, env(safe-area-inset-top)) !important;
    bottom: max(4px, env(safe-area-inset-bottom)) !important;
    left: max(4px, env(safe-area-inset-left)) !important;
    right: max(4px, env(safe-area-inset-right)) !important;
    display: flex;
    flex-direction: column;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    border-radius: 12px !important;
    z-index: 265 !important;
  }
  #randomSettingsPanel .orange-profile-toolbar {
    display: flex !important;
    flex-flow: row wrap !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 8px !important;
    padding: 8px !important;
    gap: 7px !important;
    overflow: visible !important;
  }
  #randomSettingsPanel .orange-profile-toolbar .morph-profile-select-wrap {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  #randomSettingsPanel .orange-profile-toolbar select {
    flex: 1 1 130px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 42px !important;
    font-size: 16px !important;
  }
  #randomSettingsPanel .orange-profile-toolbar .morph-profile-action {
    min-width: 42px !important;
    min-height: 42px !important;
  }
  #randomSettingsPanel .orange-routing-shell,
  #randomSettingsPanel .orange-fixed-settings {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #randomSettingsPanel .orange-fixed-settings {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    margin: 0 8px 8px !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #randomSettingsPanel .orange-fixed-settings > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #randomSettingsPanel .orange-routing-shell {
    margin: 8px !important;
    padding: 8px !important;
  }
  #randomSettingsPanel .orange-route-row {
    min-width: 0 !important;
  }
  #randomSettingsPanel .orange-routing-head .hint-text {
    display: none !important;
  }
  #randomSettingsPanel .orange-routing-rows {
    min-width: 0 !important;
    max-width: 100% !important;
  }
}
@media (max-width: 360px) {
  #settingsSidebar .grid-2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #settingsSidebar .sidebar-section-title {
    flex: 1 1 52px !important;
  }
  #morphSettingsPanel .morph-profile-action,
  #randomSettingsPanel .morph-profile-action {
    min-width: 40px !important;
  }
}
@media (max-height: 520px) and (hover: none) and (pointer: coarse) {
  #sidebarToolRail.sidebar-tool-rail {
    top: calc(44px + env(safe-area-inset-top)) !important;
  }
  aside#settingsSidebar {
    top: calc(101px + env(safe-area-inset-top)) !important;
  }
  #morphSettingsPanel .morph-routing-targets {
    max-height: 56px !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  body.mobile-parameter-focus
    :is(
      header,
      #settingsSidebar,
      #sidebarToolRail,
      #mobileSidebarBackdrop,
      #btnMobileControls,
      #morphSettingsPanel,
      #randomSettingsPanel,
      #tunnelSettingsPanel,
      #tapSettingsPanel,
      #audioReactivePanel,
      #audioRoutingPanel,
      .floating-controls,
      .info-pill
    ) {
    visibility: hidden !important;
    pointer-events: none !important;
  }
  body:has(#morphSettingsPanel:not(.hidden)) #btnMobileControls,
  body:has(#randomSettingsPanel:not(.hidden)) #btnMobileControls {
    display: none !important;
  }
  .mobile-parameter-focus-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 38px;
    gap: 9px;
    align-items: center;
    margin-bottom: 11px;
    min-width: 0;
  }
  .mobile-parameter-focus-head .mobile-parameter-focus-title {
    margin: 0 !important;
    text-align: left !important;
    font-size: 13px !important;
  }
  .mobile-parameter-focus-value {
    font:
      700 15px/1.1 ui-monospace,
      monospace;
    color: #67e8f9;
    min-width: 30px;
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
  }
  .mobile-parameter-focus-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    font-size: 22px !important;
    border-radius: 8px !important;
  }
  .mobile-parameter-focus-multiplier input[type='number'] {
    width: 88px !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    text-align: center !important;
    font-size: 16px !important;
  }
  .mobile-parameter-focus-controls {
    min-width: 0 !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  body:has(#morphSettingsPanel:not(.hidden)) .floating-controls,
  body:has(#randomSettingsPanel:not(.hidden)) .floating-controls,
  body:has(#settingsSidebar.mobile-open) .floating-controls {
    visibility: hidden !important;
    pointer-events: none !important;
  }

  #morphProfileBindings .morph-route-row > .morph-binding-remove,
  #orangeMorphBindings .orange-route-row > .morph-binding-remove {
    order: 1 !important;
  }
  #morphProfileBindings .morph-route-row > .morph-route-number,
  #orangeMorphBindings .orange-route-row > .morph-route-number {
    order: 2 !important;
    flex: 1 1 calc((100% - 34px) / 2) !important;
    width: calc((100% - 34px) / 2) !important;
    min-width: 0 !important;
    max-width: calc((100% - 34px) / 2) !important;
    text-align: center !important;
  }
  #morphProfileBindings .morph-route-row > .morph-route-range-sep,
  #orangeMorphBindings .orange-route-row > .morph-route-range-sep {
    order: 2 !important;
    flex: 0 0 16px !important;
    width: 16px !important;
    text-align: center !important;
  }
  #morphProfileBindings .morph-route-row > .morph-route-inline-control,
  #orangeMorphBindings .orange-route-row > .morph-route-inline-control {
    order: 3 !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  header .header-actions {
    padding: 0 0 3px 52px !important;
    scroll-padding-inline-start: 52px;
    box-sizing: border-box !important;
  }
  header #projectChooserPanel #btnQuickNewProject {
    position: relative !important;
    flex: 0 0 44px !important;
    visibility: visible !important;
  }

  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row {
    padding: 8px !important;
    gap: 5px 6px !important;
    align-content: start !important;
    align-items: center !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-route-drag-handle {
    flex: 0 0 12px !important;
    width: 12px !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-route-row-icon {
    flex: 0 0 16px !important;
    width: 16px !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings)
    .morph-route-row
    > :is(.morph-route-compact-picker, .morph-special-config-name, .morph-spiral-picker) {
    flex: 1 1 84px !important;
    width: auto !important;
    min-width: 65px !important;
    max-width: none !important;
    margin: 0 !important;
    order: 0 !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-binding-remove,
  :is(#morphProfileBindings, #orangeMorphBindings)
    .morph-route-row
    > .morph-route-always-on-multiplier
    ~ .morph-binding-remove,
  :is(#morphProfileBindings, #orangeMorphBindings)
    .morph-route-row
    > .morph-route-multiplier
    ~ .morph-binding-remove {
    flex: 0 0 36px !important;
    order: 0 !important;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    margin: 0 0 0 auto !important;
    padding: 4px !important;
    font-size: 18px !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings)
    .morph-route-row
    > :is(.morph-route-compact-picker, .morph-special-config-name)
    :is(.audio-param-picker-button, select) {
    min-height: 34px !important;
    height: 34px !important;
    font-size: 12px !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-route-inline-control,
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-route-inline-check {
    min-height: 32px !important;
    padding: 3px 6px !important;
    font-size: 11px !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-route-inline-select {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-route-inline-select select {
    min-height: 36px !important;
    height: 36px !important;
    width: auto !important;
    max-width: 100% !important;
    font-size: 15px !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-route-layer-coverage {
    flex: 0 0 auto !important;
    min-height: 32px !important;
    height: 32px !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 3px 6px !important;
    justify-content: flex-start !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-profile-group-dropdown {
    flex: 0 1 235px !important;
    width: min(100%, 235px) !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-special-config-range {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 34px !important;
    flex-wrap: wrap !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-route-number {
    flex: 0 1 78px !important;
    width: 78px !important;
    max-width: calc((100% - 22px) / 2) !important;
    min-width: 0 !important;
    height: 34px !important;
    min-height: 34px !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-route-range-sep {
    flex: 0 0 14px !important;
    width: 14px !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > .morph-route-inline-number {
    height: 34px !important;
    min-height: 34px !important;
  }
}

@media (min-width: 600px) and (max-width: 760px) {
  #morphSettingsPanel #morphProfileBindings,
  #randomSettingsPanel #orangeMorphBindings {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: start !important;
    gap: 8px !important;
  }
  #morphSettingsPanel #morphProfileBindings > .morph-route-row,
  #randomSettingsPanel #orangeMorphBindings > .orange-route-row {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > * {
    order: 2 !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings)
    .morph-route-row
    > :is(
      .morph-route-drag-handle,
      .morph-route-row-icon,
      .morph-route-compact-picker,
      .morph-special-config-name,
      .morph-spiral-picker,
      .morph-binding-remove
    ),
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row > input[type='checkbox'],
  :is(#morphProfileBindings, #orangeMorphBindings)
    .morph-route-row
    > .morph-route-always-on-multiplier
    ~ .morph-binding-remove,
  :is(#morphProfileBindings, #orangeMorphBindings)
    .morph-route-row
    > .morph-route-multiplier
    ~ .morph-binding-remove {
    order: 0 !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings) .morph-route-row::before {
    content: '';
    order: 1;
    flex: 0 0 100%;
    height: 0;
    margin: 0;
    padding: 0;
  }
  :is(#morphProfileBindings, #orangeMorphBindings)
    .morph-route-row:is(
      [data-morph-special='shape'],
      [data-morph-special='orbits'],
      [data-orange-special='shape'],
      [data-orange-special='orbits']
    )
    > .morph-special-config-name {
    flex: 1 1 70px !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
  }
  :is(#morphProfileBindings, #orangeMorphBindings)
    .morph-route-row
    > .morph-route-compact-picker
    .audio-param-picker-button {
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
  }
}

@media (max-width: 360px) {
  #morphSettingsPanel .morph-settings-title {
    flex-wrap: nowrap !important;
    gap: 4px !important;
    padding: 6px !important;
    min-height: 48px !important;
  }
  #morphSettingsPanel .morph-settings-title > span:first-child {
    flex: 1 1 105px !important;
    min-width: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px !important;
  }
  #morphSettingsPanel .morph-settings-title .morph-header-master {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    padding: 5px 7px !important;
  }
  #morphSettingsPanel .morph-settings-title .mobile-panel-close {
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    margin-left: 0 !important;
  }
}
@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  header #projectChooserPanel #btnQuickNewProject {
    color: #d9faff !important;
    background: rgba(8, 145, 178, 0.24) !important;
    border-color: rgba(34, 211, 238, 0.68) !important;
  }
  header #projectChooserPanel #btnQuickNewProject svg {
    width: 18px !important;
    height: 18px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2.1 !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  aside#settingsSidebar:not(.mobile-open) {
    opacity: 0 !important;
    pointer-events: none !important;
  }
  aside#settingsSidebar.mobile-open {
    opacity: 1 !important;
  }
  #sidebarToolRail:not(.mobile-open):not(.mobile-rail-open) {
    opacity: 0 !important;
    pointer-events: none !important;
  }
  body.mobile-parameter-focus
    :is(
      header,
      #settingsSidebar,
      #sidebarToolRail,
      #mobileSidebarBackdrop,
      #btnMobileControls,
      #morphSettingsPanel,
      #randomSettingsPanel,
      #tunnelSettingsPanel,
      #tapSettingsPanel,
      #audioReactivePanel,
      #audioRoutingPanel,
      .floating-controls,
      .info-pill,
      #fpsCounter
    ) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.mobile-parameter-focus
    :is(.standard-slider-value-bubble, .morph-slider-value-bubble, .parameter-routing-context-menu) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  .mobile-parameter-focus-dock {
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    padding: 9px 10px max(10px, env(safe-area-inset-bottom)) !important;
    border-radius: 12px !important;
  }
  .mobile-parameter-focus-head {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-width: 0 !important;
    margin-bottom: 7px !important;
  }
  .mobile-parameter-focus-head .mobile-parameter-focus-title {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    line-height: 1.25 !important;
    font-size: 13px !important;
    text-align: left !important;
  }
  .mobile-parameter-focus-value {
    flex: 0 1 auto !important;
    min-width: 20px !important;
    max-width: 55px !important;
    text-align: right !important;
    font-size: 14px !important;
    white-space: nowrap;
  }
  .mobile-parameter-focus-head .mobile-parameter-focus-multiplier {
    display: flex;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: 95px !important;
    gap: 4px !important;
    margin: 0 !important;
    justify-content: flex-end !important;
  }
  .mobile-parameter-focus-multiplier.hidden {
    display: none !important;
  }
  .mobile-parameter-focus-head .mobile-parameter-focus-multiplier > span:first-child {
    font-size: 12px !important;
  }
  #mobileParameterMultiplierSlot {
    display: flex;
    min-width: 0;
    max-width: 76px;
  }
  .mobile-parameter-focus-head .mobile-parameter-focus-multiplier input[type='number'] {
    box-sizing: border-box !important;
    width: 64px !important;
    min-width: 0 !important;
    max-width: 76px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 4px 5px !important;
    font-size: 15px !important;
    text-align: center !important;
  }
  .mobile-parameter-focus-close {
    flex: 0 0 36px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    margin: 0 !important;
  }
  .mobile-parameter-focus-controls {
    grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    gap: 7px !important;
    min-width: 0 !important;
  }
  .mobile-parameter-focus-step {
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }
  .mobile-parameter-focus-range-slot,
  .mobile-parameter-focus-range-slot > input[type='range'] {
    min-height: 44px !important;
    height: 44px !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  #settingsSidebar:not(.mobile-layers-collapsed) #layerList {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    max-height: min(42dvh, 320px) !important;
    height: auto !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }
  #settingsSidebar #layerList .layer-item {
    flex: 0 0 auto !important;
  }
  #settingsSidebar .sidebar-content {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
  #settingsSidebar #btnToggleLayerList[aria-expanded='true'] {
    color: #a5f3fc !important;
    border-color: rgba(34, 211, 238, 0.72) !important;
    background: rgba(8, 145, 178, 0.14) !important;
  }

  body.mobile-parameter-focus #settingsSidebar,
  body.mobile-parameter-focus #sidebarToolRail,
  body.mobile-parameter-focus #mobileSidebarBackdrop,
  body.mobile-parameter-focus .floating-controls,
  body.mobile-parameter-focus #btnMobileControls {
    display: none !important;
  }
  body.mobile-parameter-focus #btnQuickNewProject {
    display: none !important;
  }
  body.mobile-parameter-focus input[type='range'] {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  body.mobile-parameter-focus #mobileParameterFocusOverlay input[type='range'] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.mobile-parameter-focus .mobile-parameter-focus-dock {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  #mobileParameterFocusOverlay .mobile-parameter-focus-head {
    gap: 5px !important;
  }
  #mobileParameterFocusOverlay .mobile-parameter-focus-head .mobile-parameter-focus-title {
    flex: 1 1 40px !important;
    text-align: left !important;
  }
  #mobileParameterRouting.mobile-parameter-focus-routing {
    display: flex !important;
    flex: 0 0 32px !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 36px !important;
    min-width: 32px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border-radius: 9px;
    border: 1px solid rgba(56, 189, 248, 0.55);
    background: rgba(14, 116, 144, 0.2);
    color: #67e8f9;
    font-size: 19px;
    font-weight: 700;
    touch-action: manipulation;
  }
  #mobileParameterRouting.hidden {
    display: none !important;
  }
  #mobileParameterFocusOverlay .mobile-parameter-focus-value.hidden,
  #mobileParameterFocusOverlay .mobile-parameter-focus-controls.hidden,
  #mobileParameterWidgetSlot.hidden,
  #mobileParameterProfileSlot.hidden {
    display: none !important;
  }
  #mobileParameterFocusOverlay .mobile-parameter-profile-slot,
  #mobileParameterFocusOverlay .mobile-parameter-widget-slot {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-height: min(64dvh, 570px);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  #mobileParameterFocusOverlay .mobile-parameter-focus-dock:has(.mobile-parameter-profile-slot:not(.hidden)) {
    max-height: calc(100dvh - env(safe-area-inset-top) - 24px);
    display: flex;
    flex-direction: column;
  }
  #mobileParameterProfileSlot #profileSettingsGroup {
    display: flex !important;
    flex-direction: column;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  #mobileParameterProfileSlot .control-group-title {
    margin: 0 0 5px !important;
  }
  #mobileParameterProfileSlot #profileCanvas {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 140px;
    aspect-ratio: 340 / 160;
    touch-action: none !important;
  }
  #mobileParameterProfileSlot .profile-canvas-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  #mobileParameterProfileSlot .profile-library-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
  }
  #mobileParameterProfileSlot .profile-library-tab {
    font-size: 11px !important;
    min-height: 30px;
  }
  #mobileParameterProfileSlot :is(button, select, input) {
    touch-action: manipulation;
  }
  #mobileParameterProfileSlot input[type='range'],
  #mobileParameterWidgetSlot input[type='range'] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  #mobileParameterWidgetSlot .mobile-focus-widget-copy {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 6px 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  #mobileParameterWidgetSlot .mobile-focus-widget-copy :is(select, input, button) {
    max-width: 100% !important;
    min-width: 0;
  }
  #mobileParameterWidgetSlot .mobile-focus-widget-copy label {
    max-width: 100%;
  }

  body.mobile-parameter-focus #parameterRoutingContextMenu:not(.hidden) {
    z-index: 2147483002 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  #settingsSidebar :is(.row-label, .control-group-title, label > span:first-child) {
    -webkit-touch-callout: none;
  }
}

@media (max-width: 760px), (max-height: 480px) and (hover: none) and (pointer: coarse) {
  #mobileParameterFocusOverlay .mobile-parameter-focus-dock:has(#mobileParameterProfileSlot:not(.hidden)) {
    width: auto !important;
    height: auto !important;
    max-height: min(42dvh, 340px) !important;
    padding: 8px 10px max(9px, env(safe-area-inset-bottom)) !important;
    overflow: visible !important;
  }
  #mobileParameterFocusOverlay
    .mobile-parameter-focus-dock:has(#mobileParameterProfileSlot:not(.hidden))
    .mobile-parameter-focus-head {
    margin-bottom: 4px !important;
  }
  #mobileParameterFocusOverlay .mobile-parameter-profile-slot {
    max-height: none !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
  }
  #mobileParameterProfileSlot #profileSettingsGroup {
    gap: 4px !important;
    padding: 0 !important;
  }

  #mobileParameterProfileSlot #profileSettingsGroup > .control-group-title {
    display: none !important;
  }
  #mobileParameterProfileSlot #profileSettingsGroup > .control-row {
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    overflow: visible !important;
  }
  #mobileParameterProfileSlot .mobile-profile-toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    margin: 0 0 3px;
    min-width: 0;
  }
  #mobileParameterProfileSlot .mobile-profile-library-toggle {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    height: 32px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #152740;
    border: 1px solid rgba(56, 189, 248, 0.5);
    border-radius: 7px;
    padding: 4px 9px;
    font-size: 12px;
    color: #bdeaff;
  }
  #mobileParameterProfileSlot #btnResetProfile {
    height: 32px !important;
    min-height: 32px !important;
    padding: 3px 10px !important;
    font-size: 11px !important;
  }
  #mobileParameterProfileSlot .profile-library-tabs {
    display: none !important;
    position: absolute !important;
    z-index: 50 !important;
    top: 34px;
    left: 0;
    right: 0;
    width: 100% !important;
    max-height: min(49dvh, 260px);
    overflow-y: auto;
    grid-template-columns: 1fr !important;
    gap: 3px !important;
    padding: 5px !important;
    margin: 0 !important;
    border: 1px solid rgba(56, 189, 248, 0.55);
    border-radius: 8px;
    background: #101d32;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
  }
  #mobileParameterProfileSlot .profile-library-tabs.mobile-profile-groups-open {
    display: grid !important;
  }
  #mobileParameterProfileSlot .profile-library-tab {
    display: flex !important;
    justify-content: flex-start !important;
    min-height: 35px !important;
    text-align: left !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    gap: 8px !important;
  }
  #mobileParameterProfileSlot .profile-library-tab input[type='checkbox'] {
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;
  }
  #mobileParameterProfileSlot .profile-preset-row {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) 34px !important;
    gap: 4px !important;
    margin: 0 !important;
  }
  #mobileParameterProfileSlot .profile-preset-row :is(select, button) {
    height: 34px !important;
    min-height: 34px !important;
    padding: 3px 5px !important;
    box-sizing: border-box !important;
    font-size: 12px !important;
  }
  #mobileParameterProfileSlot .profile-family-legend {
    display: none !important;
  }
  #mobileParameterProfileSlot .btn-group-toggle:has(.profile-mode-btn) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 3px !important;
    padding: 2px !important;
    margin: 0 !important;
    width: 100% !important;
    min-height: 36px !important;
  }
  #mobileParameterProfileSlot .profile-mode-btn {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 34px !important;
    height: 34px !important;
    padding: 4px 1px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }
  #mobileParameterProfileSlot .profile-canvas-container {
    margin: 0 !important;
  }
  #mobileParameterProfileSlot .mobile-profile-extras {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 1px solid rgba(71, 85, 105, 0.65);
    border-radius: 7px;
    background: rgba(12, 22, 40, 0.65);
  }
  #mobileParameterProfileSlot .mobile-profile-extras > summary {
    list-style: revert;
    cursor: pointer;
    box-sizing: border-box;
    padding: 6px 10px;
    font-size: 11px;
    min-height: 27px;
    color: #a6c5dd;
    touch-action: manipulation;
  }
  #mobileParameterProfileSlot .mobile-profile-extras > :not(summary) {
    margin-left: 5px !important;
    margin-right: 5px !important;
  }
  #mobileParameterProfileSlot #profileCanvas {
    min-height: 118px !important;
    height: 118px !important;
    aspect-ratio: auto !important;
    touch-action: none !important;
  }

  #mobileParameterFocusOverlay.mobile-profile-drag-peek .mobile-parameter-focus-dock {
    opacity: 0.2 !important;
    transition: opacity 0.12s linear !important;
  }
}

@media (pointer: coarse) {
  input[type='number'].somata-scrubbable-number {
    touch-action: none;
  }
}
input[type='number'].somata-number-is-scrubbing {
  outline: 2px solid var(--accent, #38bdf8);
  outline-offset: 1px;
  user-select: none;
}

.line-outline-head label.parameter-routing-capable {
  padding: 4px 6px;
  border-radius: 6px;
  min-height: 24px;
}
.line-outline-modes.parameter-routing-capable {
  padding: 5px;
  border-radius: 7px;
}
.line-outline-control .generic-morph-range-host {
  min-width: 0;
  width: 100%;
  display: grid;
}
.line-outline-control .generic-morph-range-host.parameter-routing-capable {
  min-width: 0;
}
.line-outline-head input[type='color'].parameter-routing-capable {
  border: 1px solid var(--routing-border) !important;
  border-radius: 5px;
  box-shadow: 0 0 0 1px var(--routing-border) !important;
}

#lineOutlineAuraSpeedRow[hidden],
#lineOutlineAuraSpanRow[hidden] {
  display: none !important;
}
#lineOutlineAuraSpeedRow,
#lineOutlineAuraSpanRow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
}
#paramLineOutlineStyle {
  width: 100%;
  max-width: 100%;
}

.line-outline-modes[hidden] {
  display: none !important;
}

#settingsSidebar .rounding-mode-row.rounding-compact-row {
  flex-wrap: nowrap !important;
}
#settingsSidebar .rounding-mode-row.rounding-compact-row > .hint-text:first-child {
  flex: 0 0 auto;
}
.rounding-compact-row .rounding-method-stepper {
  flex: 1 1 auto;
  min-width: 0;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  gap: 3px;
}
.rounding-compact-row #paramRoundingCornerType {
  display: block;
  min-width: 0;
  max-width: none;
  width: 100%;
  font-size: 10px;
}
.rounding-method-stepper button { width: 24px; min-width: 24px; }
.rounding-compact-radius { margin-top: 3px; }
.rounding-compact-radius.hidden { display: none !important; }
.rounding-compact-radius label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.rounding-compact-radius input { width: 12px; height: 12px; margin: 0; accent-color: var(--accent); }
.rounding-compact-radius #paramRoundingMode { display: none !important; }
.rounding-corner-type-btn {
  white-space: nowrap;
}

.rounding-mode-toggle.rounding-method-types {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  width: 100%;
  gap: 2px;
}
.rounding-method-types .rounding-mode-btn {
  min-width: 0;
  padding-left: 2px;
  padding-right: 2px;
  font-size: 11px;
}

.web-branch-toggle.spiral-web-choice-muted {
  opacity: 0.38;
  filter: grayscale(1);
  cursor: pointer;
}
.web-branch-toggle.spiral-web-choice-muted input {
  cursor: pointer;
}

#webDistance,
#webDepthMultiplier {
  box-sizing: border-box;
}
.web-depth-inline-row .row-label {
  gap: 6px;
}
.web-depth-inline-row .row-label label {
  margin-right: auto;
  min-width: 0;
}
.web-depth-inline-row #webDepthMultiplierText {
  margin-left: 8px;
  white-space: nowrap;
}
.web-depth-inline-inputs {
  display: flex;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
}
.web-depth-inline-inputs #webDistance {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
}
.web-depth-inline-inputs label[for='webDepthMultiplier'] {
  flex: 0 0 auto;
  font-size: 13px;
}
.web-depth-inline-inputs #webDepthMultiplier {
  flex: 0 0 62px;
  width: 62px;
  min-width: 50px;
  max-width: 72px;
}

#geometrySettingsGroup .unified-spiral-order {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 9px 0 6px;
  padding: 9px 10px;
  border: 1px solid rgba(34, 211, 238, 0.38);
  border-radius: 7px;
  background: rgba(8, 145, 178, 0.12);
}
#geometrySettingsGroup .unified-spiral-order label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #bff8ff;
  font-size: 12px;
}
#geometrySettingsGroup .unified-spiral-order label small {
  font-size: 10px;
  color: #94a3b8;
}
#geometrySettingsGroup .unified-spiral-order input {
  width: 72px;
  min-width: 64px;
  height: 33px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
#geometrySettingsGroup .somata-extended-contour-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 11px;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.4);
}
#geometrySettingsGroup .somata-extended-contour-block .row-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
#geometrySettingsGroup .somata-extended-contour-block #btnExtendedContour {
  min-height: 31px;
  border: 1px solid rgba(148, 163, 184, 0.48);
  border-radius: 6px;
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.3);
}
#geometrySettingsGroup .somata-extended-contour-block #btnExtendedContour.active {
  border-color: #67e8f9;
  background: rgba(8, 145, 178, 0.18);
}
#geometrySettingsGroup .extended-variant-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
#geometrySettingsGroup #spiralRotationFocusRow {
  margin-top: 5px;
}
#morphSettingsPanel .morph-compact-profile-field:has(#morphMode) {
  flex: 2 1 230px !important;
}
#morphSettingsPanel .morph-compact-profile-field:has(#morphMode) select {
  max-width: 330px !important;
  min-width: 180px !important;
}
#morphSettingsPanel .morph-compact-profile-field:has(#morphSlideType) select {
  max-width: 180px !important;
}

#geometrySettingsGroup #spiralGeometryControls.spiral-geometry-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 9px 0 10px;
  padding: 9px 10px;
  border: 1px solid rgba(34, 211, 238, 0.38);
  border-radius: 8px;
  background: rgba(8, 47, 73, 0.19);
  min-width: 0;
}
#geometrySettingsGroup .spiral-geometry-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: #bff8ff;
  font-size: 12px;
  font-weight: 600;
}
#geometrySettingsGroup #spiralGeometryControls .unified-spiral-order {
  margin: 0 0 4px;
  padding: 6px 7px;
}
#geometrySettingsGroup #spiralRotationFocusRow {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 6px 2px 7px;
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
}
#geometrySettingsGroup #spiralRotationFocusRow .somata-focus-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 14px;
}
#geometrySettingsGroup #spiralSettingsBlock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 4px 2px 1px;
  border: 0;
  border-radius: 0;
  background: none;
}
#geometrySettingsGroup #spiralSettingsBlock .spiral-setting-inactive {
  opacity: 0.72;
}
#geometrySettingsGroup #spiralSettingsBlock .spiral-setting-disabled {
  opacity: 0.55;
}
#geometrySettingsGroup #spiralSettingsBlock label:not(.spiral-zero-mode-setting) {
  font-size: 12px;
}
#geometrySettingsGroup #spiralGeometryControls .somata-focus-highlight-toggle {
  font-size: 12px;
}
@media (max-width: 760px) {
  #geometrySettingsGroup #spiralGeometryControls.spiral-geometry-controls {
    padding: 8px;
  }
  #geometrySettingsGroup .spiral-geometry-heading .hint-text {
    font-size: 10px;
  }
}

#geometrySettingsGroup #testMorphControls .test-morph-picker {
  display: flex;
  gap: 4px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
#geometrySettingsGroup #testMorphControls .test-morph-picker > select {
  flex: 1 1 0;
  width: 0;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 27px;
  min-height: 27px;
  margin: 0;
  padding: 2px 18px 2px 6px;
  font-size: 10.5px;
  line-height: 1.1;
  text-overflow: ellipsis;
}
#geometrySettingsGroup #testMorphControls .test-morph-arrow {
  flex: 0 0 24px;
  width: 24px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid #495b78;
  border-radius: 5px;
  background: #22314b;
  color: #dceaff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
#geometrySettingsGroup #testMorphControls .test-morph-arrow:hover {
  background: #2b476d;
  border-color: #71a5db;
}
#geometrySettingsGroup #testMorphControls .test-morph-arrow:active {
  background: #155e8d;
}
#geometrySettingsGroup #testMorphControls .test-morph-arrow:focus-visible {
  outline: 2px solid #5dd9ff;
  outline-offset: 2px;
}
#geometrySettingsGroup #testMorphControls .test-morph-arrow:disabled {
  cursor: default;
  opacity: 0.45;
}
@media (max-width: 480px) {
  #geometrySettingsGroup #testMorphControls .test-morph-row:has(.test-morph-picker) {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 3px;
  }
}

#morphSettingsPanel .morph-speed-toolbar-field > .morph-speed-picker {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
#morphSettingsPanel .morph-speed-picker select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}
#morphSettingsPanel .morph-speed-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid #495b78;
  border-radius: 5px;
  background: #22314b;
  color: #dceaff;
  font:
    700 11px/1 system-ui,
    sans-serif;
  cursor: pointer;
}
#morphSettingsPanel .morph-speed-arrow:hover {
  background: #2b476d;
  border-color: #71a5db;
}
#morphSettingsPanel .morph-speed-arrow:focus-visible {
  outline: 2px solid #5dd9ff;
  outline-offset: 2px;
}
@media (max-width: 760px) {
  #morphSettingsPanel .morph-speed-picker select {
    min-height: 42px;
  }
}

.skeleton-heading-options {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.skeleton-heading-options .test-morph-heading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
#skeletonOverlayCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 9;
  pointer-events: none;
  opacity: 1;
  transform: translateZ(0);
  backface-visibility: hidden;
}
#mainContainer.desktop-output-local-hidden > #skeletonOverlayCanvas {
  visibility: hidden !important;
}

/* Mode-specific options directly below Geometry > Animation > Morph type. */
#geometrySettingsGroup #testMorphProfileOverflow {
  justify-self: start;
  margin: 0;
}

/* Blue Morph: the three selectors share one line; the cycle keeps its own row. */
#morphSettingsPanel #morphCompactProfileControls {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px !important;
}
#morphSettingsPanel #morphCompactProfileControls > * {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}
#morphSettingsPanel #morphCompactProfileControls select {
  flex: 1 1 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
}
#morphSettingsPanel #morphCompactProfileControls .morph-speed-toolbar-field {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 4px !important;
}
#morphSettingsPanel #morphCompactProfileControls .morph-compact-profile-field {
  flex-wrap: nowrap !important;
}
#morphSettingsPanel #morphCompactProfileControls .morph-speed-picker {
  min-width: 0;
}
#morphSettingsPanel .morph-fade-controls output,
.test-morph-slider output {
  min-width: 2ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#geometrySettingsGroup #testMorphControls .test-morph-slider {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1 1 60%;
}
#geometrySettingsGroup #testMorphControls .test-morph-slider input[type='range'] {
  width: 0;
  min-width: 0;
  flex: 1 1 auto;
}
@media (max-width: 700px) {
  #morphSettingsPanel #morphCompactProfileControls .morph-speed-arrow {
    display: none;
  }
  #morphSettingsPanel
    #morphCompactProfileControls
    :is(.morph-compact-profile-field, .morph-speed-toolbar-field) {
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    font-size: 10px;
  }
  #morphSettingsPanel #morphCompactProfileControls select {
    width: 100% !important;
    font-size: 12px !important;
  }
}
#morphSettingsPanel #morphCompactProfileControls .morph-speed-toolbar-field > label {
  white-space: nowrap;
}

#geometrySettingsGroup .spiral-squash-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  min-width: 0;
  color: #bff8ff;
  font-size: 12px;
}
#geometrySettingsGroup .spiral-squash-row label {
  flex: none;
}
#geometrySettingsGroup .spiral-squash-row input {
  flex: 1 1 0;
  width: 0;
  min-width: 30px;
  accent-color: #22d3ee;
}
#geometrySettingsGroup .spiral-squash-row output {
  flex: 0 0 4ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#spiralOrderControl .spiral-order-spinner {
  display: flex;
  align-items: stretch;
  gap: 3px;
}
#spiralOrderControl .spiral-order-arrows {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
#spiralOrderControl .spiral-order-arrows button {
  flex: 1;
  width: 19px;
  padding: 0;
  line-height: 1;
  font-size: 12px;
}

/* Keep the labelled controls intact; only the bare range inputs use fixed slots. */
#morphProfileBindings
  .morph-spiral-compact-controls
  > :is(.morph-spiral-hold-control, .morph-route-layer-coverage) {
  display: inline-flex;
  align-items: center;
  gap: 5px !important;
  box-sizing: border-box;
  padding: 2px 5px !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}
#morphProfileBindings
  .morph-spiral-compact-controls
  > :is(.morph-spiral-hold-control, .morph-route-layer-coverage)
  > span {
  flex: none;
  font-size: 10px;
}
#morphProfileBindings
  .morph-spiral-compact-controls
  > :is(.morph-spiral-hold-control, .morph-route-layer-coverage)
  > input {
  box-sizing: border-box;
  flex: 0 0 48px !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  margin: 0 !important;
}

#spiralGeometryControls .spiral-zero-mode-setting {
  display: grid;
  gap: 4px;
}
#spiralGeometryControls .spiral-zero-switch {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
}
#spiralGeometryControls .spiral-zero-switch select {
  width: 100%;
  min-width: 0;
}
#spiralGeometryControls .spiral-zero-switch button {
  min-width: 0;
  min-height: 26px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

/* Live profile cross-morph: separate the playback state from editor controls. */
.profile-mode-live {
  margin: 5px 0 7px;
  padding: 4px 8px;
  border-left: 2px solid #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  color: #bae6fd;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.profile-mode-live[hidden] {
  display: none;
}

/* Profile UI 2: authoring controls inside the live profile library row. */
#profileSettingsGroup .profile-closure-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
  min-width: 0;
  padding: 2px 0;
}
#profileSettingsGroup .profile-closure-options label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}
#profileSettingsGroup .profile-closure-options input[type="checkbox"] { flex: none; margin: 0; }
#profileSettingsGroup .profile-closure-options label:has(input:disabled) { opacity: .55; cursor: default; }
#profileSettingsGroup .profile-phase-points-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
  align-items: center;
  column-gap: 6px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
}
#profileSettingsGroup .profile-phase-points-row > label { white-space: nowrap; }
#profileSettingsGroup .profile-phase-points-row > input[type="range"] {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0;
  accent-color: #38bdf8;
}
#profileSettingsGroup .profile-phase-points-row > .text-mono {
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#profileSettingsGroup .profile-phase-points-row .profile-spline-point-editor {
  display: inline-flex;
  gap: 4px;
}
#profileSettingsGroup .profile-phase-points-row #profileSplinePointCount {
  width: 44px !important;
  min-width: 0 !important;
}

/* Geometry guide controls: a global toolbar button and an independent popup. */
.floating-display-controls .geometry-guides-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}
.floating-display-controls .geometry-guides-button.active {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.45);
}
.floating-display-controls .geometry-guides-button.partial {
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.45);
}
.geometry-guides-menu { width: min(282px, calc(100vw - 16px)); box-sizing: border-box; }
.geometry-guides-menu > label { display: flex; align-items: center; gap: 7px; padding: 4px 0; cursor: pointer; font-size: 12px; }
.geometry-guides-menu #roundingGuideControls.hidden { display: none !important; }
.geometry-guides-menu #roundingGuideControls { border-top: 1px solid var(--border-light); padding-top: 6px; }
.geometry-guides-menu #roundingGuideControls .row-inputs { flex-wrap: wrap; }
#profileSettingsGroup .profile-mode-live { margin: 5px 0 0; }

/* Geometry diagnostic visibility; separate from the analysis and auto-open controls. */
#screenErrorOverlayManualLabel {
  display: flex; align-items: center; gap: 6px; width: fit-content;
  margin: 0 0 8px; font: 11px/1.3 ui-monospace, monospace; color: #cbd5e1; cursor: pointer;
}
#screenErrorOverlayShowManual { width: 13px; height: 13px; margin: 0; accent-color: #38bdf8; }
