:root {
  color-scheme: dark;
  --comp-bg: #05080d;
  --comp-surface: rgba(10, 18, 28, 0.86);
  --comp-panel: rgba(5, 10, 17, 0.48);
  --comp-panel-strong: rgba(4, 8, 13, 0.72);
  --comp-line: rgba(222, 235, 248, 0.13);
  --comp-line-strong: rgba(231, 240, 250, 0.46);
  --comp-text: #eff6ff;
  --comp-muted: rgba(231, 240, 250, 0.62);
  --comp-soft: rgba(231, 240, 250, 0.08);
  --comp-warm: #f3b55c;
  --comp-coral: #ff8d6d;
  --comp-teal: #72d8cb;
  --comp-blue: #8bd5ff;
  --comp-danger: #ff8d8d;
  --comp-valid: #7ee787;
  --comp-invalid: #ff6f7d;
  --comp-warning: #f3b55c;
  --comp-shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(114, 216, 203, 0.12), transparent 34%),
    radial-gradient(ellipse at 82% 12%, rgba(243, 181, 92, 0.12), transparent 28%),
    linear-gradient(180deg, #0a111b 0%, var(--comp-bg) 64%, #030508 100%);
  color: var(--comp-text);
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea,
.bar-cell {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  appearance: none;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--comp-line);
  border-radius: 12px;
  color: var(--comp-text);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 780;
  line-height: 1;
  padding: 0 14px;
  white-space: nowrap;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.style-picker-toggle:focus-visible,
.style-option:focus-visible,
.bar-rhythm-button:focus-visible {
  outline: none;
  border-color: rgba(114, 216, 203, 0.44);
  box-shadow: 0 0 0 3px rgba(114, 216, 203, 0.1);
}

input,
select {
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(222, 235, 248, 0.14);
  border-radius: 10px;
  color: var(--comp-text);
  background: rgba(4, 8, 13, 0.7);
  outline: none;
  padding: 0 10px;
}

select {
  cursor: pointer;
}

.comp-page {
  height: 100dvh;
  overflow: hidden;
}

.comp-shell {
  height: 100dvh;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 12px 14px calc(var(--fiume-footer-reserved, 56px) + 10px);
}

.comp-workbench {
  width: min(100%, 1220px);
  height: calc(100dvh - var(--fiume-footer-reserved, 56px) - 22px);
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 14px;
  border: 1px solid var(--comp-line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(15, 28, 43, 0.74), rgba(7, 13, 21, 0.72)),
    var(--comp-surface);
  box-shadow: var(--comp-shadow);
  backdrop-filter: blur(18px) saturate(1.06);
}

.comp-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.comp-console,
.comp-stage,
.transport-dock {
  border: 1px solid var(--comp-line);
  background: var(--comp-panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.comp-console {
  position: relative;
  min-height: 0;
  display: block;
  padding: 6px;
  border-radius: 14px;
}

.comp-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

p {
  margin: 0;
}

.comp-controls {
  min-width: 0;
  display: grid;
  grid-template-columns:
    minmax(105px, 0.66fr)
    minmax(133px, 0.78fr)
    minmax(78px, 0.32fr)
    minmax(72px, 0.24fr)
    minmax(76px, 0.26fr)
    minmax(64px, 0.22fr);
  align-items: stretch;
  gap: 6px;
}

.comp-field {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border: 1px solid var(--comp-line);
  border-radius: 10px;
  background: rgba(5, 10, 17, 0.42);
}

.comp-controls input,
.comp-controls select,
.style-picker-toggle {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 8px;
}

.comp-field span,
.mixer-volume span,
.mixer-instrument span {
  color: var(--comp-muted);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.comp-song-field select,
.comp-title-field input {
  width: 100%;
}

.comp-style-field {
  position: relative;
}

.comp-style-field .visually-hidden-select {
  position: absolute;
  right: 6px;
  bottom: 4px;
  width: 1px;
  min-width: 0;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.style-picker-toggle {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border-color: rgba(222, 235, 248, 0.14);
  background: rgba(4, 8, 13, 0.7);
  color: var(--comp-text);
  text-align: left;
}

.style-picker-toggle::after {
  content: "⌄";
  color: var(--comp-muted);
  font-size: 0.82rem;
}

.style-picker-toggle .style-picker-name {
  min-width: 0;
  overflow: hidden;
  color: var(--comp-text);
  font-size: 0.82rem;
  font-weight: 820;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.style-picker-toggle .style-picker-meta {
  display: none;
}

.comp-tempo-field input,
.comp-bars-field input {
  width: 100%;
  color: var(--comp-warm);
  font-size: 1rem;
  font-weight: 780;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.comp-tool-button {
  align-self: stretch;
  min-height: 40px;
}

.comp-controls > .comp-tool-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 0.84rem;
}

.comp-save-button:not(:disabled) {
  border-color: rgba(243, 181, 92, 0.34);
  color: #1f1308;
  background: linear-gradient(135deg, var(--comp-warm), var(--comp-coral));
  box-shadow: 0 10px 20px rgba(243, 181, 92, 0.12);
}

.playbar {
  min-width: 0;
  width: min(100%, 368px);
  display: grid;
  grid-template-columns: repeat(4, 40px) 1px minmax(118px, 132px);
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--comp-line);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(15, 28, 43, 0.42), rgba(4, 8, 13, 0.68)),
    rgba(4, 8, 13, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 12px 30px rgba(0, 0, 0, 0.16);
}

.playbar-button,
.playbar-toggle {
  min-height: 34px;
  min-width: 40px;
  border-radius: 9px;
  padding: 0;
  font-size: 1rem;
}

.playbar-tempo {
  min-width: 0;
  min-height: 34px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 3px 4px 3px 8px;
  border: 1px solid rgba(222, 235, 248, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.playbar-tempo span {
  color: var(--comp-muted);
  font-size: 0.62rem;
  font-weight: 820;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.playbar-tempo input {
  width: 100%;
  min-width: 54px;
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  padding: 0 7px;
  color: var(--comp-warm);
  background: rgba(4, 8, 13, 0.62);
  font-size: 0.92rem;
  font-weight: 840;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.playbar-divider {
  width: 1px;
  height: 22px;
  border-radius: 999px;
  background: rgba(222, 235, 248, 0.16);
}

.playback-feedback {
  min-width: min(100%, 272px);
  max-width: min(100%, 420px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(243, 181, 92, 0.18);
  border-radius: 999px;
  color: rgba(255, 236, 211, 0.96);
  background:
    linear-gradient(180deg, rgba(243, 181, 92, 0.11), rgba(4, 8, 13, 0.7)),
    rgba(4, 8, 13, 0.76);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.25;
  text-align: center;
}

.playback-feedback[hidden] {
  display: none;
}

.playback-feedback[data-kind="ok"] {
  border-color: rgba(114, 216, 203, 0.28);
  color: rgba(220, 255, 250, 0.96);
  background:
    linear-gradient(180deg, rgba(114, 216, 203, 0.12), rgba(4, 8, 13, 0.7)),
    rgba(4, 8, 13, 0.76);
}

.playback-feedback[data-kind="warning"],
.playback-feedback[data-kind="error"] {
  border-color: rgba(255, 141, 109, 0.28);
  color: rgba(255, 232, 226, 0.96);
}

.playback-feedback-spinner {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: playback-feedback-spin 780ms linear infinite;
}

.playback-feedback[data-kind="ok"] .playback-feedback-spinner,
.playback-feedback[data-kind="warning"] .playback-feedback-spinner,
.playback-feedback[data-kind="error"] .playback-feedback-spinner {
  animation: none;
  border-color: currentColor;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
}

.playbar-button span,
.playbar-toggle span {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.playbar-play:not(:disabled) {
  border-color: rgba(243, 181, 92, 0.34);
  background: linear-gradient(135deg, var(--comp-warm), var(--comp-coral));
  color: #1f1308;
  box-shadow: 0 14px 28px rgba(243, 181, 92, 0.15);
}

.playbar-button:not(.playbar-play):not(:disabled) {
  border-color: rgba(114, 216, 203, 0.32);
}

.playbar-toggle {
  color: var(--comp-muted);
}

.playbar-toggle.is-on {
  color: #061319;
  border-color: rgba(114, 216, 203, 0.45);
  background: linear-gradient(135deg, var(--comp-teal), var(--comp-blue));
  box-shadow: 0 10px 22px rgba(114, 216, 203, 0.12);
}

.comp-tool-button.is-open {
  color: #061319;
  border-color: rgba(114, 216, 203, 0.45);
  background: linear-gradient(135deg, var(--comp-teal), var(--comp-blue));
  box-shadow: 0 10px 22px rgba(114, 216, 203, 0.12);
}

.mixer-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    calc(var(--fiume-footer-reserved, 56px) + 18px) max(14px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 18%, rgba(114, 216, 203, 0.1), transparent 36%),
    rgba(1, 5, 10, 0.72);
  backdrop-filter: blur(18px) saturate(1.08);
}

.mixer-panel[hidden] {
  display: none;
}

.lyrics-panel {
  position: fixed;
  inset: 0;
  z-index: 82;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    calc(var(--fiume-footer-reserved, 56px) + 18px) max(14px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 18%, rgba(243, 181, 92, 0.11), transparent 34%),
    rgba(1, 5, 10, 0.72);
  backdrop-filter: blur(18px) saturate(1.08);
}

.lyrics-panel[hidden] {
  display: none;
}

.rhythm-panel {
  position: fixed;
  inset: 0;
  z-index: 86;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    calc(var(--fiume-footer-reserved, 56px) + 18px) max(14px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 18%, rgba(139, 213, 255, 0.1), transparent 34%),
    rgba(1, 5, 10, 0.72);
  backdrop-filter: blur(18px) saturate(1.08);
}

.rhythm-panel[hidden] {
  display: none;
}

.style-picker-panel {
  position: fixed;
  inset: 0;
  z-index: 84;
  min-width: 0;
  min-height: 0;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    calc(var(--fiume-footer-reserved, 56px) + 18px) max(14px, env(safe-area-inset-left));
  background: rgba(1, 5, 10, 0.7);
  backdrop-filter: blur(18px) saturate(1.08);
}

.style-picker-panel[hidden] {
  display: none;
}

.style-picker-dialog {
  width: min(100%, 920px);
  max-height: min(680px, calc(100dvh - var(--fiume-footer-reserved, 56px) - 34px));
  min-height: min(520px, calc(100dvh - var(--fiume-footer-reserved, 56px) - 34px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(222, 235, 248, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(15, 28, 43, 0.96), rgba(5, 10, 17, 0.97)),
    rgba(5, 10, 17, 0.97);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.style-picker-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
}

.style-picker-title-block {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
}

.style-picker-count {
  min-width: 0;
  display: grid;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--comp-line);
  border-radius: 14px;
  color: var(--comp-muted);
  background: rgba(4, 8, 13, 0.38);
  font-size: 0.82rem;
  font-weight: 740;
}

.style-search-field {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--comp-line);
  border-radius: 14px;
  background: rgba(4, 8, 13, 0.52);
}

.style-search-field span {
  color: var(--comp-muted);
  font-size: 0.68rem;
  font-weight: 760;
  text-transform: uppercase;
}

.style-search-field input {
  width: 100%;
  min-height: 34px;
  border-radius: 10px;
  background: rgba(231, 240, 250, 0.055);
}

.style-picker-list {
  min-height: 0;
  overflow: hidden;
}

.style-picker-browser {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  gap: 10px;
}

.style-category-rail {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  padding: 2px 3px 10px 2px;
}

.style-category-tab {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(222, 235, 248, 0.11);
  border-radius: 11px;
  background: rgba(4, 8, 13, 0.48);
  text-align: left;
}

.style-category-tab.is-active {
  border-color: rgba(114, 216, 203, 0.48);
  background:
    linear-gradient(90deg, rgba(114, 216, 203, 0.16), transparent 88%),
    rgba(4, 8, 13, 0.72);
  box-shadow: inset 3px 0 0 rgba(114, 216, 203, 0.72);
}

.style-category-name,
.style-category-count {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-category-name {
  color: var(--comp-text);
  font-size: 0.82rem;
  font-weight: 800;
}

.style-category-count {
  min-width: 24px;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--comp-muted);
  background: rgba(231, 240, 250, 0.08);
  font-size: 0.72rem;
  font-weight: 820;
  text-align: center;
}

.style-category-tab.is-active .style-category-name {
  color: var(--comp-teal);
}

.style-results {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}

.style-results-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(222, 235, 248, 0.11);
  border-radius: 12px;
  background: rgba(7, 13, 21, 0.8);
}

.style-results-head h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--comp-warm);
  font-size: 0.82rem;
  font-weight: 820;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.style-results-head span {
  color: var(--comp-muted);
  font-size: 0.74rem;
  font-weight: 740;
}

.style-options {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  overflow: auto;
  padding: 1px 2px 10px 1px;
}

.style-option {
  min-width: 0;
  min-height: 56px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 9px 10px;
  border-radius: 12px;
  text-align: left;
  white-space: normal;
}

.style-option.is-selected {
  border-color: rgba(114, 216, 203, 0.52);
  background: rgba(114, 216, 203, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.style-option-name,
.style-option-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-option-name {
  color: var(--comp-text);
  font-size: 0.9rem;
  font-weight: 820;
}

.style-option-meta {
  color: var(--comp-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.style-picker-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(222, 235, 248, 0.18);
  border-radius: 14px;
  color: var(--comp-muted);
  font-weight: 760;
}

.lyrics-dialog {
  width: min(100%, 760px);
  max-height: min(620px, calc(100dvh - var(--fiume-footer-reserved, 56px) - 34px));
  min-height: min(420px, calc(100dvh - var(--fiume-footer-reserved, 56px) - 34px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(222, 235, 248, 0.16);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(15, 28, 43, 0.94), rgba(5, 10, 17, 0.95)),
    rgba(5, 10, 17, 0.95);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.lyrics-panel-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: stretch;
  gap: 10px;
}

.lyrics-input {
  width: 100%;
  min-width: 0;
  min-height: 0;
  resize: none;
  border: 1px solid rgba(222, 235, 248, 0.14);
  border-radius: 14px;
  color: var(--comp-text);
  background:
    linear-gradient(rgba(231, 240, 250, 0.045) 1px, transparent 1px) 0 2.35rem / 100% 2.35rem,
    rgba(4, 8, 13, 0.7);
  outline: none;
  padding: 16px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.7;
}

.lyrics-input::placeholder {
  color: rgba(231, 240, 250, 0.38);
}

.lyrics-input:focus-visible {
  border-color: rgba(114, 216, 203, 0.44);
  box-shadow: 0 0 0 3px rgba(114, 216, 203, 0.1);
}

.rhythm-dialog {
  width: min(100%, 880px);
  max-height: min(720px, calc(100dvh - var(--fiume-footer-reserved, 56px) - 34px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(222, 235, 248, 0.16);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(15, 28, 43, 0.94), rgba(5, 10, 17, 0.96)),
    rgba(5, 10, 17, 0.96);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.rhythm-panel-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
}

.rhythm-title-block {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.rhythm-bar-label {
  min-width: 0;
  display: grid;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--comp-line);
  border-radius: 14px;
  color: var(--comp-muted);
  background: rgba(4, 8, 13, 0.48);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rhythm-head-actions {
  display: grid;
  grid-template-columns: 84px 84px;
  gap: 8px;
}

.rhythm-form {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 2px 2px 8px;
}

.rhythm-field,
.rhythm-slider,
.rhythm-card {
  min-width: 0;
  border: 1px solid rgba(222, 235, 248, 0.12);
  border-radius: 14px;
  background: rgba(4, 8, 13, 0.56);
}

.rhythm-field {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
}

.rhythm-field-wide {
  grid-column: 1 / -1;
}

.rhythm-field span,
.rhythm-slider span,
.rhythm-card h3,
.rhythm-check span,
.rhythm-drum-row span {
  color: var(--comp-muted);
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rhythm-field input,
.rhythm-field select {
  width: 100%;
  min-height: 36px;
  border-radius: 10px;
  background: rgba(231, 240, 250, 0.055);
}

.rhythm-slider {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(48px, auto);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
}

.rhythm-slider input {
  width: 100%;
  min-height: 34px;
  accent-color: var(--comp-teal);
}

.rhythm-slider output,
.rhythm-drum-row output {
  min-width: 48px;
  display: inline-grid;
  place-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(222, 235, 248, 0.1);
  border-radius: 999px;
  color: var(--comp-text);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.78rem;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.rhythm-card {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.rhythm-card h3 {
  margin: 0;
}

.rhythm-mute-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.rhythm-check {
  min-width: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid rgba(222, 235, 248, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.rhythm-check input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--comp-coral);
}

.rhythm-drums-card {
  grid-column: 1 / -1;
}

.rhythm-drums-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.rhythm-drum-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
}

.rhythm-drum-row input {
  width: 100%;
  min-height: 30px;
  accent-color: var(--comp-warm);
}

.mixer-dialog {
  width: min(100%, 1080px);
  max-height: min(720px, calc(100dvh - var(--fiume-footer-reserved, 56px) - 34px));
  min-height: min(520px, calc(100dvh - var(--fiume-footer-reserved, 56px) - 34px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(222, 235, 248, 0.16);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(15, 28, 43, 0.94), rgba(5, 10, 17, 0.95)),
    rgba(5, 10, 17, 0.95);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.mixer-panel-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: stretch;
  gap: 10px;
}

.mixer-panel-title {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(220px, 360px);
  align-items: stretch;
  gap: 10px;
}

h2 {
  min-width: 0;
  display: grid;
  align-items: center;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--comp-line);
  border-radius: 14px;
  color: var(--comp-warm);
  background: rgba(4, 8, 13, 0.52);
  font-size: 1.28rem;
  font-weight: 820;
  line-height: 1;
}

.comp-title-field {
  padding: 8px 10px;
}

.mixer {
  min-height: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(132px, 156px);
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  scrollbar-color: rgba(114, 216, 203, 0.34) transparent;
}

.mixer-track,
.mixer-master {
  --track-color: var(--comp-teal);
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(156px, 1fr) auto auto;
  grid-template-areas:
    "name"
    "volume"
    "instrument"
    "mute";
  align-items: stretch;
  justify-items: center;
  gap: 10px;
  padding: 12px 10px;
  border: 1px solid var(--comp-line);
  border-top: 4px solid var(--track-color);
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--track-color) 15%, transparent), transparent 34%),
    rgba(4, 8, 13, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mixer-master {
  grid-template-rows: auto minmax(156px, 1fr);
  grid-template-areas:
    "name"
    "volume";
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--track-color) 20%, transparent), transparent 38%),
    rgba(4, 8, 13, 0.7);
}

.mixer-track-name {
  grid-area: name;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  display: grid;
  place-items: center;
  color: var(--comp-text);
  font-size: 0.82rem;
  font-weight: 820;
  line-height: 1.05;
  text-align: center;
  overflow-wrap: anywhere;
}

.mixer-volume {
  grid-area: volume;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(122px, 1fr) auto;
  justify-items: center;
  align-items: center;
  gap: 8px;
}

.mixer-volume input {
  width: 34px;
  height: min(190px, 28vh);
  min-height: 124px;
  padding: 0;
  accent-color: var(--track-color);
  writing-mode: vertical-lr;
  direction: rtl;
}

.mixer-volume output {
  min-width: 5ch;
  display: inline-grid;
  place-items: center;
  padding: 5px 7px;
  border: 1px solid rgba(222, 235, 248, 0.1);
  border-radius: 999px;
  color: var(--comp-text);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.76rem;
  font-weight: 780;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.mixer-instrument {
  grid-area: instrument;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.mixer-instrument select {
  width: 100%;
  min-height: 36px;
  padding: 0 8px;
  font-size: 0.78rem;
}

.mixer-mute {
  grid-area: mute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  color: var(--comp-muted);
  font-size: 0.68rem;
  font-weight: 780;
  text-transform: uppercase;
}

.mixer-mute input {
  min-width: 18px;
  width: 18px;
  min-height: 18px;
  accent-color: var(--comp-coral);
}

.comp-stage {
  position: relative;
  min-height: 0;
  display: grid;
  align-items: center;
  padding: 18px 16px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 8%, rgba(139, 213, 255, 0.09), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(243, 181, 92, 0.11), transparent 26%),
    linear-gradient(rgba(231, 240, 250, 0.055) 1px, transparent 1px) 0 55% / 100% 14px,
    rgba(5, 10, 17, 0.46);
  overflow: auto;
}

.transport-dock {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 5px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(15, 28, 43, 0.34), rgba(5, 10, 17, 0.42)),
    rgba(5, 10, 17, 0.38);
}

.transport-stack {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.comp-stage::before {
  content: "";
  position: absolute;
  inset: auto 12% -18% 12%;
  height: 44%;
  background: radial-gradient(ellipse, rgba(114, 216, 203, 0.08), transparent 66%);
  pointer-events: none;
}

.bar-grid {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  min-width: 0;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: visible;
}

.bar-cell {
  --section-color: rgba(231, 240, 250, 0.5);
  position: relative;
  min-width: 0;
  min-height: 134px;
  display: grid;
  grid-template-rows: auto auto minmax(42px, 1fr) auto;
  align-items: stretch;
  gap: 9px;
  padding: 13px 10px 12px;
  border: 0;
  border-left: 2px solid var(--comp-line-strong);
  border-bottom: 1px solid rgba(231, 240, 250, 0.16);
  background: rgba(3, 8, 14, 0.16);
  cursor: pointer;
  transition:
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.bar-cell.is-top-row-4 {
  border-top: 2px solid var(--comp-line-strong);
}

.bar-cell.is-row-end-4 {
  border-right: 2px solid var(--comp-line-strong);
}

.bar-cell.is-bottom-row-4 {
  border-bottom: 2px solid var(--comp-line-strong);
}

.bar-cell[data-section-type="intro"] {
  --section-color: var(--comp-blue);
}

.bar-cell[data-section-type="main"] {
  --section-color: var(--comp-teal);
}

.bar-cell[data-section-type="fill"] {
  --section-color: var(--comp-warm);
}

.bar-cell[data-section-type="ending"] {
  --section-color: var(--comp-coral);
}

.bar-cell[data-section-type="other"] {
  --section-color: rgba(231, 240, 250, 0.5);
}

.bar-label {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--comp-muted);
  font-size: 0.7rem;
  font-weight: 780;
  line-height: 1;
  text-transform: uppercase;
}

.bar-rhythm-button {
  width: 34px;
  min-width: 34px;
  height: 20px;
  min-height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.bar-rhythm-button::before {
  content: "";
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: var(--section-color);
  opacity: 0.9;
  transition:
    width 140ms ease,
    opacity 140ms ease,
    box-shadow 140ms ease;
}

.bar-rhythm-button.is-active {
  background: transparent;
}

.bar-rhythm-button.is-active::before {
  width: 28px;
  opacity: 1;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--section-color) 16%, transparent);
}

.bar-rhythm-button:not(:disabled):hover {
  transform: none;
}

.bar-rhythm-button:not(:disabled):hover::before {
  width: 28px;
  opacity: 1;
}

.bar-rhythm-badges {
  min-width: 0;
  min-height: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.bar-rhythm-badges[hidden] {
  display: none;
}

.bar-rhythm-badge {
  max-width: 100%;
  overflow: hidden;
  padding: 3px 6px;
  border: 1px solid rgba(222, 235, 248, 0.1);
  border-radius: 999px;
  color: var(--comp-muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.62rem;
  font-weight: 820;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.bar-rhythm-badge-fill,
.bar-rhythm-badge-intensity,
.bar-rhythm-badge-drums {
  color: #061319;
  border-color: transparent;
  background: var(--section-color);
}

.bar-rhythm-badge-mute {
  color: rgba(255, 232, 226, 0.96);
  border-color: rgba(255, 141, 109, 0.2);
  background: rgba(255, 141, 109, 0.12);
}

.bar-cell.is-cued {
  background:
    linear-gradient(180deg, rgba(139, 213, 255, 0.12), transparent 58%),
    rgba(3, 8, 14, 0.2);
  box-shadow:
    inset 0 0 0 1px rgba(139, 213, 255, 0.22),
    inset 0 4px 0 rgba(139, 213, 255, 0.74);
}

.bar-cell.is-cued .bar-label {
  color: var(--comp-text);
}

.bar-cell input {
  width: 100%;
  min-height: 48px;
  border-color: transparent;
  border-radius: 10px;
  color: var(--comp-text);
  background: rgba(4, 8, 13, 0.34);
  font-size: clamp(1rem, 2.2vw, 1.32rem);
  font-weight: 780;
  line-height: 1;
  text-align: center;
  cursor: text;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease;
}

.bar-cell input::placeholder {
  color: rgba(231, 240, 250, 0.32);
}

.bar-cell.has-valid-chord input {
  border-color: rgba(126, 231, 135, 0.52);
  background:
    linear-gradient(180deg, rgba(126, 231, 135, 0.1), transparent 72%),
    rgba(4, 8, 13, 0.5);
  box-shadow: inset 0 0 0 1px rgba(126, 231, 135, 0.08);
}

.bar-cell.has-invalid-chord input {
  border-color: rgba(255, 111, 125, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 111, 125, 0.15), transparent 72%),
    rgba(4, 8, 13, 0.56);
  color: #ffe8eb;
  box-shadow:
    inset 0 0 0 1px rgba(255, 111, 125, 0.16),
    0 0 0 3px rgba(255, 111, 125, 0.08);
}

.bar-cell.has-invalid-chord .bar-label {
  color: rgba(255, 214, 219, 0.92);
}

.bar-cell.flash-valid input {
  animation: chord-valid-flash 560ms ease;
}

.bar-cell.flash-invalid input {
  animation: chord-invalid-flash 560ms ease;
}

.bar-section {
  width: 100%;
  min-height: 34px;
  border-color: rgba(222, 235, 248, 0.11);
  border-radius: 10px;
  color: var(--comp-muted);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--section-color) 20%, transparent), transparent 58%),
    rgba(4, 8, 13, 0.62);
  font-size: 0.78rem;
  font-weight: 760;
  padding: 0 8px;
  cursor: pointer;
}

.bar-section:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.bar-cell.is-playing {
  background: linear-gradient(180deg, rgba(243, 181, 92, 0.16), rgba(243, 181, 92, 0.045));
  box-shadow:
    inset 0 0 0 1px rgba(243, 181, 92, 0.3),
    inset 0 -4px 0 var(--section-color),
    0 12px 28px rgba(243, 181, 92, 0.08);
}

.bar-cell.is-playing .bar-label {
  color: var(--comp-text);
}

.bar-cell.is-playing input {
  border-color: rgba(243, 181, 92, 0.28);
  background: rgba(4, 8, 13, 0.58);
}

.bar-cell.is-playing.has-valid-chord input {
  border-color: rgba(126, 231, 135, 0.64);
  background:
    linear-gradient(180deg, rgba(126, 231, 135, 0.1), transparent 72%),
    rgba(4, 8, 13, 0.62);
}

.bar-cell.is-playing.has-invalid-chord input {
  border-color: rgba(255, 111, 125, 0.74);
}

@keyframes chord-valid-flash {
  0% {
    box-shadow:
      inset 0 0 0 1px rgba(126, 231, 135, 0.34),
      0 0 0 0 rgba(126, 231, 135, 0.48);
  }

  54% {
    box-shadow:
      inset 0 0 0 1px rgba(126, 231, 135, 0.28),
      0 0 0 8px rgba(126, 231, 135, 0.14);
  }

  100% {
    box-shadow:
      inset 0 0 0 1px rgba(126, 231, 135, 0.08),
      0 0 0 12px rgba(126, 231, 135, 0);
  }
}

@keyframes chord-invalid-flash {
  0% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 111, 125, 0.48),
      0 0 0 0 rgba(255, 111, 125, 0.56);
  }

  54% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 111, 125, 0.32),
      0 0 0 8px rgba(255, 111, 125, 0.18);
  }

  100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 111, 125, 0.16),
      0 0 0 12px rgba(255, 111, 125, 0);
  }
}

@keyframes playback-feedback-spin {
  to {
    transform: rotate(360deg);
  }
}

.status-error {
  color: var(--comp-danger);
}

.status-warning {
  color: var(--comp-warning);
}

.status-ok {
  color: var(--comp-teal);
}

@media (prefers-reduced-motion: reduce) {
  button,
  .bar-cell,
  .bar-cell input {
    transition: none;
  }

  .bar-cell.flash-valid input,
  .bar-cell.flash-invalid input {
    animation: none;
  }

  .playback-feedback-spinner {
    animation: none;
  }
}

@media (max-width: 1060px) {
  .comp-controls {
    grid-template-columns:
      minmax(92px, 0.66fr)
      minmax(114px, 0.78fr)
      minmax(70px, 0.32fr)
      minmax(66px, 0.24fr)
      minmax(70px, 0.26fr)
      minmax(58px, 0.22fr);
  }
}

@media (max-width: 820px) {
  .comp-shell {
    padding: 8px 10px calc(var(--fiume-footer-reserved, 56px) + 8px);
  }

  .comp-workbench {
    height: calc(100dvh - var(--fiume-footer-reserved, 56px) - 16px);
    padding: 10px;
    border-radius: 18px;
  }

  .comp-main {
    gap: 8px;
  }

  .comp-console {
    padding: 6px;
    border-radius: 14px;
  }

  .mixer-dialog {
    padding: 8px;
    border-radius: 14px;
  }

  .lyrics-dialog {
    padding: 8px;
    border-radius: 14px;
  }

  .rhythm-dialog {
    padding: 8px;
    border-radius: 14px;
  }

  .style-picker-dialog {
    padding: 8px;
    border-radius: 14px;
  }

  .comp-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .comp-song-field,
  .comp-style-field {
    grid-column: span 2;
  }

  .comp-field {
    padding: 4px 6px;
  }

  .comp-stage {
    padding: 12px 10px;
    border-radius: 14px;
  }

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

  .bar-cell {
    min-height: 118px;
    padding: 11px 8px 10px;
    gap: 7px;
  }

  .bar-cell.is-top-row-4 {
    border-top: 0;
  }

  .bar-cell.is-top-row-2 {
    border-top: 2px solid var(--comp-line-strong);
  }

  .bar-cell.is-row-end-4 {
    border-right: 0;
  }

  .bar-cell.is-row-end-2 {
    border-right: 2px solid var(--comp-line-strong);
  }

  .bar-cell.is-bottom-row-4 {
    border-bottom: 1px solid rgba(231, 240, 250, 0.16);
  }

  .bar-cell.is-bottom-row-2 {
    border-bottom: 2px solid var(--comp-line-strong);
  }
}

@media (max-width: 560px) {
  .comp-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .comp-style-field {
    grid-column: 1 / -1;
  }

  .comp-song-field {
    grid-column: 1 / -1;
  }

  .playbar {
    width: min(100%, 356px);
    grid-template-columns: repeat(4, 38px) 1px minmax(112px, 1fr);
    gap: 5px;
  }

  .playbar-button,
  .playbar-toggle {
    min-width: 38px;
  }

  .mixer-panel-head {
    grid-template-columns: 1fr;
  }

  .lyrics-panel-head {
    grid-template-columns: 1fr;
  }

  .rhythm-panel {
    align-items: end;
    padding-bottom: calc(var(--fiume-footer-reserved, 56px) + 10px);
  }

  .rhythm-dialog {
    width: 100%;
    max-height: min(84dvh, calc(100dvh - var(--fiume-footer-reserved, 56px) - 18px));
    border-radius: 18px 18px 12px 12px;
  }

  .rhythm-panel-head,
  .rhythm-title-block {
    grid-template-columns: 1fr;
  }

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

  .rhythm-form {
    grid-template-columns: 1fr;
  }

  .rhythm-mute-list,
  .rhythm-drums-list {
    grid-template-columns: 1fr;
  }

  .rhythm-drum-row {
    grid-template-columns: 58px minmax(0, 1fr) 46px;
  }

  .style-picker-panel {
    align-items: end;
    padding-bottom: calc(var(--fiume-footer-reserved, 56px) + 10px);
  }

  .style-picker-dialog {
    width: 100%;
    min-height: min(74dvh, calc(100dvh - var(--fiume-footer-reserved, 56px) - 18px));
    border-radius: 18px 18px 12px 12px;
  }

  .style-picker-head,
  .style-picker-title-block {
    grid-template-columns: 1fr;
  }

  .style-picker-browser {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
  }

  .style-category-rail {
    min-height: 48px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1px 2px 5px;
  }

  .style-category-tab {
    flex: 0 0 min(46vw, 168px);
    min-height: 42px;
  }

  .style-category-tab.is-active {
    box-shadow: inset 0 -3px 0 rgba(114, 216, 203, 0.72);
  }

  .style-options {
    grid-template-columns: 1fr;
  }

  .mixer-panel-title {
    grid-template-columns: 1fr;
  }

  .mixer {
    grid-auto-columns: minmax(126px, 148px);
  }

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

  .bar-cell,
  .bar-cell.is-row-end-2,
  .bar-cell.is-row-end-4 {
    border-right: 2px solid var(--comp-line-strong);
  }

  .bar-cell.is-top-row-2 {
    border-top: 0;
  }

  .bar-cell.is-first-cell {
    border-top: 2px solid var(--comp-line-strong);
  }

  .bar-cell.is-bottom-row-2 {
    border-bottom: 1px solid rgba(231, 240, 250, 0.16);
  }

  .bar-cell.is-last-cell {
    border-bottom: 2px solid var(--comp-line-strong);
  }
}

@media (max-height: 720px) and (min-width: 821px) {
  .bar-cell {
    min-height: 112px;
    gap: 7px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .bar-cell input {
    min-height: 42px;
  }

  .bar-section {
    min-height: 30px;
  }

  .mixer-dialog {
    min-height: min(456px, calc(100dvh - var(--fiume-footer-reserved, 56px) - 30px));
  }

  .mixer-volume input {
    height: min(150px, 24vh);
    min-height: 108px;
  }
}
