/*
 * SoundLoom DAW redesign.
 * Static output of the Tailwind design layer; tokens match tailwind.config.js.
 */

:root {
  --studio-canvas: #0D0F16;
  --studio-panel: rgba(23, 26, 36, 0.85);
  --studio-panel-solid: #171A24;
  --studio-surface: #11141D;
  --studio-line: #2A2F3D;
  --studio-mint: #2EC790;
  --studio-mint-hover: #1F9C70;
  --studio-violet: #818CF8;
  --studio-primary: #FFFFFF;
  --studio-secondary: #D1D5DB;
  --studio-muted: #6B7280;
  --studio-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  --studio-panel-radius: 14px;
  --studio-card-radius: 10px;
  --studio-control-radius: 6px;
  --studio-field-radius: 8px;
  --studio-motion: 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --paper: var(--studio-panel-solid);
  --ink: var(--studio-primary);
  --muted: var(--studio-muted);
  --line: var(--studio-line);
  --accent: var(--studio-mint);
}

html {
  min-width: 320px;
  background: var(--studio-canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--studio-canvas);
  color: var(--studio-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
}

body *,
body *::before,
body *::after {
  box-sizing: border-box;
}

body button,
body input,
body select,
body textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

body button,
body a,
body input[type="range"],
body select {
  -webkit-tap-highlight-color: transparent;
}

body button {
  cursor: pointer;
}

body a {
  color: inherit;
  text-decoration: none;
}

body :focus-visible {
  outline: 2px solid var(--studio-mint);
  outline-offset: 2px;
}

body .hidden {
  display: none !important;
}

body .kicker,
body .hero-eyebrow {
  margin: 0;
  color: var(--studio-mint);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-transform: uppercase;
}

body .primary-button,
body .nav-cta {
  min-height: 44px;
  border: 1px solid var(--studio-mint);
  border-radius: var(--studio-control-radius);
  background: var(--studio-mint);
  box-shadow: none;
  color: var(--studio-canvas);
  font-size: 14px;
  font-weight: 700;
  transition: background var(--studio-motion), border-color var(--studio-motion), transform var(--studio-motion);
}

body .primary-button:hover,
body .nav-cta:hover {
  border-color: var(--studio-mint-hover);
  background: var(--studio-mint-hover);
  transform: translateY(-1px);
}

body .ghost-button,
body .icon-button,
body .mini-button,
body .link-button {
  min-height: 44px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-control-radius);
  background: rgba(17, 20, 29, 0.78);
  box-shadow: none;
  color: var(--studio-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: color var(--studio-motion), border-color var(--studio-motion), background var(--studio-motion), transform var(--studio-motion);
}

body .ghost-button:hover,
body .icon-button:hover,
body .mini-button:hover,
body .link-button:hover {
  border-color: var(--studio-mint);
  background: rgba(46, 199, 144, 0.08);
  color: var(--studio-primary);
}

/* Navigation: 85% glass material and a stable 4px-grid height. */
body .site-nav {
  position: sticky;
  z-index: 40;
  top: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: min(1440px, calc(100% - 48px));
  min-height: 64px;
  margin: 12px auto 0;
  padding: 8px 12px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-panel-radius);
  background: var(--studio-panel);
  box-shadow: var(--studio-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 184px;
}

body .brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--studio-line);
  border-radius: 10px;
  object-fit: cover;
}

body .brand > span {
  display: grid;
  gap: 0;
}

body .brand strong {
  color: var(--studio-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
}

body .brand small {
  color: var(--studio-muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
}

body .site-nav nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

body .site-nav nav a {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: var(--studio-control-radius);
  color: var(--studio-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  transition: color var(--studio-motion), background var(--studio-motion);
}

body .site-nav nav a:hover,
body .site-nav nav a.active {
  background: rgba(46, 199, 144, 0.08);
  color: var(--studio-primary);
}

body .site-nav nav a.active::after {
  display: block;
  width: 16px;
  height: 2px;
  margin: 3px auto -5px;
  border-radius: 2px;
  background: var(--studio-mint);
  content: "";
}

body .nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body .language-select-label {
  display: block;
  min-width: 112px;
}

body .language-select-label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

body .language-select-label select,
body .daw-select,
body .library-filter-bar select,
body .auth-field input,
body .auth-field select,
body .auth-field textarea,
body .birthday-gift-row input,
body .comment-row input {
  min-height: 44px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-field-radius);
  background: var(--studio-surface);
  color: var(--studio-secondary);
}

body .language-select-label select {
  width: 100%;
  padding: 0 32px 0 12px;
}

body .account-avatar-button,
body .account-avatar-large,
body .clip-remove {
  border-color: var(--studio-line);
  background: var(--studio-surface);
  color: var(--studio-secondary);
}

body .account-avatar-button {
  width: 44px;
  height: 44px;
}

body .mobile-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-control-radius);
  background: var(--studio-surface);
  color: var(--studio-secondary);
  font-size: 20px;
}

