:root {
  color-scheme: dark;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #111214;
  color: #f3f1ec;
  font-synthesis: none;
  --surface: #191a1c;
  --surface-raised: #222427;
  --surface-deep: #141517;
  --line: #383a3d;
  --muted: #929397;
  --text: #f3f1ec;
  --accent: #e7e2d8;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 360px;
  margin: 0;
  background:
    radial-gradient(ellipse at 49% 0, rgba(91, 83, 68, .14), transparent 34rem),
    #111214;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .46;
}

select,
input[type="search"] {
  border: 1px solid #494b4e;
  border-radius: 6px;
  background: #151618;
  color: var(--text);
}

select:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid #eee9dc;
  outline-offset: 2px;
}

.app-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 0 34px 26px;
  zoom: .9;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #303235;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 16px;
  color: inherit;
  text-decoration: none;
}

.wordmark strong,
.wordmark small {
  display: block;
}

.wordmark strong {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 18px;
  letter-spacing: .13em;
}

.wordmark small {
  margin-top: 5px;
  color: #929397;
  font: 12px Consolas, monospace;
  letter-spacing: .15em;
}

.wordmark-mark {
  width: 42px;
  height: 42px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 6px;
  border: 1px solid #4a4b4d;
  border-radius: 50%;
}

.wordmark-mark i {
  border-radius: 50%;
  background: var(--mark-color);
}

