:root {
  --bg: #07101c;
  --bg-deep: #040a12;
  --panel: rgba(10, 18, 29, 0.88);
  --panel-strong: rgba(12, 21, 34, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --line: rgba(156, 177, 196, 0.18);
  --line-strong: rgba(126, 198, 208, 0.36);
  --text: #edf5f7;
  --muted: #91a6b3;
  --accent: #7ee0d0;
  --accent-strong: #c0893f;
  --accent-warm: #ebc47f;
  --good: #63d8a2;
  --danger: #f48b93;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-ui: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at 12% 14%, rgba(126, 224, 208, 0.16), transparent 24%),
    radial-gradient(circle at 82% 10%, rgba(192, 137, 63, 0.12), transparent 22%),
    radial-gradient(circle at 54% 100%, rgba(126, 224, 208, 0.06), transparent 26%),
    linear-gradient(180deg, #08101a 0%, #04070d 100%);
}

body.modal-open {
  overflow: hidden;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
}

h2 {
  font-size: 1.08rem;
}

h3 {
  font-size: 0.92rem;
}

label {
  display: block;
  margin-bottom: 0.24rem;
  color: var(--muted);
  font-size: 0.76rem;
}

button,
input,
select,
textarea {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(7, 14, 22, 0.92);
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.4rem 0.54rem;
}

textarea {
  resize: vertical;
  min-height: 3.7rem;
}

button {
  cursor: pointer;
  padding: 0.4rem 0.58rem;
  background: rgba(255, 255, 255, 0.045);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.action-row button,
.controls.compact button,
.controls.compact select {
  padding: 0.34rem 0.52rem;
  border-radius: 13px;
  font-size: 0.78rem;
}

.controls.compact select {
  width: auto;
  min-width: 6rem;
}

button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

button.primary {
  background: linear-gradient(135deg, rgba(126, 224, 208, 0.18), rgba(99, 216, 162, 0.18));
  border-color: rgba(126, 224, 208, 0.3);
}

button.warning {
  background: rgba(235, 196, 127, 0.12);
  border-color: rgba(235, 196, 127, 0.28);
  color: #ffe6b6;
}

button.danger {
  background: rgba(244, 139, 147, 0.12);
  border-color: rgba(244, 139, 147, 0.28);
  color: #ffd8dc;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(126, 224, 208, 0.65);
  outline-offset: 2px;
}

.ambient-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.4;
}

.ambient-a {
  width: 26rem;
  height: 26rem;
  left: -6rem;
  top: 2rem;
  background: rgba(126, 224, 208, 0.22);
}

.ambient-b {
  width: 22rem;
  height: 22rem;
  right: -4rem;
  top: 5rem;
  background: rgba(192, 137, 63, 0.18);
}

.ambient-c {
  width: 28rem;
  height: 28rem;
  left: 24%;
  bottom: -12rem;
  background: rgba(99, 216, 162, 0.12);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1880px;
  margin: 0 auto;
  padding: 0.48rem;
  display: grid;
  gap: 0.46rem;
}

.panel {
  background: linear-gradient(180deg, rgba(12, 22, 35, 0.94), rgba(7, 13, 21, 0.97));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 0.56rem;
  backdrop-filter: blur(18px);
}

.hero-panel {
  position: relative;
  z-index: 40;
  display: grid;
  gap: 0;
  padding: 0.42rem 0.56rem;
  overflow: visible;
}

.hero-header {
  position: relative;
  z-index: 41;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.48rem;
  flex-wrap: wrap;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 0.56rem;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 0.44rem;
  flex-wrap: wrap;
  min-width: 0;
}

.header-actions {
  position: relative;
  z-index: 42;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.header-actions > button,
.header-menu summary {
  min-height: 2.1rem;
  padding: 0.36rem 0.72rem;
}

.header-menu {
  position: relative;
  z-index: 43;
}

.header-menu[open] {
  z-index: 60;
}

.header-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 0.44rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.header-menu summary::-webkit-details-marker {
  display: none;
}

.header-menu-body {
  position: absolute;
  right: 0;
  top: calc(100% + 0.34rem);
  z-index: 70;
  min-width: 8.5rem;
  display: grid;
  gap: 0.28rem;
  padding: 0.4rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 22, 35, 0.98), rgba(7, 13, 21, 0.99));
  box-shadow: var(--shadow);
}

.header-menu-body button {
  width: 100%;
}

.badge-row,
.controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.badge,
.panel-count,
.legend-pill,
.session-chip {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.3rem 0.56rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.71rem;
}

.badge-row {
  display: none;
}

.badge-brand {
  background: rgba(126, 224, 208, 0.14);
  color: #d8fff8;
  border-color: rgba(126, 224, 208, 0.28);
}

.headline-row {
  display: flex;
  gap: 0.44rem;
  align-items: center;
}

.logo-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.8rem;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  background:
    linear-gradient(135deg, rgba(126, 224, 208, 0.18), rgba(192, 137, 63, 0.16)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.eyebrow {
  display: none;
}

.hero-text {
  display: none;
}

.title-stack {
  display: grid;
  gap: 0;
  min-width: 0;
}

.session-brief {
  display: none;
}

.session-note {
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.2;
}

.transport-card {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  display: flex;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.action-row {
  align-items: center;
  justify-content: flex-start;
  gap: 0.26rem;
  flex-wrap: nowrap;
}

.board-bottom-stack {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: auto;
  display: grid;
  gap: 0.24rem;
}

.hint-strip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.1rem;
  padding: 0.3rem 0.38rem;
  margin-bottom: 0.34rem;
  border: 1px solid rgba(126, 224, 208, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(9, 18, 29, 0.9), rgba(7, 13, 21, 0.95));
  overflow-x: auto;
}

.hint-strip.hidden {
  display: none;
}

.hint-pill {
  flex: 0 0 auto;
  padding: 0.26rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.hint-pill strong {
  color: #dffaf4;
}

.hint-dismiss {
  margin-left: auto;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 999px;
  font-size: 0.84rem;
  line-height: 1;
}

.control-strip {
  padding: 0.34rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8, 14, 23, 0.94), rgba(6, 11, 18, 0.97));
  box-shadow: 0 -12px 24px rgba(0, 0, 0, 0.18);
}

.control-row {
  overflow-x: auto;
  flex-wrap: nowrap;
  gap: 0.28rem;
}

.utility-strip {
  padding: 0.3rem 0.34rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(8, 14, 23, 0.9), rgba(6, 11, 18, 0.94));
  gap: 0.34rem;
  overflow-x: auto;
}