body .account-menu {
  z-index: 70;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-card-radius);
  background: rgba(23, 26, 36, 0.98);
  box-shadow: var(--studio-shadow);
  color: var(--studio-secondary);
}

/* Single-view routing prevents the tool, library, and landing content from competing. */
body .app-view {
  display: none !important;
}

body[data-active-view="home"] [data-view="home"] {
  display: block !important;
}

body[data-active-view="studio"] [data-view="studio"] {
  display: grid !important;
}

body[data-active-view="library"] [data-view="library"] {
  display: block !important;
}

/* Voice-to-MIDI is the whole product surface for this focused release. */
body .focus-hidden,
body .marketing-view,
body[data-active-view="library"] [data-view="library"] {
  display: none !important;
}

/* Landing hero: one promise, two actions, and a restrained woven waveform. */
body .landing-view {
  position: relative;
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 80px;
  overflow: hidden;
}

body .hero-wave-canvas {
  position: absolute;
  z-index: 0;
  inset: 0 0 auto;
  width: 100%;
  height: 640px;
  opacity: 0.62;
  pointer-events: none;
}

body .hero-weave-mark {
  position: absolute;
  z-index: 0;
  top: 104px;
  right: 5%;
  width: 176px;
  height: 132px;
  opacity: 0.16;
  transform: rotate(-7deg);
}

body .hero-weave-mark span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 38px;
  border: 1px solid var(--studio-mint);
  border-right-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
}

body .hero-weave-mark span:nth-child(1) { top: 0; }
body .hero-weave-mark span:nth-child(2) { top: 40px; transform: scaleX(0.82); }
body .hero-weave-mark span:nth-child(3) { top: 80px; transform: scaleX(0.64); }

body .hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 520px;
  max-width: 920px;
  margin: 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

body .hero-content h1 {
  max-width: 920px;
  margin: 20px 0 20px;
  color: var(--studio-primary);
  font-size: 64px;
  font-weight: 700;
  line-height: 68px;
}

body .hero-description {
  max-width: 704px;
  margin: 0;
  color: var(--studio-secondary);
  font-size: 17px;
  line-height: 28px;
}

body .hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

body .hero-actions button {
  min-height: 48px;
  padding: 0 24px;
}

body .hero-feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

body .hero-feature-card {
  position: relative;
  min-height: 240px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-card-radius);
  background: var(--studio-panel);
  box-shadow: var(--studio-shadow);
  backdrop-filter: blur(16px);
  transition: border-color var(--studio-motion), transform var(--studio-motion);
}

body .hero-feature-card:hover {
  border-color: rgba(46, 199, 144, 0.55);
  transform: translateY(-2px);
}

body .feature-index {
  color: var(--studio-violet);
  font-size: 12px;
  font-weight: 700;
}

body .hero-feature-card h2 {
  margin: 48px 0 8px;
  color: var(--studio-primary);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

body .hero-feature-card p {
  min-height: 48px;
  margin: 0;
  color: var(--studio-muted);
  line-height: 24px;
}

body .hero-feature-card > button {
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--studio-secondary);
  font-weight: 600;
}

body .hero-feature-card > button:hover {
  color: var(--studio-mint);
}

body .mini-weave,
body .mini-wave-bars,
body .mini-control-lines {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 104px;
  height: 56px;
  opacity: 0.72;
}

body .mini-weave i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 22px;
  border-top: 2px solid var(--studio-mint);
  border-radius: 50%;
}

body .mini-weave i:nth-child(2) { top: 14px; transform: scaleX(0.8); }
body .mini-weave i:nth-child(3) { top: 28px; transform: scaleX(0.6); }

body .mini-wave-bars {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

body .mini-wave-bars i {
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: var(--studio-mint);
}

body .mini-wave-bars i:nth-child(2),
body .mini-wave-bars i:nth-child(6) { height: 28px; }
body .mini-wave-bars i:nth-child(3),
body .mini-wave-bars i:nth-child(5) { height: 42px; }
body .mini-wave-bars i:nth-child(4) { height: 52px; background: var(--studio-violet); }

body .mini-control-lines {
  display: grid;
  align-content: center;
  gap: 12px;
}

body .mini-control-lines i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--studio-line);
}

