:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --paper: #fffefa;
  --surface: #f1f0eb;
  --surface-2: #e8e6df;
  --line: #171717;
  --soft-line: rgba(23, 23, 23, 0.16);
  --text: #111111;
  --muted: #6b6861;
  --dim: #9b968d;
  --accent: #111111;
  --warm: #c9bca8;
  --good: #2f6f54;
  --bad: #a44335;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

body[data-mode="artist"] [data-mode-section]:not([data-mode-section~="artist"]),
body[data-mode="producer"] [data-mode-section]:not([data-mode-section~="producer"]),
body[data-mode="admin"] [data-mode-section]:not([data-mode-section~="admin"]) {
  display: none;
}

.admin-only {
  display: none;
}

body.admin-enabled .admin-only {
  display: inline-flex;
}

.shell {
  min-height: 100vh;
  overflow: hidden;
}

.hero {
  min-height: 100vh;
  padding: 92px clamp(18px, 4vw, 56px) 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 86% 24%, rgba(201, 188, 168, 0.3), transparent 30%),
    linear-gradient(180deg, var(--paper) 0%, var(--bg) 100%);
}

.hero-media,
.hero-overlay {
  display: none;
}

.topbar {
  position: fixed;
  top: 18px;
  left: clamp(18px, 4vw, 56px);
  right: clamp(18px, 4vw, 56px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(247, 246, 242, 0.94);
  padding: 8px 10px;
  backdrop-filter: blur(12px);
}

.brand,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 30%, var(--line) 30% 41%, transparent 41%),
    linear-gradient(0deg, transparent 24%, var(--line) 24% 33%, transparent 33%),
    var(--paper);
}

.nav-actions a {
  color: var(--muted);
  font-size: 0.94rem;
}

.nav-actions a:hover {
  color: var(--text);
}

.mode-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.94rem;
  font-weight: 800;
}

.mode-link:hover,
.mode-link.active {
  color: var(--text);
  border-bottom-color: var(--line);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.language-switcher select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--text);
  padding: 0 28px 0 9px;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.language-switcher select:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  display: grid;
  place-items: center;
}

.crate-icon,
.upload-icon {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  position: relative;
}

.crate-icon::before,
.upload-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: -6px;
  height: 6px;
  border: 2px solid currentColor;
  border-bottom: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.55fr);
  gap: clamp(36px, 7vw, 110px);
  align-items: center;
  width: min(1280px, 100%);
  margin: clamp(100px, 15vh, 154px) auto 4vh;
}

.hero-copy {
  max-width: 920px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

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

h1 {
  margin-bottom: 22px;
  max-width: 960px;
  font-size: clamp(3.8rem, 7.4vw, 7.2rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
  font-weight: 850;
}

h2 {
  margin-bottom: 0;
  max-width: 760px;
  font-size: clamp(2.05rem, 4.6vw, 4.9rem);
  line-height: 1.02;
  letter-spacing: 0;
  font-weight: 820;
}

.lede {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.7vw, 1.22rem);
  line-height: 1.6;
}

.hero-value-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.hero-value-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-value-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
}

.hero-actions,
.studio-strip,
.now-playing {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 30px;
}

.hero-actions .primary-action,
.hero-actions .ghost-action {
  min-height: 54px;
  padding-inline: 24px;
}

.primary-action,
.ghost-action,
.secondary-button {
  min-height: 46px;
  border: 1px solid var(--line);
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: var(--paper);
  color: var(--text);
}

.primary-action {
  background: var(--accent);
  color: var(--paper);
}

.ghost-action,
.secondary-button {
  background: transparent;
}

.primary-action:hover,
.ghost-action:hover,
.secondary-button:hover,
.icon-button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.62;
}

.secondary-button:disabled {
  cursor: not-allowed;
  color: var(--dim);
  border-color: var(--soft-line);
  background: transparent;
}

.signal-panel,
.workbench,
.now-playing,
.crate-toolbar,
.producer-form {
  border: 1px solid var(--line);
  background: var(--paper);
}

.producer-auth {
  width: min(1180px, 100%);
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: end;
}

.producer-auth-copy,
.producer-auth-copy small,
.producer-authenticated > div {
  display: grid;
  gap: 5px;
}

.producer-auth-copy small,
.producer-authenticated small {
  color: var(--muted);
}

.producer-login-form {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.producer-login-form[hidden] {
  display: none;
}

.producer-login-form label {
  display: grid;
  gap: 6px;
}

.producer-authenticated {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.producer-authenticated[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .producer-auth,
  .producer-login-form {
    grid-template-columns: 1fr;
  }
}

.signal-panel {
  padding: 22px;
  box-shadow: 14px 14px 0 var(--warm);
}

.panel-head,
.mini-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.panel-head strong {
  color: var(--text);
}

.signal-bars {
  height: 140px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  align-items: end;
  padding: 22px 0;
}

.signal-bars span,
.waveform span {
  display: block;
  background: var(--line);
}

.signal-stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.signal-stats div {
  padding: 12px;
  background: var(--paper);
}

.signal-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.5;
}

.landing-story {
  border-bottom: 1px solid var(--line);
  background: var(--text);
  color: var(--paper);
  padding: clamp(78px, 10vw, 132px) clamp(18px, 4vw, 56px);
}

.landing-story-head,
.journey-grid,
.landing-values,
.landing-capabilities {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.landing-story-head {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  margin-bottom: 48px;
}

.landing-story-head .eyebrow {
  color: var(--warm);
}

.landing-story-head h2 {
  color: var(--paper);
  font-size: clamp(2.5rem, 5.5vw, 5.8rem);
}

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

.journey-card {
  min-height: 520px;
  border: 1px solid rgba(255, 254, 250, 0.48);
  padding: clamp(24px, 4vw, 42px);
  display: flex;
  flex-direction: column;
}

.journey-artist {
  background: var(--paper);
  color: var(--text);
}

.journey-producer {
  background: transparent;
  color: var(--paper);
}

.journey-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid currentColor;
}

.journey-card-head > span {
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 900;
}

.journey-card h3 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.journey-card ol {
  margin: 28px 0 36px;
  padding: 0;
  list-style: none;
  display: grid;
}

.journey-card li {
  min-height: 68px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid currentColor;
}

.journey-card li span {
  color: var(--dim);
  font-size: 0.68rem;
  font-weight: 900;
}

.journey-card li strong {
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
}

.journey-action {
  min-height: 50px;
  margin-top: auto;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-weight: 900;
}

.journey-artist .journey-action {
  background: var(--text);
  color: var(--paper);
}

.journey-action:hover {
  background: var(--warm);
  color: var(--text);
}

.landing-values {
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 254, 250, 0.38);
  border-bottom: 1px solid rgba(255, 254, 250, 0.38);
}