.tempo-chip,
.mini-slider {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  min-height: 2.35rem;
  padding: 0.28rem 0.48rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  flex: 0 0 auto;
}

.tempo-chip input,
.mini-slider input {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.tempo-chip input[type="number"] {
  width: 3.2rem;
  text-align: center;
  font-weight: 700;
  appearance: textfield;
  -moz-appearance: textfield;
}

.tempo-chip input[type="number"]::-webkit-outer-spin-button,
.tempo-chip input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.tempo-glyph,
.tempo-unit,
.mini-slider-label,
.mini-slider-value {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
}

.mini-slider-label {
  min-width: 1.15rem;
  color: #dffaf4;
  font-weight: 700;
}

.mini-slider-value {
  min-width: 2.3rem;
  text-align: right;
}

.mini-slider input[type="range"] {
  width: 4.3rem;
  accent-color: var(--accent);
}

.mini-slider.disabled {
  opacity: 0.46;
}

.hero-link {
  color: var(--muted);
  font-size: 0.72rem;
  text-decoration: none;
  white-space: nowrap;
}

.hero-link:hover {
  color: #dffaf4;
}

.dial-card {
  position: relative;
  width: 4rem;
  height: 4rem;
  flex: 0 0 auto;
}

.dial-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(126, 198, 208, 0.22);
  background:
    conic-gradient(from 220deg, rgba(126, 224, 208, 0.82) calc(var(--dial-fill, 0) * 1%), rgba(255, 255, 255, 0.06) 0),
    rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.dial-face::before {
  content: "";
  position: absolute;
  inset: 0.42rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(10, 18, 29, 0.96), rgba(7, 13, 21, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.dial-glyph,
.dial-value {
  position: relative;
  z-index: 1;
}

.dial-glyph {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1;
  margin-bottom: 0.08rem;
}

.dial-value {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.dial-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dial-card.disabled {
  opacity: 0.46;
}

.select-chip {
  min-width: 6.6rem;
  flex: 0 0 auto;
}

.fx-select {
  min-width: 10.8rem;
  margin-left: auto;
}

.select-chip select {
  height: 2.35rem;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
}

.strip-group {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  flex: 0 0 auto;
  min-width: 0;
}

.strip-label {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
}

.strip-select {
  min-width: 9rem;
}

.strip-select-wide {
  min-width: 13.2rem;
}

.utility-slider {
  min-width: 9.1rem;
}

.utility-slider-short {
  min-width: 8.2rem;
}

.utility-right {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  margin-left: auto;
}

.symbol-toggle {
  position: relative;
  width: 2.58rem;
  height: 2.58rem;
  flex: 0 0 auto;
}

.symbol-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.symbol-toggle span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 0.88rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.95rem;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.symbol-toggle input:checked + span {
  color: #dffaf4;
  border-color: rgba(126, 224, 208, 0.34);
  background: linear-gradient(135deg, rgba(126, 224, 208, 0.16), rgba(99, 216, 162, 0.14));
}

.toggle-chip {
  position: relative;
  min-height: 2.35rem;
  flex: 0 0 auto;
}

.toggle-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-chip span {
  min-width: 4.25rem;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.toggle-chip input:checked + span {
  color: #dffaf4;
  border-color: rgba(126, 224, 208, 0.34);
  background: linear-gradient(135deg, rgba(126, 224, 208, 0.16), rgba(99, 216, 162, 0.14));
}

.transport-card .action-row button {
  width: 2.2rem;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border-radius: 0.78rem;
  font-size: 0.82rem;
  line-height: 1;
}

.transport-card .action-row #exportProjectBtn {
  font-size: 0.68rem;
  letter-spacing: -0.02em;
}

.control-panel .toggle-row .footer-note,
.motif-grid .footer-note,
.panel > .footer-note {
  display: none;
}

.transport-dot,
.record-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  display: inline-block;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(99, 216, 162, 0.55);
}

.record-dot {
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(244, 139, 147, 0.6);
  margin-right: 0.45rem;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 12px rgba(244, 139, 147, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(244, 139, 147, 0);
  }
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.44rem;
}

.field-stack,
.control-stack,
.sidebar-stack {
  display: grid;
  gap: 0.44rem;
}

.stat,
.mini,
.preset-summary,
.scene-card,
.player-card,
.ensemble-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  border-radius: var(--radius-lg);
}

.stat,
.mini {
  padding: 0.65rem 0.75rem;
}

.stat-k {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.64rem;
}

.stat-v {
  margin-top: 0.3rem;
  font-size: 1.32rem;
  font-weight: 800;
}

.mini-v {
  font-size: 1.08rem;
}

.footer-note {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.18;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 0.32rem;
  align-items: center;
  margin-bottom: 0.3rem;
}

.workspace-layout,
.expand-grid {
  display: grid;
  gap: 0.46rem;
}

.workspace-layout {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 1.42fr) minmax(25rem, 30rem);
  align-items: stretch;
  min-height: 0;
}

.main-column,
.sidebar-column {
  display: grid;
  gap: 0.46rem;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.main-column {
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.expand-grid {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.sidebar-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  overflow: auto;
  height: 100%;
  overscroll-behavior: contain;
}

.sidebar-utility {
  display: grid;
  gap: 0.32rem;
  padding-bottom: 0.1rem;
}

.sidebar-select {
  min-width: 0;
}

.sidebar-slider {
  width: 100%;
  justify-content: space-between;
}

.sidebar-slider input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-picks {
  display: grid;
  gap: 0.28rem;
}

.expander-panel {
  min-height: 0;
  padding: 0.48rem;
  overflow: hidden;
}

.expander-summary,
.inline-expander-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: 0.96rem;
}

.expander-summary::-webkit-details-marker,
.inline-expander-summary::-webkit-details-marker {
  display: none;
}

.expander-summary::after,
.inline-expander-summary::after {
  content: "+";
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.expander-panel[open] > .expander-summary::after,
.inline-expander[open] > .inline-expander-summary::after {
  content: "−";
}

.expander-body,
.inline-expander-body {
  display: grid;
  gap: 0.34rem;
  margin-top: 0.42rem;
  min-height: 0;
}

.inline-expander {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.028);
  padding: 0.42rem 0.46rem;
}

.inline-expander[open] {
  background: rgba(255, 255, 255, 0.04);
}

.scene-tools,
.inline-tools {
  justify-content: flex-start;
}

#playerList {
  max-height: none;
}

#sceneList {
  max-height: 8.5rem;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
  padding: 0.34rem 0.46rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.toggle-grid {
  align-items: stretch;
}

.toggle-row-compact {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.34rem 0.52rem;
  gap: 0.44rem;
}

.toggle-row-compact strong {
  font-size: 0.78rem;
}

.toggle-row-compact input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.slider-row {
  display: grid;
  gap: 0.18rem;
}

.stage-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.orchestrator-canvas,
.pattern-wrap,
.score-wrap,
.scene-wrap {
  display: grid;
  gap: 0.34rem;
  align-content: start;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at 50% 0%, rgba(126, 224, 208, 0.08), transparent 42%);
  padding: 0.32rem;
}