body .mini-control-lines i::after {
  display: block;
  width: 10px;
  height: 10px;
  margin-top: -4px;
  margin-left: 64%;
  border-radius: 50%;
  background: var(--studio-mint);
  content: "";
}

body .mini-control-lines i:nth-child(2)::after { margin-left: 28%; background: var(--studio-violet); }
body .mini-control-lines i:nth-child(3)::after { margin-left: 78%; }

/* Workspace: left assets, center editor, right parameters. */
body .app-shell {
  grid-template-columns: 264px minmax(560px, 1fr) 288px;
  align-items: start;
  gap: 16px;
  width: min(1600px, calc(100% - 48px));
  margin: 24px auto 0;
  padding: 0 0 112px;
}

body .studio {
  grid-column: 2;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body .side {
  position: sticky;
  top: 92px;
  grid-column: 1;
  grid-row: 1;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--studio-line) transparent;
}

body .daw-parameters {
  position: sticky;
  top: 92px;
  grid-column: 3;
  grid-row: 1;
  padding: 20px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-panel-radius);
  background: var(--studio-panel);
  box-shadow: var(--studio-shadow);
  backdrop-filter: blur(16px);
}

body .topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

body .topbar h2 {
  max-width: 720px;
  margin: 8px 0 8px;
  color: var(--studio-primary);
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
}

body .headline-subtitle {
  max-width: 700px;
  margin: 0;
  color: var(--studio-muted);
  font-size: 14px;
  line-height: 22px;
}

body .transport {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 248px;
}

body .transport button {
  padding: 0 14px;
}

body .transport .icon-button {
  width: 44px;
  padding: 0;
}

body .asset-rail-toggle {
  display: none;
}

body .linear-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 56px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-card-radius);
  background: rgba(23, 26, 36, 0.62);
}

body .linear-progress-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid var(--studio-line);
  background: transparent;
  color: var(--studio-muted);
}

body .linear-progress-step:last-child { border-right: 0; }

body .linear-progress-step span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--studio-line);
  border-radius: 50%;
  font-size: 12px;
}

body .linear-progress-step strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .linear-progress-step.active,
body .linear-progress-step.done {
  border-color: var(--studio-line);
  background: rgba(46, 199, 144, 0.08);
  color: var(--studio-secondary);
}

body .linear-progress-step.active span,
body .linear-progress-step.done span {
  border-color: var(--studio-mint);
  background: var(--studio-mint);
  color: var(--studio-canvas);
}

body .capture-panel,
body .flow-panel,
body .melody-panel,
body .sound-id-panel,
body .controls-grid > .panel,
body .side > .panel {
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-panel-radius);
  background: var(--studio-panel);
  box-shadow: var(--studio-shadow);
  color: var(--studio-secondary);
  backdrop-filter: blur(16px);
}

body .capture-panel {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  background: #11141D;
}

body .capture-panel::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image:
    linear-gradient(rgba(42, 47, 61, 0.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 47, 61, 0.2) 1px, transparent 1px);
  background-size: 100% 48px, 48px 100%;
  content: "";
  pointer-events: none;
}

body #waveCanvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.84;
  filter: drop-shadow(0 0 8px rgba(46, 199, 144, 0.14));
}