.wordmark-mark i:nth-child(1) { --mark-color: #f16a57; }
.wordmark-mark i:nth-child(2) { --mark-color: #f1b83e; }
.wordmark-mark i:nth-child(3) { --mark-color: #58aa61; }
.wordmark-mark i:nth-child(4) { --mark-color: #9b6fc1; }

.connection-controls {
  display: flex;
  align-items: end;
  gap: 10px;
}

.select-wrap {
  display: grid;
  gap: 5px;
}

.select-wrap > span,
.effect-select-label,
.eyebrow,
.panel-caption,
.group-label,
.footer,
.limitation-note strong {
  font: 10px Consolas, monospace;
  letter-spacing: .12em;
}

.select-wrap > span,
.effect-select-label,
.eyebrow,
.panel-caption,
.footer {
  color: var(--muted);
}

.select-wrap select {
  height: 34px;
  min-width: 190px;
  padding: 0 30px 0 10px;
  font-size: 12px;
}

.channel-select select {
  min-width: 74px;
}

.button {
  min-height: 35px;
  padding: 0 12px;
  border: 1px solid #494b4e;
  border-radius: 6px;
  background: #27292c;
  color: #e7e5df;
  font-size: 12px;
  font-weight: 600;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.button:hover:not(:disabled) {
  border-color: #858589;
  background: #323438;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button-connect {
  height: 34px;
  background: #e8e2d7;
  border-color: #e8e2d7;
  color: #191a1c;
}

.button-connect:hover:not(:disabled) {
  background: #fffaf0;
}

.connection-status {
  min-width: 90px;
  padding-bottom: 9px;
  color: #a7a7a7;
  font: 10px Consolas, monospace;
}

.connection-status::before {
  content: "";
  width: 6px;
  height: 6px;
  display: inline-block;
  margin: 0 7px 1px 0;
  border-radius: 50%;
  background: #77797b;
}

.connection-status.is-connected::before {
  background: #68bd78;
  box-shadow: 0 0 8px #68bd7880;
}

.intro-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 39px 0 27px;
}

.intro-row .eyebrow {
  margin: 0 0 11px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font: 600 clamp(30px, 4vw, 48px)/.98 "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: -.055em;
}

h1 span {
  color: #88898d;
}

.tiny-light {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #66b96d;
  box-shadow: 0 0 10px #66b96d70;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.module-card,
.panel,
.performance-panel {
  border: 1px solid #383a3d;
  border-radius: 9px;
  background: linear-gradient(160deg, #222427, #1a1b1d 65%);
  box-shadow: 0 9px 24px #00000020;
}

.module-card {
  position: relative;
  grid-row: 2;
  min-width: 0;
  padding: 17px 16px 13px;
  border-color: #b7ad9c;
  border-top: 2px solid var(--module-color);
  background: linear-gradient(160deg, #f1ecdf, #dcd5c7);
  color: #24211d;
  box-shadow: 0 9px 24px #00000028, inset 0 1px 0 #fff9;
}

.module-card:focus-within {
  z-index: 4;
}

.module-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}

.module-letter {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--module-color);
  color: #191a1c;
  font: 700 13px "Trebuchet MS", "Segoe UI", sans-serif;
}

.module-title {
  min-width: 0;
  flex: 1;
}

.module-title .eyebrow {
  margin: 0 0 2px;
  font-size: 8px;
  color: #746d61;
}

.module-title h2 {
  margin: 0;
  font: 600 16px "Trebuchet MS", "Segoe UI", sans-serif;
  color: #24211d;
}

.module-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.module-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  width: 36px;
  height: 20px;
  display: block;
  padding: 3px;
  border: 1px solid #938b7e;
  border-radius: 20px;
  background: #a9a092;
  transition: background .15s ease;
}

.switch-track span {
  width: 12px;
  height: 12px;
  display: block;
  border-radius: 50%;
  background: #787a7d;
  transition: transform .15s ease, background .15s ease;
}

.module-switch input:checked + .switch-track {
  border-color: color-mix(in srgb, var(--module-color) 60%, #938b7e);
  background: color-mix(in srgb, var(--module-color) 35%, #f1ecdf);
}

.module-switch input:checked + .switch-track span {
  transform: translateX(16px);
  background: color-mix(in srgb, var(--module-color) 87%, #25211a);
}

.module-switch input:focus-visible + .switch-track {
  outline: 2px solid #eee9dc;
  outline-offset: 3px;
}

.effect-select-label {
  display: block;
  margin-bottom: 6px;
  font-size: 8px;
  color: #746d61;
}

.effect-select {
  min-width: 0;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--module-color) 45%, #9a9182);
  border-radius: 6px;
  background: #f9f5eb;
  color: #28241e;
  font: 600 12px "Trebuchet MS", "Segoe UI", sans-serif;
  text-align: left;
  cursor: pointer;
}

.effect-picker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 57px;
  gap: 6px;
}

.effect-cycle-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
}

.effect-cycle {
  display: grid;
  min-width: 0;
  height: 35px;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--module-color) 45%, #9a9182);
  border-radius: 6px;
  background: #e6dfd2;
  color: #363128;
  font-size: 17px;
  line-height: 1;
}

.effect-cycle:hover {
  background: #d9d1c2;
}

.effect-selected {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.effect-swatch {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 1px solid #25211b40;
  border-radius: 2px;
  background: var(--effect-color);
  box-shadow: inset 0 1px 0 #ffffff60;
}

.effect-chevron {
  width: 8px;
  height: 8px;
  margin: -4px 2px 0 10px;
  border-right: 1.5px solid #514b41;
  border-bottom: 1.5px solid #514b41;
  transform: rotate(45deg);
  transition: transform .15s ease;
}

.effect-select[aria-expanded="true"] .effect-chevron {
  margin-top: 4px;
  transform: rotate(225deg);
}

.effect-options {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  right: 63px;
  left: 0;
  display: grid;
  gap: 2px;
  padding: 4px;
  border: 1px solid #b7ad9c;
  border-radius: 7px;
  background: #f1ecdf;
  box-shadow: 0 10px 24px #0007;
}

.effect-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 7px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #c3baaa;
}

.effect-legend-item {
  min-width: 0;
  min-height: 34px;
  flex: 1 1 45%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #756e62;
  font-size: 16px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.effect-legend-item:hover,
.effect-legend-item.is-active {
  border-color: #b7ad9c;
  background: #e5dfd3;
  color: #302c25;
}

.effect-legend-swatch {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--effect-color);
  box-shadow: 0 0 0 1px #34312a35;
}

.effect-options[hidden] {
  display: none;
}

.effect-option {
  min-height: 31px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #312d26;
  font-size: 11px;
  text-align: left;
}

.effect-option:hover,
.effect-option:focus-visible,
.effect-option.is-selected {
  border-color: #d3cabb;
  background: #e1dacd;
  outline: none;
}

.effect-option.is-selected {
  font-weight: 700;
}

.knob-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 17px 3px 11px;
}

.knob-control {
  display: grid;
  justify-items: center;
  min-width: 0;
  cursor: default;
}

.knob-visual {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 7px;
  padding: 0;
  border: 1px solid #151412;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 1deg,
    #25231f 0deg 5deg,
    #393630 5.3deg 5.8deg,
    #211f1b 6deg 9deg
  );
  color: inherit;
  appearance: none;
  box-shadow: 0 2px 4px #0007, inset 0 1px 1px #ffffff42, inset 0 -1px 2px #0008;
  cursor: ns-resize;
  touch-action: none;
  transform: rotate(var(--angle, 0deg));
  transition: transform 110ms ease-out;
}

.knob-visual:focus-visible {
  outline: 2px solid #eee9dc;
  outline-offset: 3px;
}

.knob-face {
  width: 62px;
  height: 62px;
  display: block;
  position: relative;
  border: 1px solid #26231e;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 34% 24%, #ffffff56, transparent 42%),
    radial-gradient(circle at 42% 38%, color-mix(in srgb, var(--module-color) 91%, #fff), var(--module-color) 73%, color-mix(in srgb, var(--module-color) 90%, #000));
  box-shadow: inset 0 1px 2px #ffffff4a, inset 0 -2px 3px #0004, 0 1px 2px #0008;
}

.knob-indicator {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 8px;
  height: 19px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.knob-indicator::after {
  position: absolute;
  inset: 0;
  border: 2.5px solid #171615;
  border-radius: 3px;
  background: #fffdf3;
  box-shadow: 0 0 1px #000b;
  content: "";
}

.knob-name {
  color: #2d2923;
  font: 600 11px Consolas, monospace;
  text-align: center;
}

.knob-value {
  margin-top: 2px;
  color: #1d1b18;
  font: 700 13px/1.1 Consolas, monospace;
}

.knob-range {
  width: min(100%, 108px);
  height: 14px;
  margin: 3px 0 0;
  accent-color: var(--module-color);
  cursor: ew-resize;
}

.range-ends {
  width: min(100%, 108px);
  display: flex;
  justify-content: space-between;
  margin-top: -1px;
  color: #7a7367;
  font: 8px Consolas, monospace;
}

.secondary-controls {
  border-top: 1px solid #c3baaa;
}

.secondary-controls summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 1px 0;
  color: #655f54;
  font-size: 10px;
  cursor: pointer;
  list-style: none;
}

.secondary-controls summary::-webkit-details-marker {
  display: none;
}

.secondary-controls summary span:last-child {
  color: var(--module-color);
  font: 16px Consolas, monospace;
}

.secondary-controls[open] summary span:last-child {
  transform: rotate(45deg);
}

.secondary-row {
  padding-bottom: 0;
}

.knob-secondary .knob-visual {
  width: 68px;
  height: 68px;
}

.knob-secondary .knob-face {
  width: 62px;
  height: 62px;
}

.knob-secondary .knob-indicator::after {
  height: 19px;
}

.module-card[data-module-id="texture"] .knob-row:not(.secondary-row) {
  grid-template-columns: 1fr;
}

.module-card[data-module-id="texture"] .knob-row:not(.secondary-row) .knob-control {
  justify-self: center;
  width: min(100%, 150px);
}

.mix-control-panel {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  width: 180px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 12px 0 0 auto;
  padding: 8px;
  border: 1px solid #4a4946;
  border-left: 3px solid #a7a6a2;
  border-radius: 8px;
  background: linear-gradient(160deg, #242526, #1a1b1c);
}

.mix-control-heading {
  text-align: center;
}

.mix-control-panel #textureMixControl {
  width: 100%;
}

.mix-control-heading .eyebrow {
  margin: 0 0 3px;
  color: #a7a6a2;
  font-size: 9px;
}

.mix-control-heading h2 {
  margin: 0;
  color: #e3e1dc;
  font: 600 14px "Trebuchet MS", "Segoe UI", sans-serif;
}

.module-order-help {
  margin-top: 12px;
  border: 1px solid #383a3d;
  border-radius: 7px;
  background: #191a1c;
  color: #d3d0c8;
}

.module-order-help summary {
  padding: 10px 13px;
  color: #d3d0c8;
  font-size: 11px;
  cursor: pointer;
}

.module-order-help p {
  max-width: 850px;
  margin: 8px 0 0;
  padding: 0 13px 12px;
  color: #a9a8a3;
  font-size: 10px;
  line-height: 1.5;
}

.module-order-help .workflow-steps {
  margin: 0;
  padding: 0 30px 0 34px;
  color: #d3d0c8;
  font-size: 10px;
  line-height: 1.6;
}

.module-order-help a {
  color: #e7c992;
}

.performance-panel {
  margin-top: 14px;
  padding: 19px 21px 17px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading .eyebrow {
  margin: 0 0 4px;
  font-size: 9px;
}

.panel-heading h2 {
  margin: 0;
  font: 600 18px "Trebuchet MS", "Segoe UI", sans-serif;
}

.panel-caption {
  font-size: 9px;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.performance-group {
  min-width: 0;
  padding: 12px;
  border: 1px solid #383a3d;
  border-radius: 7px;
  background: #191a1c;
}

.group-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: #b7b6b1;
  font-size: 9px;
}

.tiny-light {
  width: 6px;
  height: 6px;
}

.tiny-light.orange { background: #e2a04b; box-shadow: 0 0 7px #e2a04b80; }
.tiny-light.red { background: #ed6655; box-shadow: 0 0 7px #ed665580; }
.tiny-light.blue { background: #55a9d8; box-shadow: 0 0 7px #55a9d880; }
.tiny-light.lavender { background: #a780c9; box-shadow: 0 0 7px #a780c980; }
.tiny-light.master { background: #c7c1b5; box-shadow: 0 0 7px #c7c1b580; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.button-row .button {
  min-height: 31px;
  padding: 0 9px;
  font-size: 10px;
}

.calibration-actions {
  margin-top: 8px;
}

.master-level-group .knob-control {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  column-gap: 8px;
}

.master-level-group .knob-visual {
  grid-row: span 3;
  width: 68px;
  height: 68px;
  margin: 0;
}

.master-level-group .knob-face {
  width: 62px;
  height: 62px;
}

.master-level-group .knob-name {
  font-size: 10px;
}

.master-level-group .knob-value {
  margin-top: -4px;
  font-size: 12px;
}

.master-level-group .knob-range,
.master-level-group .range-ends {
  grid-column: 2;
  width: 100%;
}

.master-level-group .knob-range {
  margin-top: -8px;
}

.master-level-group .range-ends {
  margin-top: -6px;
}

.button-quiet {
  color: #b9b8b3;
}

.record-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin: 0 6px 1px 0;
  border-radius: 50%;
  background: #ea6759;
}

.group-hint {
  margin: 8px 0 0;
  color: #828387;
  font-size: 9px;
  line-height: 1.45;
}

.button-tempo {
  width: 100%;
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.tap-ring {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid #d39249;
  border-radius: 50%;
  color: #e7ad62;
  font: 9px Consolas, monospace;
}

.tempo-entry {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.tempo-entry input {
  width: min(100%, 170px);
  height: 58px;
  padding: 0 8px;
  border: 1px solid #4d4942;
  border-radius: 6px;
  background: #151618;
  color: #f0bf7a;
  text-align: center;
  font: 600 34px Consolas, monospace;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
}

.tempo-entry input::-webkit-inner-spin-button,
.tempo-entry input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.tempo-entry > span {
  color: #999a99;
  font: 10px Consolas, monospace;
}

.tempo-adjustments {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 8px;
}

.tempo-adjust {
  width: 42px;
  min-height: 34px;
  padding: 0;
  font-size: 16px;
}

.tempo-actions {
  justify-content: center;
  margin-top: 7px;
}

.tempo-group .group-hint {
  min-height: 25px;
}

.inline-choice,
.filter-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  color: #a9a8a3;
  font-size: 10px;
}

.inline-choice select,
.filter-choice select {
  min-width: 108px;
  height: 27px;
  padding: 0 8px;
  font-size: 10px;
}

.preset-workspace {
  display: grid;
  grid-template-columns: minmax(300px, .86fr) minmax(0, 1.14fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  min-width: 0;
  padding: 19px 20px;
}

.bank-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 17px 0 9px;
}

.bank-tab {
  min-height: 30px;
  border: 1px solid #414346;
  border-radius: 5px;
  background: #17181a;
  color: #a4a4a1;
  font: 10px Consolas, monospace;
}

.bank-tab.is-active {
  border-color: #e3ded2;
  background: #e3ded2;
  color: #1b1c1e;
}

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

.slot-button {
  min-width: 0;
  min-height: 43px;
  display: grid;
  place-content: center;
  gap: 3px;
  border: 1px solid #3c3e41;
  border-radius: 5px;
  background: #1a1b1d;
  color: #d0cec8;
  font: 12px Consolas, monospace;
}

.slot-button small {
  color: #6f7174;
  font: 7px Consolas, monospace;
}

.slot-button:hover,
.slot-button.is-selected {
  border-color: #ded9ce;
  background: #2b2c2f;
}

.slot-button.is-selected {
  box-shadow: inset 0 0 0 1px #ded9ce;
}

.onboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.button-primary {
  border-color: #e4ded2;
  background: #e4ded2;
  color: #191a1c;
}

.button-primary:hover:not(:disabled) {
  border-color: #fff8eb;
  background: #fff8eb;
}

.limitation-note {
  display: grid;
  gap: 4px;
  margin-top: 13px;
  padding: 11px 12px;
  border-left: 2px solid #dca158;
  background: #26231f;
}

.limitation-note strong {
  color: #e0b16f;
  font-size: 9px;
}

.limitation-note span {
  color: #b6b1a8;
  font-size: 10px;
  line-height: 1.45;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #b2b0aa;
  font-size: 10px;
  text-decoration: underline;
  text-decoration-color: #66676a;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: #fff;
}

.onboard-panel > .text-button {
  margin-top: 11px;
}

.library-heading {
  margin-bottom: 16px;
}

.count-badge {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  margin-left: 4px;
  border: 1px solid #515357;
  border-radius: 12px;
  color: #b7b5af;
  font: 10px Consolas, monospace;
  vertical-align: 2px;
}

.library-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.search-wrap {
  flex: 1;
}

.search-wrap input {
  width: 100%;
  height: 33px;
  padding: 0 9px;
  font-size: 11px;
}

.button-small {
  min-height: 33px;
  padding: 0 9px;
  font-size: 10px;
}

.preset-list {
  display: grid;
  gap: 5px;
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid #36383b;
  border-radius: 6px;
  background: #191a1c;
}

.preset-item-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.preset-index {
  color: #737579;
  font: 10px Consolas, monospace;
}

.preset-item-info div {
  min-width: 0;
}

.preset-item-info strong,
.preset-item-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-item-info strong {
  font-size: 11px;
  font-weight: 600;
}

.preset-item-info small {
  max-width: 315px;
  margin-top: 3px;
  color: #88898c;
  font-size: 9px;
}

.preset-item-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.preset-action-menu {
  width: 66px;
  height: 29px;
  padding: 0 5px;
  font-size: 10px;
}

.icon-button {
  width: 29px;
  height: 29px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #aaa9a5;
  font-size: 16px;
}

.icon-button:hover {
  border-color: #484a4d;
  background: #2b2c2f;
  color: #f3f1ec;
}

.about-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  margin-bottom: 1px;
  border: 1px solid #77797c;
  border-radius: 50%;
  background: #292b2e;
  color: #fff;
  font: 700 22px/1 "Segoe UI", Arial, sans-serif;
  box-shadow: inset 0 1px 2px #ffffff18, 0 1px 3px #0008;
  cursor: pointer;
}

.about-button:hover {
  border-color: #e7e2d8;
  background: #383a3d;
  color: #fff;
}

.empty-library {
  margin: 20px 0;
  color: #848588;
  font-size: 11px;
  text-align: center;
}

.empty-library[hidden] {
  display: none;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 2px 0;
  font-size: 8px;
}

.workflow-dialog {
  width: min(530px, calc(100% - 32px));
  max-width: none;
  padding: 21px;
  border: 1px solid #535558;
  border-radius: 10px;
  background: #202123;
  color: var(--text);
  box-shadow: 0 25px 100px #000b;
}

.workflow-dialog::backdrop {
  background: #070809c9;
  backdrop-filter: blur(4px);
}

.dialog-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.dialog-top .eyebrow {
  margin-bottom: 5px;
  font-size: 9px;
}

.dialog-top h2 {
  margin-bottom: 0;
  font: 600 22px "Trebuchet MS", "Segoe UI", sans-serif;
}

.dialog-content {
  margin-top: 16px;
  color: #c4c2bd;
  font-size: 12px;
  line-height: 1.65;
}

.dialog-content p:last-child {
  margin-bottom: 0;
}

.dialog-input-form {
  display: grid;
  gap: 8px;
}

.dialog-input-form label {
  color: #d3d1cb;
  font-size: 11px;
}

.dialog-input-form input {
  height: 39px;
  padding: 0 10px;
  border: 1px solid #5b5d60;
  border-radius: 6px;
  background: #151618;
  color: var(--text);
}

.workflow-steps,
.notes-list {
  padding-left: 20px;
}

.workflow-steps li,
.notes-list li {
  padding-left: 3px;
  margin: 8px 0;
}

kbd {
  padding: 2px 5px;
  border: 1px solid #66686b;
  border-radius: 4px;
  background: #2a2b2e;
  color: #f0eee8;
  font: 10px Consolas, monospace;
}

.dialog-callout {
  padding: 10px 12px;
  border-left: 2px solid #dca158;
  background: #29251f;
  color: #d3c3a9;
}

.dialog-actions {
  display: flex;
  justify-content: end;
  margin-top: 19px;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 24px;
  max-width: min(540px, calc(100% - 32px));
  padding: 11px 15px;
  border: 1px solid #636568;
  border-radius: 7px;
  background: #252629;
  color: #f3f1ec;
  box-shadow: 0 8px 28px #0009;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .16s ease, transform .16s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 1190px) {
  .mix-control-panel {
    grid-column: 2;
    grid-row: 3;
  }

  .module-card[data-module-id="character"] {
    grid-column: 1;
    grid-row: 1;
  }

  .module-card[data-module-id="movement"] {
    grid-column: 2;
    grid-row: 1;
  }

  .module-card[data-module-id="diffusion"] {
    grid-column: 1;
    grid-row: 2;
  }

  .module-card[data-module-id="texture"] {
    grid-column: 2;
    grid-row: 4;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .app-shell {
    padding: 0 18px 22px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 17px 0;
  }

  .wordmark strong {
    font-size: 17px;
  }

  .wordmark-mark {
    width: 38px;
    height: 38px;
  }

  .connection-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .select-wrap {
    flex: 1 1 180px;
  }

  .select-wrap select {
    min-width: 0;
    width: 100%;
  }

  .intro-row {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 30px;
  }

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

@media (max-width: 520px) {
  .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .mix-control-panel {
    grid-column: 1;
    grid-row: 4;
  }

  .module-card[data-module-id="character"] {
    grid-column: 1;
    grid-row: 1;
  }

  .module-card[data-module-id="movement"] {
    grid-column: 1;
    grid-row: 2;
  }

  .module-card[data-module-id="diffusion"] {
    grid-column: 1;
    grid-row: 3;
  }

  .module-card[data-module-id="texture"] {
    grid-column: 1;
    grid-row: 5;
  }

  .module-grid,
  .performance-grid {
    grid-template-columns: 1fr;
  }

  .intro-row {
    padding-bottom: 20px;
  }

  .panel,
  .performance-panel {
    padding: 15px;
  }

  .library-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-toolbar {
    flex-wrap: wrap;
  }

  .search-wrap {
    flex-basis: 100%;
  }

  .preset-item-info small {
    max-width: 180px;
  }

  .panel-caption {
    display: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