.orchestrator-canvas.recording {
  box-shadow: inset 0 0 0 1px rgba(244, 139, 147, 0.3);
}

.live-staff-strip {
  --live-staff-page-height: 6.85rem;
  display: grid;
  gap: 0.26rem;
  padding: 0.28rem 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 20% 0%, rgba(126, 224, 208, 0.1), transparent 38%);
}

.live-staff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.44rem;
  min-width: 0;
  padding: 0 0.08rem;
}

.live-staff-head strong {
  min-width: 0;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-staff-head span {
  color: var(--muted);
  font-size: 0.66rem;
  white-space: nowrap;
}

.live-staff-window {
  overflow: visible;
  border-radius: 16px;
  border: 1px solid rgba(40, 52, 66, 0.14);
  background:
    linear-gradient(180deg, rgba(249, 251, 252, 0.98), rgba(234, 241, 244, 0.98)),
    radial-gradient(circle at top left, rgba(196, 165, 111, 0.14), transparent 24%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  padding: 0.34rem;
}

.live-staff-track {
  display: grid;
  gap: 0.44rem;
}

.live-staff-page {
  height: var(--live-staff-page-height);
  padding: 0.22rem 0.3rem;
  border-radius: 14px;
  border: 1px solid rgba(42, 56, 72, 0.08);
  background: rgba(255, 255, 255, 0.4);
  opacity: 1;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.live-staff-page.is-active {
  border-color: rgba(192, 137, 63, 0.32);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(192, 137, 63, 0.08);
}

.live-staff-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.live-step-band {
  fill: rgba(126, 224, 208, 0);
  transition: fill 140ms ease;
}

.live-step-band.current {
  fill: rgba(126, 224, 208, 0.16);
}

.live-step-label {
  fill: #66758a;
  font-size: 11px;
  font-family: var(--font-ui);
  transition: fill 140ms ease;
}

.live-step-label.current {
  fill: #b37a32;
  font-weight: 700;
}

.live-note ellipse,
.live-note line {
  fill: #111827;
  stroke: #111827;
  transition: fill 140ms ease, stroke 140ms ease;
}

.live-note.current ellipse,
.live-note.current line {
  fill: #b37a32;
  stroke: #b37a32;
}

.orchestrator-grid {
  display: grid;
  grid-template-columns: 7.35rem repeat(16, minmax(1.98rem, 1fr));
  gap: 0.16rem;
  min-width: 45rem;
}

.pattern-grid {
  display: grid;
  grid-template-columns: 4.6rem repeat(16, minmax(1.72rem, 1fr));
  gap: 0.14rem;
  min-width: 33rem;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(16, minmax(1.84rem, 1fr));
  gap: 0.16rem;
  min-width: 31rem;
}

.head,
.cell,
.rowhead,
.beat-box {
  min-height: 1.56rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.8);
  color: var(--text);
}

.head,
.cell,
.beat-box {
  display: grid;
  place-items: center;
}

.rowhead {
  display: grid;
  align-content: center;
  gap: 0.08rem;
  padding: 0.18rem 0.3rem;
  text-align: left;
  cursor: pointer;
}

.rowhead > div:first-child,
.scene-card-head > div:first-child {
  min-width: 0;
}

.rowhead strong,
.player-card-copy strong {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rowhead.selected,
.player-card.active,
.scene-card.active,
.ensemble-card.active {
  border-color: rgba(126, 224, 208, 0.38);
  box-shadow: inset 0 0 0 1px rgba(126, 224, 208, 0.16);
  background: linear-gradient(180deg, rgba(126, 224, 208, 0.12), rgba(255, 255, 255, 0.04));
}

.head.current,
.cell.current,
.beat-box.current {
  border-color: rgba(192, 137, 63, 0.55);
  box-shadow: inset 0 0 0 1px rgba(192, 137, 63, 0.18);
}

.cell {
  padding: 0;
  font-size: 0.58rem;
}

.cell.on {
  background: linear-gradient(135deg, rgba(126, 224, 208, 0.16), rgba(192, 137, 63, 0.14));
}

.rowhead.muted {
  opacity: 0.5;
  border-color: rgba(244, 139, 147, 0.22);
}

.rowhead.muted strong {
  color: #c9d0d5;
}

.rowhead.selected.muted {
  box-shadow: inset 0 0 0 1px rgba(244, 139, 147, 0.16);
}

.cell.muted {
  opacity: 0.34;
}

.cell.scene-off {
  opacity: 0.36;
}

.section-chip,
.tag,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.2rem 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.66rem;
}

.pill.solo {
  color: #ffe7ae;
  border-color: rgba(235, 196, 127, 0.2);
  background: rgba(235, 196, 127, 0.12);
}

.pill.mute {
  color: #ffd8dc;
  border-color: rgba(244, 139, 147, 0.2);
  background: rgba(244, 139, 147, 0.12);
}

.player-list,
.scene-list,
.motif-grid {
  display: grid;
  gap: 0.26rem;
}

.list-slider {
  display: none;
}

.list-slider input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.player-card-main {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 0.38rem;
  align-items: center;
  cursor: pointer;
}

.player-card-copy {
  min-width: 0;
}

.player-card.active {
  padding-bottom: 0.52rem;
}

.player-card.expandable .player-card-main {
  user-select: none;
}

.player-inline-editor {
  margin-top: 0.44rem;
  padding-top: 0.46rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 0.34rem;
}

.player-editor-meta {
  display: flex;
  justify-content: flex-start;
  gap: 0.24rem;
  margin-bottom: 0.1rem;
}

.player-editor-summary {
  display: flex;
  gap: 0.24rem;
  flex-wrap: wrap;
}

.instrument-visual {
  display: grid;
  gap: 0.28rem;
}

.instrument-frame {
  position: relative;
  overflow: hidden;
  min-height: 6rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 30% 25%, var(--art-glow), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 55%),
    linear-gradient(180deg, var(--art-top), var(--art-bottom));
}

.instrument-frame::after {
  content: "";
  position: absolute;
  inset: auto -10% -38% auto;
  width: 75%;
  height: 75%;
  border-radius: 999px;
  background: radial-gradient(circle, var(--art-glow), transparent 72%);
  pointer-events: none;
}

.instrument-frame svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.instrument-visual.compact .instrument-frame {
  min-height: 2.86rem;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, var(--art-top), var(--art-bottom));
}