body .record-ring {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

body .record-button,
body .capture-next-button,
body .capture-count,
body .capture-guide {
  pointer-events: auto;
}

body .record-button {
  position: relative;
  display: flex;
  width: 240px;
  height: 240px;
  min-height: 240px;
  padding: 28px 20px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(46, 199, 144, 0.54);
  border-radius: 50%;
  background: rgba(23, 26, 36, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 0 0 8px rgba(46, 199, 144, 0.04);
  color: var(--studio-primary);
  touch-action: none;
  transition: border-color var(--studio-motion), background var(--studio-motion), transform var(--studio-motion);
}

body .record-button:hover,
body .record-button.recording,
body .record-button.is-recording {
  border-color: var(--studio-mint);
  background: rgba(31, 156, 112, 0.18);
}

body .record-button:active {
  transform: scale(0.99);
}

body #recordGlyph {
  color: var(--studio-mint);
  font-size: 22px;
}

body .record-wave {
  width: 160px;
  height: 48px;
  margin: 8px 0;
  border: 1px solid rgba(42, 47, 61, 0.7);
  border-radius: var(--studio-control-radius);
  background: rgba(13, 15, 22, 0.5);
}

body .record-live-text,
body .record-timer,
body .record-button small {
  color: var(--studio-muted);
  font-size: 12px;
  line-height: 18px;
}

body .record-button strong {
  max-width: 176px;
  margin-top: 4px;
  color: var(--studio-primary);
  font-size: 15px;
  line-height: 20px;
  text-align: center;
}

body .capture-guide {
  position: absolute;
  top: 20px;
  left: 20px;
  display: grid;
  gap: 4px;
  max-width: 280px;
  color: var(--studio-secondary);
}

body .capture-guide strong { font-size: 13px; }
body .capture-guide span { color: var(--studio-muted); font-size: 12px; line-height: 18px; }

body .capture-count {
  position: absolute;
  top: 20px;
  right: 20px;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(129, 140, 248, 0.36);
  border-radius: var(--studio-control-radius);
  background: rgba(129, 140, 248, 0.1);
  color: var(--studio-secondary);
  font-size: 12px;
  font-weight: 600;
}

body .capture-next-button {
  position: absolute;
  right: 20px;
  bottom: 20px;
  min-width: 160px;
  padding: 0 20px;
}

body .capture-next-button:disabled,
body .daw-generate-button:disabled {
  cursor: not-allowed;
  border-color: var(--studio-line);
  background: var(--studio-line);
  color: var(--studio-muted);
  transform: none;
}

body .capture-copy {
  position: absolute;
  z-index: 2;
  bottom: 20px;
  left: 20px;
  max-width: 440px;
  padding: 0;
  background: transparent;
}

body .capture-copy h2 {
  margin: 0 0 6px;
  color: var(--studio-primary);
  font-size: 18px;
  line-height: 24px;
}

body .capture-copy p {
  margin: 0;
  color: var(--studio-muted);
  font-size: 13px;
  line-height: 20px;
}

body .record-confirm {
  z-index: 10;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-card-radius);
  background: rgba(23, 26, 36, 0.98);
  box-shadow: var(--studio-shadow);
}

body .flow-panel,
body .melody-panel,
body .sound-id-panel {
  margin-top: 12px;
  padding: 16px;
}

body .flow-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body .flow-step {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-card-radius);
  background: rgba(17, 20, 29, 0.6);
}

body .flow-step.active {
  border-color: rgba(46, 199, 144, 0.58);
  background: rgba(46, 199, 144, 0.07);
}

body .flow-step span { color: var(--studio-mint); }
body .flow-step strong { color: var(--studio-primary); }
body .flow-step small { color: var(--studio-muted); }

body .flow-actions,
body .next-step-hint,
body .arrangement-status {
  grid-column: 1 / -1;
}

body .flow-actions {
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) 1fr auto;
  gap: 8px;
}

body .flow-actions button { min-height: 44px; }

body .next-step-hint,
body .arrangement-status {
  margin: 0;
  color: var(--studio-muted);
  font-size: 12px;
  line-height: 18px;
}

body .melody-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.2fr);
  gap: 16px;
}

body .melody-copy strong { color: var(--studio-primary); }
body .melody-copy p { color: var(--studio-muted); line-height: 22px; }

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

body .seed-mode,
body .scene,
body .option-chip,
body .role-chip,
body .recipe {
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-control-radius);
  background: var(--studio-surface);
  color: var(--studio-secondary);
  box-shadow: none;
}

body .seed-mode.active,
body .scene.active,
body .option-chip.active,
body .role-chip.active,
body .recipe.on {
  border-color: rgba(46, 199, 144, 0.6);
  background: rgba(46, 199, 144, 0.09);
  color: var(--studio-primary);
}

body .seed-mode span,
body .scene small { color: var(--studio-muted); }

body .sound-id-panel .taxonomy-card {
  display: none !important;
}

body .sound-id-panel,
body .controls-grid > .scene-panel,
body .controls-grid > .smart-panel {
  display: none !important;
}

body .sound-lanes,
body .fingerprint,
body .identity-grid,
body .arranger-card,
body .advice-card {
  border-color: var(--studio-line);
  background: transparent;
  color: var(--studio-secondary);
}

body .identity-grid > div,
body .arranger-card,
body .advice-card {
  border: 0;
  border-top: 1px solid var(--studio-line);
  border-radius: 0;
  background: transparent;
}

body .identity-grid strong,
body .arranger-card strong,
body .advice-card strong { color: var(--studio-primary); }
body .identity-grid small,
body .arranger-card small,
body .advice-card small { color: var(--studio-muted); }

body .controls-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

body .controls-grid > .mixer-panel {
  max-width: none;
}

body .controls-grid > .panel,
body .side > .panel {
  padding: 16px;
}