.landing-values article {
  min-height: 170px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
}

.landing-values article + article {
  border-left: 1px solid rgba(255, 254, 250, 0.38);
}

.landing-values span {
  color: var(--warm);
  font-size: 0.68rem;
  font-weight: 900;
}

.landing-values strong {
  max-width: 290px;
  font-size: clamp(1.15rem, 2.1vw, 1.7rem);
  line-height: 1.15;
}

.landing-capabilities {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 22px;
  color: var(--warm);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-capabilities span {
  padding: 12px 0;
}

@media (max-width: 900px) {
  .landing-story-head,
  .journey-grid {
    grid-template-columns: 1fr;
  }

  .journey-card {
    min-height: 470px;
  }

  .landing-values {
    grid-template-columns: 1fr;
  }

  .landing-values article {
    min-height: 130px;
  }

  .landing-values article + article {
    border-left: 0;
    border-top: 1px solid rgba(255, 254, 250, 0.38);
  }
}

@media (max-width: 620px) {
  .hero-value-list {
    display: grid;
  }

  .hero-actions > * {
    width: 100%;
  }

  .signal-panel {
    box-shadow: 8px 8px 0 var(--warm);
  }

  .landing-story-head {
    gap: 10px;
    margin-bottom: 30px;
  }

  .journey-card {
    min-height: 440px;
  }

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

dt {
  color: var(--dim);
  font-size: 0.72rem;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.matcher-section,
.producer-section,
.admin-section,
.cloud-status-section,
.beats-section {
  padding: clamp(56px, 8vw, 104px) clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--soft-line);
}

.cloud-status-section {
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.cloud-status {
  width: min(1180px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.cloud-status strong {
  color: var(--text);
}

.cloud-status.connected {
  background: var(--paper);
}

.cloud-status.read-only,
.cloud-write-lock {
  border: 1px solid #a32217;
  background: #fff4ef;
  color: #6e2a20;
  padding: 12px 14px;
}

.section-title {
  width: min(1180px, 100%);
  margin: 0 auto 26px;
}

.compact {
  margin-bottom: 18px;
}

.section-note {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.workbench {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(280px, 1fr);
  gap: 1px;
  background: var(--line);
  overflow: hidden;
}

.upload-zone,
.beat-file-zone,
.vibe-board,
.studio-strip {
  background: var(--paper);
  padding: 22px;
}

.upload-zone {
  min-height: 290px;
  display: grid;
  gap: 14px;
}

.melody-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.upload-zone input,
.beat-file-zone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-zone label,
.beat-file-zone label {
  border: 1px dashed var(--line);
  min-height: 205px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 22px;
  text-align: center;
  background: var(--surface);
}

.producer-form {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(300px, 1fr);
  gap: 1px;
  background: var(--line);
  overflow: hidden;
}

.beat-file-zone {
  min-height: 100%;
}

.beat-file-zone label {
  min-height: 100%;
}

.beat-fields {
  background: var(--paper);
  padding: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.preview-warning {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 16px 22px;
  border-top: 2px solid #a32217;
  background: #fff0ee;
  color: var(--text);
}

.preview-warning strong {
  color: #a32217;
  font-size: 0.95rem;
}

.preview-warning span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.beat-fields label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.beat-fields input,
.beat-fields select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--text);
  padding: 0 12px;
}

.beat-fields .primary-action {
  align-self: end;
}

.producer-preview-editor {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.producer-preview-editor[hidden] {
  display: none;
}

.producer-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.producer-preview-head > div {
  display: grid;
  gap: 4px;
}

.producer-preview-head strong {
  color: var(--text);
  font-size: 0.96rem;
}

.producer-preview-head span,
.producer-preview-head small,
.producer-preview-status {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.producer-preview-editor audio {
  width: 100%;
}

.producer-preview-waveform {
  position: relative;
  height: 150px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fffdf6;
  touch-action: none;
  user-select: none;
}

.producer-preview-waveform canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.producer-preview-selection {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 100%;
  border-inline: 2px solid var(--line);
  background: rgb(18 18 18 / 10%);
  cursor: grab;
}

.producer-preview-selection.dragging {
  cursor: grabbing;
}

.producer-preview-selection-body {
  position: absolute;
  inset: 0 10px;
}

.producer-preview-handle {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 18px;
  height: 48px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  transform: translateY(-50%);
  cursor: ew-resize;
}

.producer-preview-handle::after {
  content: "";
  position: absolute;
  inset: 10px 7px;
  border-left: 2px solid var(--line);
}

.producer-preview-handle.start {
  left: -10px;
}

.producer-preview-handle.end {
  right: -10px;
}

.producer-preview-waveform-scale {
  display: flex;
  justify-content: space-between;
  margin-top: -7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.producer-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.producer-preview-actions button.is-confirmed {
  border-color: var(--good);
  color: var(--good);
}

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

.producer-expression-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.producer-expression-head,
.producer-expression-grid > section > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.producer-expression-head small,
.producer-expression-grid small {
  color: var(--muted);
  font-size: 0.7rem;
}

.producer-expression-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.producer-expression-grid > section {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  background: var(--paper);
}

.producer-expression-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.producer-expression-options button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
}

.producer-expression-options button.active {
  background: var(--line);
  color: var(--paper);
}

.rights-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text);
}

.rights-check input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--line);
}

.upload-rules {
  border: 1px solid #a32217;
  background: #fff8f6;
  padding: 12px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.upload-rules strong {
  color: var(--text);
  font-size: 0.88rem;
}

.producer-dashboard {
  width: min(1180px, 100%);
  margin: 18px auto 0;
  border: 1px solid var(--line);
  background: var(--paper);
}

.ownership-note {
  margin: 0;
  padding: 0 18px 14px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.dashboard-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.dashboard-head h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
}

.dashboard-head small {
  color: var(--muted);
}

.producer-beat-list {
  display: grid;
}

.producer-beat-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--soft-line);
}

.producer-beat-item:last-child {
  border-bottom: 0;
}

.producer-beat-main {
  display: grid;
  gap: 8px;
}

.producer-beat-main h4 {
  margin: 0;
  font-size: 1rem;
}

.producer-beat-actions {
  display: flex;
  align-items: start;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.contact-line {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.upload-state {
  color: var(--good);
  font-size: 0.78rem;
  font-weight: 700;
}

.upload-state.failed {
  color: var(--bad);
}

.producer-editor {
  margin-top: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--soft-line);
  background: var(--surface);
}

.producer-editor label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.producer-editor input,
.producer-editor select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 9px;
  background: var(--paper);
  color: var(--text);
}

.editor-wide {
  grid-column: 1 / -1;
}

.producer-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.beat-audio {
  display: grid;
  gap: 6px;
}

.beat-audio audio {
  display: none;
}

.audio-player-controls {
  display: grid;
  grid-template-columns: 52px 38px minmax(96px, 1fr) 38px;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.audio-toggle {
  min-height: 32px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.audio-toggle:hover {
  background: var(--line);
  color: var(--paper);
}

.audio-toggle:disabled {
  cursor: wait;
  opacity: 0.72;
}

.beat-audio.loading .audio-toggle {
  background: var(--line);
  color: var(--paper);
}

.audio-time {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.audio-progress {
  width: 100%;
  min-width: 0;
  accent-color: var(--line);
  cursor: pointer;
}

.audio-progress:disabled {
  cursor: wait;
  opacity: 0.55;
}

.audio-status {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.feedback-hint {
  width: 100%;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.45;
}

.beat-audio a,
.audio-fallback {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.upload-icon {
  width: 34px;
  height: 34px;
  color: var(--text);
}

.upload-zone small,
.melody-preview small,
.beat-card small,
.now-playing small {
  color: var(--muted);
}

.vibe-board {
  display: grid;
  gap: 20px;
  align-content: start;
}

.mini-head button {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
}

.mini-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-actions small {
  color: var(--muted);
  font-size: 0.78rem;
}

#vibe-panel-toggle {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  min-height: 32px;
  padding: 0 10px;
  font-weight: 900;
}

.vibe-board > .tag-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  justify-content: flex-start;
  width: 100%;
  gap: 6px;
}

.vibe-board > .tag-grid > .tag {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--text);
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.vibe-board > .tag-grid > .tag.active {
  background: var(--line);
  color: var(--paper);
}

.vibe-fields {
  display: grid;
  gap: 12px;
}

.vibe-fields label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.vibe-fields input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--text);
  padding: 0 12px;
}

.control-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  color: var(--muted);
}

input[type="range"] {
  accent-color: var(--line);
}

.studio-strip {
  grid-column: 1 / -1;
  justify-content: space-between;
}

.status-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  background: var(--good);
  margin-right: 8px;
}

.crate-toolbar,
.now-playing {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  padding: 16px;
}

.admin-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-moderation {
  width: min(1180px, 100%);
  margin: 18px auto 0;
  border: 1px solid var(--line);
  background: var(--paper);
}

.admin-panel div {
  display: grid;
  gap: 5px;
}

.admin-panel small {
  color: var(--muted);
}

.admin-code-field {
  min-width: min(320px, 100%);
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-code-field input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
}

.admin-code-field input:focus {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.crate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.crate-toolbar div {
  display: grid;
  gap: 4px;
}

.crate-toolbar small {
  color: var(--muted);
}

.play-button {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  background: var(--line);
  display: grid;
  place-items: center;
}

.play-button span {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid var(--paper);
  margin-left: 3px;
}

.play-button.playing span {
  width: 14px;
  height: 18px;
  border: 0;
  border-left: 5px solid var(--paper);
  border-right: 5px solid var(--paper);
  margin-left: 0;
}

.play-button.loading span {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: var(--paper);
  border-radius: 50%;
  margin-left: 0;
  animation: audio-spin 0.8s linear infinite;
}

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

.waveform {
  margin-left: auto;
  width: min(420px, 38vw);
  height: 56px;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  align-items: center;
  gap: 5px;
}

.waveform span {
  height: 24%;
}

.waveform span:nth-child(2n) {
  height: 72%;
}

.waveform span:nth-child(3n) {
  height: 48%;
  background: var(--warm);
}

.beat-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.beat-pagination {
  width: min(1180px, 100%);
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.beat-pagination[hidden] {
  display: none;
}

.beat-pagination small {
  color: var(--muted);
}

.beat-card {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 16px;
  min-height: 230px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.beat-card:hover,
.beat-card.selected {
  transform: translateY(-2px);
  background: #fdf8eb;
}

.beat-card.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  align-content: center;
  background: var(--surface);
}

.beat-card.empty-state:hover {
  transform: none;
  background: var(--surface);
}

.fit-preview-host {
  max-width: 1180px;
  margin: 0 auto 16px;
}

body[data-studio="open"] #matcher {
  display: none;
}

.beats-section.studio-open .section-title,
.beats-section.studio-open .crate-toolbar,
.beats-section.studio-open .beat-grid,
.beats-section.studio-open .beat-pagination {
  display: none;
}

.beats-section.studio-open {
  padding-top: 30px;
}

.fit-preview-studio {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(18px, 3vw, 30px);
  display: grid;
  gap: 14px;
}

.fit-studio-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.fit-studio-head h3 {
  margin: 0 0 5px;
  font-size: clamp(1.45rem, 4vw, 2.35rem);
  letter-spacing: 0;
}

.fit-studio-head small {
  color: var(--muted);
  font-size: 0.8rem;
}

.fit-studio-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.fit-studio-meta .hook-rerecord-button {
  color: var(--muted);
  border-color: var(--soft-line);
  background: var(--paper);
}

.fit-studio-meta .hook-rerecord-button:hover {
  color: var(--text);
  border-color: var(--line);
}

.fit-studio-meta span {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  color: var(--muted);
  padding: 6px 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.studio-why {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: clamp(16px, 3vw, 24px);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.7fr);
  gap: 18px;
  align-items: end;
}

.studio-why h4 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3.2vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.studio-why .eyebrow {
  letter-spacing: 0;
  text-transform: none;
}

.studio-why p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.studio-why strong {
  border-left: 4px solid var(--line);
  padding-left: 14px;
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  line-height: 1.25;
}

.studio-capabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.studio-capabilities div {
  border: 1px solid var(--soft-line);
  background: #fffdf6;
  padding: 14px;
  min-height: 154px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.studio-capabilities span {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.studio-capabilities strong {
  font-size: 1rem;
  line-height: 1.25;
}

.studio-capabilities p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.studio-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.studio-steps span {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  color: var(--muted);
  padding: 7px 9px;
  font-size: 0.72rem;
  font-weight: 900;
}

.beat-art {
  height: 62px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 4px;
}

.beat-art span {
  display: block;
  background: var(--line);
}

.beat-art span:nth-child(3n) {
  background: var(--dim);
}

.beat-art span:nth-child(4n) {
  background: var(--warm);
}

.beat-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.beat-title h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.score,
.score.uploaded {
  color: var(--text);
  font-weight: 900;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-row span {
  border: 1px solid var(--soft-line);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 0.78rem;
}

.artist-tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.artist-tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: #fffdf6;
  color: var(--muted);
  padding: 2px 6px;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.artist-style-pill {
  border-color: var(--line);
  color: var(--text);
}

.artist-tag-more {
  background: var(--surface);
}

.match-breakdown {
  display: grid;
  gap: 8px;
}

.compatibility-summary {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--soft-line);
  background: var(--surface);
}

.compatibility-profile {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compatibility-profile span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.compatibility-profile strong {
  color: var(--ink);
}

.recommended-offset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.72rem;
}

.recommended-offset strong {
  color: var(--text);
  font-size: 0.82rem;
}

.recommended-offset small {
  grid-column: 1 / -1;
  color: var(--dim);
  font-size: 0.66rem;
}

.match-line {
  display: grid;
  grid-template-columns: 72px 1fr 34px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.74rem;
}

.match-meter {
  height: 5px;
  background: var(--surface-2);
  overflow: hidden;
}

.match-meter span {
  display: block;
  height: 100%;
  background: var(--line);
}

.match-line.pending .match-meter {
  background: repeating-linear-gradient(90deg, var(--surface-2) 0 8px, var(--paper) 8px 12px);
}

.match-line.pending strong {
  color: var(--dim);
}

.reason-line {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.fit-preview {
  background: transparent;
  display: grid;
  gap: 14px;
}

.fit-preview.active {
  background: transparent;
}

.fit-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
  flex-wrap: wrap;
}

.fit-preview-head strong {
  display: block;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.fit-preview-head small,
.fit-warning {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.hook-check-start-card {
  border: 2px solid var(--line);
  background: #fffdf6;
  padding: clamp(20px, 3vw, 30px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.32fr);
  gap: 24px;
  align-items: center;
}

.hook-check-start-card strong {
  display: block;
  margin: 6px 0 8px;
  color: var(--text);
  font-size: clamp(1.6rem, 3.8vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.hook-check-start-card small {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.hook-check-start-card em {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.45;
}

.hook-check-start-card.is-complete {
  background: #fffdf6;
}

.hook-check-start-actions {
  display: grid;
  gap: 8px;
}

.hook-check-start-actions .copy-contact {
  width: 100%;
}

.studio-purpose {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.studio-purpose div {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 12px;
  min-height: 86px;
  display: grid;
  align-content: space-between;
}

.studio-purpose span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.studio-purpose strong {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.35;
}

.studio-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.studio-flow span {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  color: var(--muted);
  padding: 6px 8px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.record-demo-button {
  color: var(--text);
  border-color: var(--line);
  min-height: 44px;
  padding-inline: 18px;
}

.hook-check-record-button {
  width: 100%;
  min-height: 76px;
  color: var(--paper);
  background: var(--line);
  border-color: var(--line);
  font-size: 1.08rem;
}

.secondary-record-button {
  min-height: 40px;
  color: var(--muted);
  background: var(--paper);
  border-color: var(--soft-line);
  font-size: 0.78rem;
}

.hook-check-record-button:hover {
  color: var(--text);
  background: var(--paper);
}

.record-demo-button.recording {
  color: var(--paper);
  border-color: var(--bad);
  background: var(--bad);
}

.preview-result-card {
  border: 1px solid var(--line);
  background: #fffdf6;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.preview-result-card.is-locked {
  border-color: var(--soft-line);
  background: var(--paper);
}

.compare-preview-card {
  border: 1px solid var(--line);
  background: #fffdf6;
  padding: 16px;
}

.compare-preview-card.is-locked {
  border-color: var(--soft-line);
  background: var(--paper);
}

.compare-preview-intro > strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.compare-preview-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.playback-status {
  display: inline-flex;
  margin-top: 12px;
  border: 1px solid var(--soft-line);
  background: var(--paper);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 900;
}

.playback-status.is-playing {
  color: var(--paper);
  border-color: var(--line);
  background: var(--line);
}

.compare-preview-card {
  display: grid;
  gap: 14px;
}

.hook-check-listening-experience {
  display: grid;
  gap: 14px;
}

.preview-version-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preview-version-choice {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  color: var(--text);
  padding: 16px;
  display: grid;
  justify-items: start;
  text-align: left;
  align-content: start;
  gap: 5px;
  min-height: 132px;
  cursor: pointer;
}

.preview-version-choice:hover,
.preview-version-choice.is-selected {
  border-color: var(--line);
  background: #fffdf6;
}

.preview-version-choice.is-selected {
  box-shadow: inset 0 -4px 0 var(--line);
}

.preview-version-choice span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.preview-version-choice strong {
  font-size: 1.08rem;
}

.preview-version-choice small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.preview-version-choice.optimized-reference-choice {
  background: #fffdf6;
}

.optional-tune-panel {
  border: 1px solid var(--soft-line);
  background: var(--paper);
}

.optional-tune-panel summary {
  padding: 14px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
}

.optional-tune-panel > p {
  margin: 0;
  padding: 0 14px 12px;
}

.optional-tune-panel .fit-controls {
  border-top: 1px solid var(--soft-line);
  padding: 14px;
}

.stop-preview-button {
  justify-self: start;
}

.applied-preview-adjustments {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 14px;
}

.applied-preview-adjustments > strong {
  display: block;
  margin-bottom: 9px;
  font-size: 1rem;
}

.applied-preview-adjustments ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
}

.applied-preview-adjustments small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.74rem;
}

.applied-preview-adjustments.compact {
  border: 0;
  border-top: 1px solid var(--soft-line);
}

.technical-empty-state {
  margin: 0;
  border-top: 1px solid var(--soft-line);
  padding: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.preview-result-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
}

.preview-result-card p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.preview-result-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.flow-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.version-state {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.version-state span {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 0.74rem;
  font-weight: 900;
}

.version-state span.is-active {
  color: var(--paper);
  border-color: var(--line);
  background: var(--line);
}

.result-badge {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--soft-line);
  background: var(--paper);
  padding: 5px 7px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.preview-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.preview-scope {
  border-top: 1px solid var(--soft-line);
  background: #fffdf6;
  padding: 12px;
  display: grid;
  gap: 9px;
}

.preview-scope strong {
  font-size: 0.92rem;
}

.preview-scope p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.scope-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.scope-tags span {
  border: 1px solid var(--soft-line);
  background: #fffdf6;
  padding: 6px 8px;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 900;
}

.adjust-details {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  padding: 0;
}

.adjust-details summary {
  cursor: pointer;
  padding: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  list-style-position: inside;
}

.adjust-parameter-grid {
  border-top: 1px solid var(--soft-line);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.adjust-parameter-grid span {
  border: 1px solid var(--soft-line);
  background: #fffdf6;
  padding: 9px;
  display: grid;
  gap: 5px;
}

.adjust-parameter-grid em {
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 900;
}

.adjust-parameter-grid b {
  color: var(--text);
  font-size: 0.82rem;
}

.adjust-parameter-grid small {
  width: fit-content;
  border: 1px solid var(--soft-line);
  background: var(--paper);
  padding: 3px 5px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.auto-adjust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auto-adjust-card {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.auto-adjust-card.applied {
  border-color: var(--line);
}

.auto-adjust-card > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.auto-adjust-card strong {
  font-size: 1rem;
}

.auto-adjust-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

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

.fit-data span,
.fit-note {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  color: var(--muted);
  padding: 9px 10px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.fit-data b {
  color: var(--text);
}

.fit-note {
  font-weight: 800;
}

.simple-tune-panel {
  border: 1px solid var(--line);
  background: #fffdf6;
  padding: 16px;
  display: grid;
  gap: 14px;
}

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

.simple-tune-panel strong {
  display: block;
  font-size: 1.18rem;
}

.simple-tune-panel small {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  line-height: 1.45;
  margin-top: 4px;
}

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

.fit-controls label {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  padding: 6px;
  display: grid;
  grid-template-columns: 26px 1fr 26px;
  gap: 4px;
  align-items: center;
}

.fit-controls span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 900;
}

.fit-controls b {
  text-align: center;
  font-size: 0.68rem;
}

.fit-controls button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--soft-line);
  background: var(--surface);
  font-weight: 900;
}

.fit-controls .position-fit-control {
  grid-template-columns: minmax(54px, auto) minmax(92px, 1fr) minmax(54px, auto);
}

.fit-controls .position-fit-control button {
  width: auto;
  padding-inline: 8px;
  font-size: 0.7rem;
}

.manual-tips {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  padding: 12px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.manual-tips strong {
  color: var(--text);
  font-size: 0.85rem;
}

.manual-tips span {
  display: block;
}

.studio-feedback-panel {
  border: 1px solid var(--line);
  background: #fffdf6;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.studio-feedback-panel.is-disabled {
  border-color: var(--soft-line);
  background: var(--paper);
}

.studio-feedback-panel strong {
  display: block;
  font-size: 1rem;
}

.studio-feedback-panel small {
  color: var(--muted);
  font-size: 0.78rem;
}

.studio-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.match-breakdown > .feedback-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--soft-line);
  background: #fffdf6;
  padding: 12px;
}

.feedback-row button {
  min-height: 30px;
  border: 1px solid var(--soft-line);
  background: var(--paper);
  color: var(--muted);
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 800;
}

.feedback-row button:hover,
.feedback-row button.active {
  color: var(--paper);
  border-color: var(--line);
  background: var(--line);
}

.feedback-row .danger:hover {
  border-color: var(--bad);
  background: var(--bad);
}

.copy-contact,
.remove-local {
  min-height: 30px;
  border: 1px solid var(--soft-line);
  background: var(--paper);
  color: var(--muted);
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 800;
}

.copy-contact:hover {
  color: var(--paper);
  background: var(--line);
  border-color: var(--line);
}

.primary-fit-action {
  color: var(--text);
  border-color: var(--line);
  background: #fffdf6;
  min-height: 46px;
  padding-inline: 14px;
  font-size: 0.88rem;
}

.primary-fit-action:hover {
  color: var(--paper);
  background: var(--line);
}

.hook-check-action {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  border-color: var(--line);
  background: var(--line);
  font-size: 0.98rem;
  letter-spacing: 0;
}

.hook-check-action:hover {
  color: var(--text);
  background: var(--paper);
}

.remove-local:hover {
  color: var(--paper);
  background: var(--bad);
  border-color: var(--bad);
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
  }

  .hero-grid,
  .workbench,
  .producer-form {
    grid-template-columns: 1fr;
  }

  .producer-expression-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    margin-top: 12vh;
  }

  .studio-strip {
    grid-column: auto;
  }

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

  .fit-studio-head {
    display: grid;
  }

  .fit-studio-meta {
    justify-content: flex-start;
  }

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

  .producer-beat-item,
  .dashboard-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .producer-beat-actions {
    justify-content: flex-start;
  }

  .waveform {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 10px;
    left: 18px;
    right: 18px;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .nav-actions a {
    display: none;
  }

  .mode-link {
    flex: 1;
    min-width: 0;
    padding: 0 4px;
    font-size: 0.82rem;
  }

  .hero {
    padding-top: 126px;
    min-height: 84vh;
  }

  h1 {
    font-size: clamp(3.4rem, 17vw, 4.8rem);
  }

  .signal-stats,
  .beat-fields {
    grid-template-columns: 1fr;
  }

  .vibe-board:not(.open) .tag-grid {
    display: none;
  }

  .vibe-board.open .tag-grid {
    display: flex;
  }

  .vibe-fields {
    margin-top: 12px;
  }

  .producer-editor {
    grid-template-columns: 1fr;
  }

  .editor-wide {
    grid-column: auto;
  }

  .control-row {
    grid-template-columns: 1fr;
  }

  .melody-preview {
    grid-template-columns: 1fr;
  }

  .fit-data,
  .fit-controls,
  .preview-version-switch,
  .preview-result-card,
  .adjust-parameter-grid,
  .auto-adjust-grid,
  .studio-purpose,
  .studio-why,
  .studio-capabilities,
  .hook-check-start-card {
    grid-template-columns: 1fr;
  }

  .fit-studio-head {
    flex-direction: column;
  }

  .preview-result-actions {
    justify-content: flex-start;
  }

  .fit-studio-meta {
    justify-content: flex-start;
  }

  .audio-player-controls {
    grid-template-columns: 52px 1fr;
  }

  .match-breakdown > .feedback-row {
    grid-template-columns: 1fr;
  }

  .audio-player-controls .audio-time {
    display: none;
  }

  .now-playing {
    align-items: flex-start;
  }
}
/* Hook Check listening center restored from melody-to-beat-prototype. */
.fit-preview-studio.is-recording-entry {
  padding: 16px 18px;
  gap: 10px;
}

.fit-preview-studio.is-recording-entry .fit-preview {
  border: 0;
  background: transparent;
  padding: 0;
}

.fit-preview-studio.is-recording-entry .fit-studio-head {
  align-items: center;
}

.hook-check-record-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.26fr);
  gap: 14px;
  align-items: center;
}

.hook-check-recording-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.26fr);
  gap: 16px;
  align-items: center;
}

.hook-check-recording-state strong {
  display: block;
  margin: 6px 0 12px;
  font-size: clamp(1.3rem, 2.8vw, 1.8rem);
  line-height: 1.12;
}

.hook-check-recording-state > div > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.recording-live-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  padding: 10px 0;
}

.recording-live-status > span {
  display: grid;
  grid-template-columns: auto auto;
  gap: 3px 10px;
  align-items: center;
}

.recording-live-status small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 900;
}

.recording-live-status b {
  font-size: 0.86rem;
}

.recording-pulse {
  height: 16px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.recording-pulse em {
  width: 3px;
  height: 7px;
  background: var(--bad);
  animation: recording-level 0.9s ease-in-out infinite alternate;
}

.recording-pulse em:nth-child(2) {
  height: 13px;
  animation-delay: 0.18s;
}

.recording-pulse em:nth-child(3) {
  height: 9px;
  animation-delay: 0.36s;
}

@keyframes recording-level {
  from {
    transform: scaleY(0.45);
    opacity: 0.55;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.hook-check-record-entry strong {
  display: block;
  margin: 0 0 5px;
  color: var(--text);
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.hook-check-record-entry small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.hook-check-beat-readiness {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-left: 3px solid var(--soft-line);
  background: var(--paper);
  padding: 9px 11px;
}

.hook-check-beat-readiness b {
  color: var(--text);
  font-size: 0.78rem;
}

.hook-check-beat-readiness span {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.hook-check-beat-readiness.is-ready {
  border-left-color: var(--good);
}

.hook-check-beat-readiness.is-error {
  border-left-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 7%, var(--paper));
}

.hook-check-beat-readiness.is-error span {
  color: var(--bad);
}

.hook-check-beat-preview-button {
  min-height: 42px;
}

.hook-check-listening-center {
  display: grid;
  gap: 14px;
}

.listening-center-head {
  border: 1px solid var(--line);
  background: #fffdf6;
  padding: clamp(16px, 2.4vw, 24px);
}

.listening-center-head strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.1;
}

.listening-center-head p,
.preview-choice-section p,
.listening-adjustment-module p,
.preview-comparison-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.preview-comparison-head {
  padding-top: 4px;
}

.preview-comparison-head strong {
  display: block;
  font-size: 1.18rem;
}

.preview-choice-section {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  padding: 16px;
  display: grid;
  justify-items: start;
  gap: 10px;
}

.preview-choice-section.is-current {
  border-color: var(--line);
  background: #fffdf6;
}

.preview-choice-section strong,
.listening-adjustment-module strong {
  display: block;
  font-size: 1.12rem;
}

.preview-choice-section small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.preview-choice-button {
  min-width: min(280px, 100%);
  min-height: 52px;
  margin-top: 2px;
  padding-inline: 22px;
  font-size: 0.96rem;
}

.preview-version-button {
  color: var(--paper);
  border-color: var(--line);
  background: var(--line);
}

.preview-version-button:hover {
  color: var(--text);
  background: var(--paper);
}

.optimization-adjustments {
  width: 100%;
  margin-top: 4px;
  border-top: 1px solid var(--soft-line);
  padding-top: 14px;
}

.optimization-adjustments > strong {
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.optimization-adjustments > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.optimization-adjustments span {
  border: 1px solid var(--soft-line);
  background: #fffdf6;
  padding: 10px;
}

.optimization-adjustments em,
.optimization-adjustments b {
  display: block;
}

.optimization-adjustments em {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
}

.optimization-adjustments b {
  color: var(--text);
  font-size: 0.82rem;
}

.optimization-key-notice {
  margin: 10px 0 0;
  border-left: 3px solid var(--warm);
  background: color-mix(in srgb, var(--warm) 9%, var(--paper));
  padding: 9px 11px;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.45;
}

.optimization-key-notice.is-limited {
  border-left-color: var(--line);
}

.hook-rerecord-option {
  border-top: 1px solid var(--soft-line);
  padding: 16px 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hook-rerecord-option strong {
  display: block;
  font-size: 0.92rem;
}

.hook-rerecord-option p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.hook-rerecord-option .hook-rerecord-button {
  flex: 0 0 auto;
}

.preview-choice-section .preview-choice-help {
  margin: 0;
  max-width: 620px;
  font-size: 0.78rem;
}

.listening-label {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.listening-adjustment-module {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 16px;
  display: grid;
  gap: 0;
}

.listening-adjustment-head {
  padding-bottom: 13px;
}

.adjustment-group {
  border-top: 1px solid var(--soft-line);
  padding: 13px 0;
  display: grid;
  gap: 11px;
}

.adjustment-group:last-child {
  padding-bottom: 0;
}

.adjustment-group > div > strong {
  font-size: 0.92rem;
}

.entry-fit-controls {
  grid-template-columns: minmax(0, 1fr);
}

.fit-controls .entry-position-control {
  grid-template-columns: minmax(74px, auto) minmax(92px, 1fr) minmax(74px, auto);
  gap: 8px;
  padding: 10px;
}

.fit-controls .entry-position-control button {
  width: auto;
  min-width: 74px;
  height: 36px;
  padding: 0 12px;
}

.fit-controls .entry-position-control b {
  font-size: 0.8rem;
}

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

@media (max-width: 760px) {
  .producer-preview-head {
    display: grid;
  }

  .hook-check-record-entry,
  .hook-check-recording-state {
    grid-template-columns: 1fr;
  }

  .optimization-adjustments > div {
    grid-template-columns: 1fr;
  }

  .hook-rerecord-option {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Creator-first Melody capture and progressive Match results. */
.melody-capture-zone {
  min-height: 0;
  align-content: start;
  gap: 18px;
}

.melody-capture-heading {
  display: grid;
  gap: 6px;
}

.melody-capture-heading > strong {
  max-width: 430px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.06;
}

.melody-capture-heading > small {
  line-height: 1.5;
}

.capture-kicker,
.detail-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.melody-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.melody-entry,
.upload-zone .melody-entry {
  min-height: 116px;
  border: 1px solid var(--soft-line);
  background: #fffdf6;
  color: var(--text);
  padding: 15px;
  display: grid;
  place-items: start;
  align-content: start;
  gap: 5px;
  text-align: left;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.melody-entry:hover,
.melody-entry.is-selected {
  transform: translateY(-2px);
  border-color: var(--line);
  background: var(--line);
  color: var(--paper);
}

.melody-entry > span {
  margin-bottom: 5px;
  font-size: 1.45rem;
}

.melody-entry > strong {
  font-size: 0.98rem;
}

.melody-entry > small {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.35;
}

.melody-entry-limit {
  margin-top: auto;
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
}

.melody-entry.primary-entry {
  grid-column: 1 / -1;
  min-height: 132px;
  border-color: var(--line);
  background: #fffdf6;
  color: var(--text);
}

.melody-entry:hover > small,
.melody-entry:hover > .melody-entry-limit,
.melody-entry.is-selected > small,
.melody-entry.is-selected > .melody-entry-limit {
  color: rgba(255, 254, 250, 0.7);
}

.melody-entry.primary-entry:hover,
.melody-entry.primary-entry.is-selected {
  background: #292929;
  color: var(--paper);
}

.melody-input-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.melody-capture-live {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.melody-capture-live[hidden] {
  display: none;
}

.melody-capture-live video {
  width: 100%;
  max-height: 260px;
  border: 1px solid var(--line);
  background: #111;
  object-fit: cover;
  transform: scaleX(-1);
}

.capture-live-copy,
.capture-live-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.capture-live-copy > div {
  display: grid;
  gap: 3px;
}

.capture-live-copy small {
  color: var(--muted);
}

.capture-live-indicator {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--bad) 16%, transparent);
  animation: capture-pulse 1.2s ease-in-out infinite;
}

@keyframes capture-pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.82);
  }
}

.capture-live-actions {
  flex-wrap: wrap;
}

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

.melody-direction-panel {
  padding: 18px 20px;
}

.melody-direction-panel .mini-head {
  margin: 0;
}

.melody-direction-panel:not(.open) .tag-grid,
.melody-direction-panel:not(.open) .control-row,
.melody-direction-panel:not(.open) #reset-vibes {
  display: none;
}

.melody-direction-panel.open .tag-grid {
  display: flex;
  margin-top: 18px;
}

.melody-direction-panel.open .control-row {
  display: grid;
}

.melody-direction-panel #vibe-panel-toggle {
  border-color: var(--line);
  color: var(--text);
  min-width: 72px;
}

.melody-direction-panel.open .melody-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}

.melody-profile-field {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--soft-line);
  background: var(--surface);
}

.melody-profile-field > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.melody-profile-field > div:first-child strong {
  font-size: 0.88rem;
}

.melody-profile-field > div:first-child small {
  color: var(--muted);
  font-size: 0.7rem;
  text-align: right;
}

.melody-profile-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.melody-profile-options .tag {
  width: auto;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.melody-profile-options .tag.active {
  background: var(--line);
  color: var(--paper);
}

.beats-section .beat-grid {
  width: min(980px, 100%);
  grid-template-columns: 1fr;
  gap: 10px;
}

.match-result-card {
  position: relative;
  min-height: 0;
  padding: 0;
  display: block;
  overflow: hidden;
  cursor: pointer;
}

.match-result-card:hover,
.match-result-card.selected {
  transform: none;
  border-color: var(--line);
  background: var(--paper);
}

.match-rank {
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--dim);
  font-size: 0.68rem;
  font-weight: 900;
}

.match-card-summary {
  display: grid;
  grid-template-columns: minmax(124px, 0.34fr) minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
}

.match-fit {
  display: grid;
  justify-items: start;
  gap: 2px;
}

.match-fit-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.match-flames {
  font-size: 0.9rem;
  letter-spacing: -0.18em;
}

.match-fit-line > strong {
  font-size: 1.22rem;
  line-height: 1;
}

.tag-match-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid #d8b85c;
  background: #fff7d8;
  color: #765600;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.match-fit.strong .match-fit-line > strong {
  color: var(--bad);
}

.match-fit.promising .match-fit-line > strong {
  color: #8a4e26;
}

.match-beat-identity h3 {
  margin: 0 0 5px;
  font-size: clamp(1.12rem, 2vw, 1.42rem);
  line-height: 1.15;
}

.match-style-tags {
  margin: 0 0 7px;
}

.match-beat-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.compact-beat-audio {
  display: grid;
  grid-template-columns: auto;
  gap: 2px;
}

.compact-audio-toggle,
.match-detail-toggle {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  padding: 0 13px;
  font-size: 0.78rem;
  font-weight: 900;
}

.compact-audio-toggle:hover,
.compact-audio-toggle:not(:disabled):active {
  background: var(--line);
  color: var(--paper);
}

.match-detail-toggle {
  border-color: var(--soft-line);
  color: var(--muted);
}

.compact-audio-status {
  max-width: 104px;
  min-height: 1em;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.2;
}

.match-card-details {
  border-top: 1px solid var(--soft-line);
  background: var(--surface);
  padding: 18px 20px 20px;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(300px, 1.35fr);
  gap: 20px;
  cursor: default;
}

.beat-expression-profile,
.match-window-module {
  grid-column: 1 / -1;
}

.beat-expression-profile {
  display: grid;
  gap: 12px;
}

.expression-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.expression-profile-row {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  padding: 11px 12px;
  display: grid;
  gap: 8px;
}

.expression-profile-row > strong {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.expression-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.expression-tag-group span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 900;
}

.beat-expression-profile.is-fallback small {
  color: var(--muted);
  font-size: 0.72rem;
}

.match-window-module {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.match-window-module > div {
  display: grid;
  gap: 5px;
}

.match-window-module > div > strong {
  font-size: 0.9rem;
}

.match-window-module > div > small {
  color: var(--muted);
  font-weight: 900;
}

.match-window-module.is-unavailable {
  border-color: var(--soft-line);
}

.match-window-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 16px;
  margin: 8px 0 4px;
}

.match-window-data > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.match-window-data dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.match-window-data dd {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 900;
}

.match-card-details.no-reasons .professional-params {
  grid-column: 1 / -1;
}

.match-why,
.professional-params {
  display: grid;
  align-content: start;
  gap: 11px;
}

.match-why ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.match-why li {
  display: flex;
  gap: 8px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
}

.match-why li span {
  color: var(--good);
}

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

.professional-params dl > div {
  border: 1px solid var(--soft-line);
  background: var(--paper);
  padding: 9px;
}

.professional-params dt {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.professional-params dd {
  margin: 4px 0 0;
  font-size: 0.78rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.match-detail-actions {
  grid-column: 1 / -1;
  border-top: 1px solid var(--soft-line);
  padding-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.match-detail-actions > span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.match-detail-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.match-empty-state {
  min-height: 220px;
  padding: clamp(22px, 5vw, 46px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 22px;
  border-style: dashed;
  background: var(--surface);
}

.match-empty-state:hover {
  transform: none;
  background: var(--surface);
}

.match-empty-state h3 {
  margin: 0 0 8px;
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.match-empty-state small {
  display: block;
  max-width: 620px;
  line-height: 1.55;
}

.empty-orbit {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  font-size: 1.5rem;
}

.match-results-controls {
  width: min(980px, 100%);
  margin: 18px auto 0;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.match-legend {
  width: min(980px, 100%);
  margin: 0 auto 18px;
  border: 1px solid var(--soft-line);
  background: var(--paper);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.match-legend.has-vibe-preference {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.match-legend > div {
  display: grid;
  gap: 3px;
}

.match-legend > div[hidden],
.vibe-match-notice[hidden] {
  display: none;
}

.match-legend strong {
  font-size: 0.82rem;
}

.match-legend small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.vibe-match-notice {
  width: min(980px, 100%);
  margin: -8px auto 18px;
  border-left: 3px solid var(--warm);
  background: color-mix(in srgb, var(--warm) 9%, var(--paper));
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.5;
}

.match-results-controls[hidden] {
  display: none;
}

.match-results-controls button {
  min-width: min(280px, 100%);
  min-height: 48px;
}

.match-results-controls small {
  color: var(--muted);
  font-size: 0.72rem;
}

.required-marker {
  display: inline-flex;
  margin-left: 5px;
  color: #a63f2f;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

body.producer-upload-modal-open {
  overflow: hidden;
}

.producer-upload-validation-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 18, 15, 0.62);
  backdrop-filter: blur(5px);
}

.producer-upload-validation-modal[hidden] {
  display: none;
}

.producer-upload-validation-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  padding: clamp(24px, 5vw, 38px);
  box-shadow: 0 26px 80px rgba(12, 10, 8, 0.28);
}

.producer-upload-validation-dialog h3 {
  margin: 4px 0 22px;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.producer-upload-validation-dialog > strong {
  font-size: 0.84rem;
}

.producer-upload-validation-dialog ul {
  display: grid;
  gap: 9px;
  margin: 12px 0 20px;
  padding: 0;
  list-style: none;
}

.producer-upload-validation-dialog li {
  border: 1px solid color-mix(in srgb, #a63f2f 28%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, #a63f2f 7%, var(--paper));
  padding: 11px 13px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 850;
}

.producer-upload-validation-dialog li::before {
  content: "•";
  margin-right: 9px;
  color: #a63f2f;
}

.producer-upload-validation-dialog > p:last-of-type {
  color: var(--muted);
  line-height: 1.55;
}

.producer-upload-validation-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 1.35rem;
  cursor: pointer;
}

.producer-upload-validation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.producer-upload-validation-actions button {
  flex: 1 1 190px;
}

@media (max-width: 760px) {
  .melody-direction-panel.open .melody-profile-grid {
    grid-template-columns: 1fr;
  }

  .melody-profile-field > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .melody-profile-field > div:first-child small {
    text-align: left;
  }

  .match-legend {
    grid-template-columns: 1fr;
  }

  .melody-entry-grid {
    grid-template-columns: 1fr;
  }

  .melody-entry.primary-entry {
    grid-column: auto;
  }

  .melody-entry,
  .upload-zone .melody-entry,
  .melody-entry.primary-entry {
    min-height: 96px;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: center;
  }

  .melody-entry > span {
    grid-row: 1 / 3;
    margin: 0;
  }

  .melody-entry > small,
  .melody-entry > .melody-entry-limit {
    grid-column: 2;
  }

  .melody-entry > .melody-entry-limit {
    margin-top: 0;
    padding-top: 2px;
  }

  .melody-capture-zone {
    padding: 18px;
  }

  .capture-live-actions > button {
    flex: 1;
  }

  .match-card-summary {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
    padding: 18px 15px;
  }

  .match-card-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .match-card-actions > *,
  .match-card-actions .compact-audio-toggle {
    flex: 1;
    width: 100%;
  }

  .compact-beat-audio {
    flex: 1;
  }

  .compact-audio-status {
    max-width: none;
  }

.match-card-details {
    grid-template-columns: 1fr;
    padding: 16px;
}

  .expression-profile-grid {
    grid-template-columns: 1fr;
  }

  .match-window-module {
    align-items: stretch;
    flex-direction: column;
  }

  .match-window-data {
    grid-template-columns: 1fr;
  }

  .match-window-module button {
    width: 100%;
  }

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

  .match-detail-actions {
    grid-column: auto;
    align-items: stretch;
    flex-direction: column;
  }

  .match-detail-actions button {
    width: 100%;
  }

  .match-detail-buttons {
    width: 100%;
    flex-direction: column;
  }

  .match-empty-state {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