.instrument-visual.compact .instrument-frame::after {
  display: none;
}

.instrument-glyph {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.instrument-visual.compact .instrument-glyph {
  font-size: 1.62rem;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.14));
}

.instrument-visual.compact .instrument-frame svg {
  padding: 0.18rem;
}

.instrument-caption {
  display: grid;
  gap: 0.1rem;
}

.instrument-caption strong {
  font-size: 0.8rem;
}

.instrument-caption span {
  color: var(--muted);
  font-size: 0.66rem;
}

.scene-card,
.player-card,
.preset-summary {
  padding: 0.42rem 0.46rem;
}

.player-card .controls.action-row {
  justify-content: flex-start;
}

.tags {
  display: flex;
  gap: 0.24rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.scene-card {
  cursor: pointer;
}

.scene-card p {
  display: none;
}

.scene-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.42rem;
  align-items: center;
}

.beat-box {
  min-height: 2.34rem;
  cursor: pointer;
}

.beat-box.active {
  background: rgba(99, 216, 162, 0.12);
  border-color: rgba(99, 216, 162, 0.24);
  color: #dfffe5;
}

.motif-grid button {
  text-align: left;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem;
  color: var(--muted);
  text-align: center;
}

.footer-bar {
  display: none;
}

.utility-stack {
  display: grid;
  gap: 0.32rem;
  min-height: 0;
  overflow: auto;
}