body .panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

body .panel-title span {
  color: var(--studio-primary);
  font-size: 15px;
  font-weight: 700;
}

body .panel-title small { color: var(--studio-muted); font-size: 12px; }

body .scene-tabs,
body .option-row {
  display: grid;
  gap: 8px;
}

body .scene-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body .compact-tabs { grid-template-columns: 1fr; }

body .scene {
  min-height: 68px;
  padding: 10px;
  text-align: left;
}

body .option-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body .option-chip { min-height: 36px; padding: 6px 8px; font-size: 12px; }

body .mode-toggle {
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-field-radius);
  background: var(--studio-surface);
}

body .advanced-sliders {
  display: none !important;
}

body .clip,
body .history-item,
body .community-card {
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-card-radius);
  background: var(--studio-surface);
  color: var(--studio-secondary);
  box-shadow: none;
}

body .clip strong,
body .history-item strong,
body .community-card strong { color: var(--studio-primary); }
body .clip small,
body .history-item small,
body .community-card small { color: var(--studio-muted); }

body .clip-orb {
  background: var(--studio-mint) !important;
  opacity: 0.8;
  filter: none;
}

body .empty-state {
  min-height: 180px;
  border: 1px dashed var(--studio-line);
  border-radius: var(--studio-card-radius);
  background: rgba(17, 20, 29, 0.36);
  color: var(--studio-muted);
}

body .recipe-stack { display: grid; gap: 6px; }
body .recipe { min-height: 36px; padding: 8px 10px; }

body .parameters-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--studio-line);
}

body .parameters-heading h2 {
  margin: 6px 0 0;
  color: var(--studio-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
}

body .parameter-close {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-control-radius);
  background: var(--studio-surface);
  color: var(--studio-secondary);
}

body .parameter-group {
  margin: 0;
  padding: 20px 0;
  border: 0;
  border-bottom: 1px solid var(--studio-line);
}

body .parameter-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

body .parameter-group label,
body .parameter-group legend {
  color: var(--studio-secondary);
  font-size: 13px;
  font-weight: 600;
}

body .parameter-group output {
  width: 64px;
  color: var(--studio-muted);
  font-size: 12px;
  text-align: right;
}

body .daw-slider {
  width: 100%;
  height: 4px;
  margin: 8px 0;
  appearance: none;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--studio-mint) var(--range-value, 50%), var(--studio-line) var(--range-value, 50%));
}

body .daw-slider::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  appearance: none;
  border: 2px solid var(--studio-panel-solid);
  border-radius: 50%;
  background: var(--studio-mint);
  box-shadow: none;
}

body .daw-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--studio-panel-solid);
  border-radius: 50%;
  background: var(--studio-mint);
}

body .parameter-field-group {
  display: grid;
  gap: 10px;
}

body .daw-select {
  width: 100%;
  padding: 0 12px;
}

body .duration-group legend { margin-bottom: 12px; }

body .duration-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-field-radius);
  background: var(--studio-surface);
}

body .duration-segments button {
  min-height: 36px;
  border: 0;
  border-radius: var(--studio-control-radius);
  background: transparent;
  color: var(--studio-muted);
  font-size: 12px;
  font-weight: 600;
}

body .duration-segments button.active {
  background: rgba(129, 140, 248, 0.16);
  color: var(--studio-secondary);
}

body .parameter-summary {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  padding: 20px 0;
}

body .summary-pulse {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--studio-mint);
  opacity: 0.5;
  animation: studio-breathe 4.8s ease-in-out infinite;
}

body .parameter-summary div { display: grid; gap: 4px; min-width: 0; }
body .parameter-summary strong { overflow: hidden; color: var(--studio-secondary); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
body .parameter-summary small { color: var(--studio-muted); font-size: 11px; line-height: 16px; }
body .daw-generate-button { width: 100%; padding: 0 16px; }

/* Sound library: equal cards and one concise filter row. */
body .library-view {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 112px;
}

body .library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

body .library-heading h1 {
  max-width: 760px;
  margin: 8px 0 8px;
  color: var(--studio-primary);
  font-size: 42px;
  font-weight: 700;
  line-height: 48px;
}

body .library-heading p {
  margin: 0;
  color: var(--studio-muted);
  line-height: 24px;
}

body .library-heading > button { padding: 0 20px; }

body .library-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-panel-radius);
  background: var(--studio-panel);
  box-shadow: var(--studio-shadow);
  backdrop-filter: blur(16px);
}

body .library-filter-bar label {
  display: grid;
  min-width: 180px;
  gap: 6px;
}

body .library-filter-bar label span {
  color: var(--studio-muted);
  font-size: 11px;
  font-weight: 600;
}

body .library-filter-bar select {
  min-width: 180px;
  padding: 0 12px;
}

body .library-filter-bar p {
  margin: 0 0 12px auto;
  color: var(--studio-muted);
  font-size: 12px;
}

body .library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

body .library-card {
  display: flex;
  min-height: 296px;
  padding: 20px;
  flex-direction: column;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-card-radius);
  background: var(--studio-panel);
  box-shadow: var(--studio-shadow);
  transition: border-color var(--studio-motion), transform var(--studio-motion);
}

body .library-card:hover,
body .library-card.is-playing {
  border-color: rgba(46, 199, 144, 0.6);
  transform: translateY(-2px);
}

body .library-card-topline,
body .library-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body .library-card-topline span,
body .library-card-topline time {
  color: var(--studio-muted);
  font-size: 11px;
  font-weight: 600;
}

body .library-mini-wave {
  display: flex;
  height: 72px;
  margin: 20px 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  border-top: 1px solid rgba(42, 47, 61, 0.6);
  border-bottom: 1px solid rgba(42, 47, 61, 0.6);
}

body .library-mini-wave i {
  width: 3px;
  min-height: 4px;
  border-radius: 3px;
  background: rgba(46, 199, 144, 0.7);
  filter: drop-shadow(0 0 4px rgba(46, 199, 144, 0.2));
  transition: height 320ms ease;
}

body .library-card.is-playing .library-mini-wave i {
  animation: library-wave 1.8s ease-in-out infinite alternate;
  animation-delay: calc(var(--bar-index, 0) * -80ms);
}

body .library-card-copy { flex: 1; }
body .library-card-copy h2 { margin: 0 0 6px; color: var(--studio-primary); font-size: 18px; line-height: 24px; }
body .library-card-copy p { margin: 0; color: var(--studio-muted); font-size: 13px; line-height: 20px; }

body .library-card-footer { margin-top: 20px; }
body .library-card-footer > div { display: flex; flex-wrap: wrap; gap: 6px; }
body .library-card-footer > div span {
  padding: 4px 8px;
  border: 1px solid rgba(129, 140, 248, 0.32);
  border-radius: var(--studio-control-radius);
  background: rgba(129, 140, 248, 0.08);
  color: var(--studio-secondary);
  font-size: 11px;
}

body .library-preview-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--studio-mint);
  border-radius: 50%;
  background: transparent;
  color: var(--studio-mint);
  font-size: 14px;
}

body .library-preview-button:hover,
body .library-preview-button[aria-pressed="true"] {
  background: var(--studio-mint);
  color: var(--studio-canvas);
}

/* Marketing content shares the system but remains visually subordinate to the tool. */
body .proof-band,
body .site-section,
body .site-footer {
  width: min(1200px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

body .proof-band {
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-panel-radius);
  background: var(--studio-panel);
  box-shadow: var(--studio-shadow);
}

body .proof-band div,
body .use-grid article,
body .intelligence-strip article,
body .birthday-card,
body .birthday-preview,
body .privacy-copy {
  border-color: var(--studio-line);
  background: var(--studio-panel);
  color: var(--studio-secondary);
  box-shadow: none;
}

body .proof-band strong,
body .section-heading h2,
body .use-grid h3,
body .intelligence-strip strong,
body .birthday-preview h3 { color: var(--studio-primary); }

body .proof-band span,
body .use-grid p,
body .privacy-copy p,
body .intelligence-strip span,
body .language-note span,
body .birthday-note { color: var(--studio-muted); }

body .site-footer { border-color: var(--studio-line); color: var(--studio-muted); }

/* Bottom transport is visible only in the studio and never masks modal layers. */
body .daw-bottom-transport {
  position: fixed;
  z-index: 45;
  right: 50%;
  bottom: 16px;
  display: none;
  grid-template-columns: 44px auto minmax(160px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 12px;
  width: min(880px, calc(100% - 32px));
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-panel-radius);
  background: rgba(23, 26, 36, 0.96);
  box-shadow: var(--studio-shadow);
  backdrop-filter: blur(16px);
  transform: translateX(50%);
}

body[data-active-view="studio"] .daw-bottom-transport { display: grid; }

body .bottom-icon-button,
body .bottom-record-button,
body .bottom-generate-button,
body .bottom-export-button,
body .bottom-parameters-button {
  min-height: 44px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-control-radius);
  background: var(--studio-surface);
  color: var(--studio-secondary);
  font-size: 13px;
  font-weight: 600;
}