.inline-note {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.utility-divider {
  display: flex;
  justify-content: space-between;
  gap: 0.44rem;
  align-items: baseline;
  padding-top: 0.08rem;
}

.notes-field textarea {
  min-height: 2.75rem;
}

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

.stage-panel,
.sidebar-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.player-list,
#sectionEditor,
.scene-list,
.motif-grid {
  overflow: auto;
  min-height: 0;
}

#sectionEditor,
.player-list,
.motif-grid,
.pattern-wrap,
.score-wrap,
.orchestrator-canvas,
.utility-stack {
  flex: 1;
}

.pattern-wrap,
.score-wrap,
.scene-wrap,
.orchestrator-canvas,
.utility-stack {
  min-height: 0;
  flex: 1;
}

#titleDisplay {
  font-size: 1.06rem;
  line-height: 1;
}

.toast {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 20;
  min-width: 14rem;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(126, 224, 208, 0.28);
  background: rgba(7, 14, 22, 0.96);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  box-shadow: var(--shadow);
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 7, 13, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(38rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 0.8rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 22, 35, 0.98), rgba(7, 13, 21, 0.99));
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 0.48rem;
  align-items: center;
  margin-bottom: 0.54rem;
}

.modal-head button {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 0.76rem;
}

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

.modal-actions {
  justify-content: flex-end;
  margin-top: 0.7rem;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast[data-tone="danger"] {
  border-color: rgba(244, 139, 147, 0.34);
}

.toast[data-tone="success"] {
  border-color: rgba(99, 216, 162, 0.34);
}

.hidden {
  display: none !important;
}

@media (min-width: 1280px) {
  html,
  body {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    max-width: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .workspace-layout {
    grid-row: 2;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }
}

@media (max-width: 1180px) {
  .workspace-layout,
  .expand-grid {
    grid-template-columns: 1fr;
  }

  .stage-panel {
    min-height: auto;
  }

  .sidebar-column {
    min-height: 0;
  }

  .sidebar-panel {
    max-height: min(44rem, 50vh);
  }
}

@media (max-width: 980px) {
  .field-grid,
  .footer-bar {
    grid-template-columns: 1fr;
  }

  .headline-row,
  .panel-head,
  .footer-bar {
    flex-direction: column;
    align-items: start;
  }

  body {
    overflow: auto;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0.44rem;
  }

  .panel {
    padding: 0.56rem;
    border-radius: 24px;
  }

  .live-staff-strip {
    --live-staff-page-height: 6.2rem;
  }

  .live-staff-head {
    align-items: start;
    flex-direction: column;
  }

  .badge-row,
  .controls {
    gap: 0.32rem;
  }

  .headline-row {
    align-items: start;
  }

  .hero-header {
    gap: 0.38rem;
  }

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

  .select-chip {
    min-width: 6.8rem;
  }

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

  button {
    width: 100%;
  }

  .action-row button,
  .controls.compact button {
    width: auto;
  }

  .orchestrator-grid {
    min-width: 45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