body .bottom-icon-button {
  width: 44px;
  padding: 0;
  border-color: var(--studio-mint);
  color: var(--studio-mint);
}

body .bottom-icon-button[aria-pressed="true"],
body .bottom-generate-button {
  border-color: var(--studio-mint);
  background: var(--studio-mint);
  color: var(--studio-canvas);
}

body .bottom-time {
  width: 88px;
  color: var(--studio-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

body .bottom-progress-track {
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--studio-line);
}

body .bottom-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--studio-mint);
}

body .bottom-record-button,
body .bottom-generate-button,
body .bottom-export-button,
body .bottom-parameters-button { padding: 0 14px; }
body .bottom-record-button span { color: var(--studio-mint); }
body .bottom-parameters-button { display: none; }

body .mir-engine-status {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-card-radius);
  background: rgba(13, 15, 22, 0.58);
}

body .mir-engine-status > span {
  color: var(--studio-violet);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

body .mir-engine-status strong {
  color: var(--studio-primary);
  font-size: 14px;
}

body .mir-engine-status small {
  color: var(--studio-muted);
  line-height: 18px;
}

body .mir-engine-progress {
  height: 3px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--studio-line);
}

body .mir-engine-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--studio-mint);
  transition: width 200ms ease;
}

body .mir-engine-status[data-state="processing"] {
  border-color: rgba(129, 140, 248, 0.48);
}

body .mir-engine-status[data-state="ready"] {
  border-color: rgba(46, 199, 144, 0.5);
}

body .mir-engine-status[data-state="fallback"] {
  border-color: rgba(209, 213, 219, 0.28);
}

body .mir-engine-status[data-state="error"] {
  border-color: rgba(248, 113, 113, 0.5);
}

/* Modal layer and 200ms motion contract. */
body .auth-modal,
body .birthday-celebration {
  z-index: 90;
  background: rgba(13, 15, 22, 0.74);
  backdrop-filter: blur(12px);
}

body .auth-card,
body .birthday-celebration-card {
  z-index: 100;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-panel-radius);
  background: rgba(23, 26, 36, 0.98);
  box-shadow: var(--studio-shadow);
  color: var(--studio-secondary);
  animation: studio-modal-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body .auth-card h2,
body .birthday-celebration-card h2,
body .auth-brand strong { color: var(--studio-primary); }
body .auth-copy,
body .auth-footnote,
body .auth-brand small { color: var(--studio-muted); }

body .toast {
  z-index: 110;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-field-radius);
  background: rgba(23, 26, 36, 0.98);
  box-shadow: var(--studio-shadow);
  color: var(--studio-secondary);
}

@keyframes studio-breathe {
  0%, 100% { opacity: 0.35; transform: scale(0.92); }
  50% { opacity: 0.82; transform: scale(1); }
}

@keyframes studio-modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes library-wave {
  from { transform: scaleY(0.72); opacity: 0.54; }
  to { transform: scaleY(1.08); opacity: 0.9; }
}

@media (max-width: 1180px) {
  body .app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  body .studio { grid-column: 2; }
  body .side { grid-column: 1; }

  body .daw-parameters {
    position: relative;
    top: auto;
    grid-column: 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
  }

  body .parameters-heading,
  body .parameter-summary,
  body .daw-generate-button { grid-column: 1 / -1; }

  body .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .controls-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .controls-grid > .panel:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  body .site-nav {
    grid-template-columns: auto 1fr auto;
    width: calc(100% - 24px);
  }

  body .site-nav nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    display: none;
    padding: 8px;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--studio-line);
    border-radius: var(--studio-card-radius);
    background: rgba(23, 26, 36, 0.98);
    box-shadow: var(--studio-shadow);
  }

  body.nav-open .site-nav nav { display: flex; }
  body .site-nav nav a { text-align: center; }
  body .mobile-nav-toggle { display: block; justify-self: end; }
  body .nav-actions { grid-column: 1 / -1; display: none; width: 100%; padding-top: 8px; }
  body.nav-open .nav-actions { display: flex; }
  body .language-select-label { flex: 1; }

  body .landing-view,
  body .library-view {
    width: calc(100% - 32px);
    padding-top: 48px;
  }

  body .hero-content { min-height: 480px; }
  body .hero-content h1 { font-size: 48px; line-height: 52px; }
  body .hero-feature-grid { grid-template-columns: 1fr; }

  body .app-shell {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 24px);
  }

  body .studio { grid-column: 1; grid-row: 1; }
  body .topbar { flex-direction: column; }
  body .transport { width: 100%; justify-content: flex-start; }
  body .asset-rail-toggle { display: inline-flex; align-items: center; justify-content: center; }

  body .side {
    position: fixed;
    z-index: 60;
    top: 88px;
    bottom: 88px;
    left: 12px;
    display: grid;
    width: min(340px, calc(100vw - 24px));
    max-height: none;
    padding: 12px;
    overflow-y: auto;
    border: 1px solid var(--studio-line);
    border-radius: var(--studio-panel-radius);
    background: rgba(13, 15, 22, 0.98);
    box-shadow: var(--studio-shadow);
    transform: translateX(calc(-100% - 24px));
    transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  body.asset-rail-open .side { transform: translateX(0); }

  body .daw-parameters {
    position: fixed;
    z-index: 60;
    right: 12px;
    bottom: 88px;
    left: 12px;
    display: block;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    transform: translateY(calc(100% + 104px));
    transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  body.parameter-drawer-open .daw-parameters { transform: translateY(0); }
  body .parameter-close { display: block; }

  body .controls-grid { grid-template-columns: 1fr; }
  body .controls-grid > .panel:last-child { grid-column: auto; }
  body .melody-panel { grid-template-columns: 1fr; }

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

  body .daw-bottom-transport {
    grid-template-columns: 44px minmax(96px, 1fr) auto auto auto;
    gap: 8px;
  }

  body .bottom-time,
  body .bottom-record-button,
  body #bottomExportBtn { display: none; }
  body #bottomMidiBtn { display: block; }
  body .bottom-parameters-button { display: block; }
}

@media (max-width: 640px) {
  body .site-nav {
    top: 8px;
    min-height: 56px;
    margin-top: 8px;
    padding: 6px 8px;
  }

  body .brand { min-width: 0; }
  body .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  body .brand small { display: none; }

  body .landing-view,
  body .library-view {
    width: calc(100% - 24px);
    padding-top: 32px;
  }

  body .hero-wave-canvas { height: 520px; }
  body .hero-weave-mark { display: none; }
  body .hero-content { min-height: 460px; }
  body .hero-content h1 { margin: 16px 0; font-size: 42px; line-height: 46px; }
  body .hero-description { font-size: 15px; line-height: 24px; }
  body .hero-actions { width: 100%; flex-direction: column; }
  body .hero-actions button { width: 100%; }

  body .hero-feature-card { min-height: 220px; padding: 20px; }
  body .hero-feature-card h2 { margin-top: 44px; }

  body .app-shell { width: calc(100% - 16px); margin-top: 20px; }
  body .topbar h2 { font-size: 30px; line-height: 38px; }
  body .transport { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .transport button { width: 100%; }
  body .transport .icon-button { display: none; }

  body .linear-progress-step { min-height: 52px; padding: 8px 4px; flex-direction: column; gap: 2px; }
  body .linear-progress-step strong { font-size: 10px; }

  body .capture-panel { min-height: 540px; }
  body .record-button { width: 220px; height: 220px; min-height: 220px; }
  body .capture-guide { top: 16px; right: 16px; left: 16px; max-width: calc(100% - 96px); }
  body .capture-count { top: 16px; right: 16px; }
  body .capture-copy { right: 16px; bottom: 80px; left: 16px; max-width: none; }
  body .capture-next-button { right: 16px; bottom: 16px; left: 16px; width: calc(100% - 32px); }

  body .flow-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .flow-actions { grid-template-columns: 1fr; }
  body .seed-modes { grid-template-columns: 1fr; }
  body .identity-grid { grid-template-columns: 1fr; }

  body .library-heading h1 { font-size: 34px; line-height: 40px; }
  body .library-heading > button { width: 100%; }
  body .library-filter-bar { align-items: stretch; flex-direction: column; }
  body .library-filter-bar label,
  body .library-filter-bar select { width: 100%; min-width: 0; }
  body .library-filter-bar p { margin: 4px 0 0; }
  body .library-grid { grid-template-columns: 1fr; }
  body .library-card { min-height: 280px; }

  body .proof-band,
  body .site-section,
  body .site-footer { width: calc(100% - 24px); }

  body .daw-bottom-transport {
    bottom: max(8px, env(safe-area-inset-bottom));
    width: calc(100% - 16px);
    min-height: 60px;
    padding: 8px;
  }

  body .bottom-generate-button,
  body .bottom-parameters-button { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body *,
  body *::before,
  body *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body .hero-feature-card:hover,
  body .library-card:hover { transform: none; }
}
