:root {
  color-scheme: dark;
  --bg: #111314;
  --panel: #f7f4ee;
  --panel-strong: #ffffff;
  --ink: #171817;
  --muted: #686d68;
  --line: rgba(23, 24, 23, 0.14);
  --dark-line: rgba(255, 255, 255, 0.2);
  --accent: #ff6f4a;
  --accent-dark: #b43a22;
  --orange: #ff6f4a;
  --green: #58c884;
  --blue: #5274db;
  --theme-left: rgba(255, 42, 128, 0.36);
  --theme-mid: rgba(155, 58, 224, 0.24);
  --theme-right: rgba(62, 106, 255, 0.32);
  --theme-glow: rgba(255, 42, 128, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
}

@property --theme-left {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(255, 111, 74, 0.48);
}

@property --theme-mid {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(190, 60, 224, 0.28);
}

@property --theme-right {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(82, 116, 219, 0.38);
}

@property --theme-glow {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(255, 111, 74, 0.22);
}

@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #ff6f4a;
}

@property --accent-dark {
  syntax: "<color>";
  inherits: true;
  initial-value: #b43a22;
}

@property --blue {
  syntax: "<color>";
  inherits: true;
  initial-value: #5274db;
}

@property --green {
  syntax: "<color>";
  inherits: true;
  initial-value: #58c884;
}

body[data-theme="house-groove"] {
  --accent: #ff884d;
  --accent-dark: #b9501f;
  --blue: #b84cff;
  --green: #ffcf6b;
  --theme-left: rgba(255, 120, 56, 0.58);
  --theme-mid: rgba(206, 54, 194, 0.28);
  --theme-right: rgba(143, 67, 255, 0.28);
  --theme-glow: rgba(255, 123, 64, 0.26);
}

body[data-theme="club-rave"] {
  --accent: #ff3e9d;
  --accent-dark: #ba2068;
  --blue: #17c8ff;
  --green: #7c5cff;
  --theme-left: rgba(255, 42, 145, 0.54);
  --theme-mid: rgba(136, 50, 255, 0.3);
  --theme-right: rgba(0, 197, 255, 0.42);
  --theme-glow: rgba(23, 200, 255, 0.24);
}

body[data-theme="chill-eclectic"] {
  --accent: #1fd6c5;
  --accent-dark: #087d78;
  --blue: #f3a744;
  --green: #59d99a;
  --theme-left: rgba(21, 210, 190, 0.5);
  --theme-mid: rgba(42, 178, 142, 0.24);
  --theme-right: rgba(236, 154, 58, 0.38);
  --theme-glow: rgba(31, 214, 197, 0.2);
}

body.is-set-generated {
  --theme-glow: color-mix(in srgb, var(--accent) 34%, transparent);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: #fff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  transition: background 700ms ease;
}

.page-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 42, 128, 0.16), transparent 34vw),
    radial-gradient(circle at 88% 18%, rgba(82, 116, 219, 0.18), transparent 32vw),
    url("assets/visual-hero.png") center / cover no-repeat,
    var(--bg);
}

.page-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 28%, rgba(255, 42, 128, 0.24), transparent 34%),
    radial-gradient(circle at 54% 58%, rgba(155, 58, 224, 0.18), transparent 34%),
    radial-gradient(circle at 92% 36%, rgba(62, 106, 255, 0.24), transparent 36%),
    linear-gradient(90deg, rgba(6, 7, 16, 0.42), rgba(6, 7, 16, 0.16) 46%, rgba(6, 7, 16, 0.08)),
    linear-gradient(180deg, rgba(6, 7, 16, 0.08), rgba(17, 19, 20, 0.92));
  opacity: 0.78;
  transition: opacity 1200ms ease;
}

.theme-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1800ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity;
}

.theme-layer--house {
  background:
    radial-gradient(circle at 12% 28%, rgba(255, 120, 56, 0.58), transparent 36%),
    radial-gradient(circle at 48% 58%, rgba(206, 54, 194, 0.24), transparent 34%),
    radial-gradient(circle at 92% 36%, rgba(143, 67, 255, 0.24), transparent 38%);
}

.theme-layer--rave {
  background:
    radial-gradient(circle at 10% 30%, rgba(255, 42, 145, 0.52), transparent 35%),
    radial-gradient(circle at 50% 58%, rgba(136, 50, 255, 0.32), transparent 35%),
    radial-gradient(circle at 92% 40%, rgba(0, 197, 255, 0.42), transparent 38%);
}

.theme-layer--chill {
  background:
    radial-gradient(circle at 12% 32%, rgba(21, 210, 190, 0.46), transparent 36%),
    radial-gradient(circle at 50% 60%, rgba(42, 178, 142, 0.22), transparent 35%),
    radial-gradient(circle at 92% 42%, rgba(236, 154, 58, 0.38), transparent 38%);
}

body[data-theme="house-groove"] .theme-layer--house,
body[data-theme="club-rave"] .theme-layer--rave,
body[data-theme="chill-eclectic"] .theme-layer--chill {
  opacity: 0.82;
}

body.is-set-generated[data-theme="house-groove"] .theme-layer--house,
body.is-set-generated[data-theme="club-rave"] .theme-layer--rave,
body.is-set-generated[data-theme="chill-eclectic"] .theme-layer--chill {
  opacity: 0.95;
}

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

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

.button,
.icon-button,
.status-pill,
.language-toggle__button,
.format-toggle__button,
.section-kicker,
.eyebrow,
.genre-bar__fill,
.output-state__icon,
.track__order button,
input,
select,
textarea {
  transition:
    background-color 1400ms cubic-bezier(0.22, 1, 0.36, 1),
    background 1400ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 1400ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 1400ms cubic-bezier(0.22, 1, 0.36, 1),
    color 1400ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 500ms ease,
    transform 180ms ease;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: clamp(500px, 64vh, 660px);
  overflow: visible;
}

.hero__shade {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: calc(100% - 40px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 0;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: 24px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
  font-weight: 600;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.nav a:hover {
  color: #fff;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.language-toggle__button {
  min-width: 42px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.language-toggle__button.is-active {
  background: #fff;
  color: var(--ink);
}

.hero__content {
  width: calc(100% - 40px);
  max-width: 1180px;
  margin: clamp(36px, 6vh, 58px) auto 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 620px;
  margin-bottom: 14px;
  font-size: clamp(4rem, 13vw, 9.5rem);
  line-height: 0.86;
  letter-spacing: 0;
}

.hero__copy {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(1.06rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.hero__source {
  max-width: 560px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.86rem;
  font-weight: 750;
}

.hero__source a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(500px, 1fr) minmax(300px, 0.72fr);
  gap: 22px;
  width: calc(100% - 40px);
  max-width: 1180px;
  margin: -34px auto 64px;
  align-items: start;
  position: relative;
  z-index: 2;
}

.builder,
.result {
  min-width: 0;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.builder {
  padding: 24px;
}

.result {
  padding: 24px;
  position: sticky;
  top: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.status-pill,
.time-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 11px;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
  font-weight: 800;
  font-size: 0.78rem;
}

.time-badge {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent-dark);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
}

.field-note--link {
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.helper-link {
  justify-self: start;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.import-card {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 10%, transparent), color-mix(in srgb, var(--accent) 7%, transparent)),
    #fff;
}

.import-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.import-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  letter-spacing: 0;
}

.import-card__badge {
  background: rgba(88, 200, 132, 0.14);
  color: #217044;
}

.import-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.file-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: calc(100% - 40px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 0 44px;
  color: rgba(255, 255, 255, 0.78);
}

.app-footer p {
  max-width: 860px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.55;
}

.app-footer .section-kicker {
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.52);
}

.app-footer a {
  align-self: flex-start;
  border: 1px solid var(--dark-line);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
}

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

.input-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(23, 24, 23, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 11px 12px;
}

.input-stats span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.input-stats strong {
  color: var(--ink);
  font-size: 1rem;
}

.insight-card {
  margin: 4px 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.insight-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.insight-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: 0;
}

.insight-card__badge {
  padding: 7px 10px;
  background: rgba(88, 200, 132, 0.14);
  color: #217044;
}

.insight-card__copy {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.5;
}

.genre-bars {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
}

.genre-bar {
  display: grid;
  grid-template-columns: minmax(92px, 0.45fr) minmax(110px, 1fr) 44px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 850;
}

.genre-bar__track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 24, 23, 0.08);
}

.genre-bar__fill {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.genre-bar__value {
  color: var(--muted);
  text-align: right;
}

.insight-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-bottom: 14px;
}

.insight-stats div {
  min-width: 0;
  background: var(--panel);
  padding: 12px;
}

.insight-stats span,
.recommendation span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-stats strong,
.recommendation strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.recommendation {
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 13px;
  margin-bottom: 14px;
}

.recommendation p {
  margin: 7px 0 0;
  color: #515751;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.parsed-card {
  margin: 4px 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.parsed-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.parsed-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: 0;
}

.parsed-card__copy {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.45;
}

.format-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.format-toggle__button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 9px;
  font-size: 0.75rem;
  font-weight: 900;
  cursor: pointer;
}

.format-toggle__button.is-active {
  background: var(--ink);
  color: #fff;
}

.parsed-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.parsed-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(23, 24, 23, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 9px 10px;
}

.parsed-row--low {
  border-color: rgba(255, 111, 74, 0.34);
  background: rgba(255, 111, 74, 0.07);
}

.parsed-row__index,
.parsed-row__confidence {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.parsed-row__main {
  min-width: 0;
}

.parsed-row__main strong,
.parsed-row__main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parsed-row__main strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.parsed-row__main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.parsed-row__swap {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 9px;
  font-size: 0.74rem;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 720px) {
  .parsed-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }
}

.insight-actions {
  gap: 8px;
}

.insight-actions--top {
  margin-bottom: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  outline: none;
  padding: 13px 14px;
  font-weight: 600;
}

textarea {
  resize: vertical;
  min-height: 112px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.builder.is-waiting-for-link .chips label,
.builder.is-waiting-for-link .insight-card {
  opacity: 0.62;
}

.builder.is-waiting-for-link .chips label,
.builder.is-waiting-for-analysis .chips label {
  cursor: not-allowed;
}

.builder.is-waiting-for-analysis .control-grid,
.builder.is-waiting-for-analysis .chips,
.builder.is-waiting-for-analysis .field:has(#djReference),
.builder.is-waiting-for-analysis .field:has(#notes),
.builder.is-waiting-for-analysis .actions:not(.insight-actions) {
  opacity: 0.58;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.set-warning {
  margin: -2px 0 16px;
  border: 1px solid rgba(255, 111, 74, 0.28);
  border-radius: 8px;
  background: rgba(255, 111, 74, 0.08);
  color: #6c321f;
  padding: 11px 12px;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.45;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  min-inline-size: 0;
  padding: 0;
  margin: 0 0 18px;
  border: 0;
}

.chips legend {
  width: 100%;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.chips label {
  cursor: pointer;
}

.chips input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chips span {
  display: inline-flex;
  max-width: 100%;
  min-height: 36px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 13px;
  color: #404540;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.chips input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.actions,
.export-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.export-bar__note {
  flex: 1 0 100%;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.button,
.icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.button {
  min-height: 46px;
  padding: 0 18px;
}

.button--primary {
  background: var(--accent);
  color: #171817;
}

.button--secondary {
  background: var(--ink);
  color: #fff;
}

.button--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.mix-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-bottom: 18px;
}

.mix-summary div {
  min-width: 0;
  background: #fff;
  padding: 14px;
}

.mix-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mix-summary strong {
  font-size: clamp(0.82rem, 1.5vw, 0.98rem);
}

.energy-curve {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  margin-bottom: 18px;
}

.energy-curve__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.energy-curve__header span,
.energy-curve__axis span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.energy-curve__header strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.98rem;
}

#energyCurvePeak {
  flex: 0 0 auto;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-dark);
  padding: 6px 9px;
}

.energy-curve__chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 130px;
}

.energy-curve__grid {
  fill: none;
  stroke: rgba(23, 24, 23, 0.08);
  stroke-width: 1;
}

.energy-curve__area {
  fill: color-mix(in srgb, var(--blue) 12%, transparent);
  transition: fill 1400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.energy-curve__line {
  fill: none;
  stroke: url("#energyCurveGradient");
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

#energyCurveGradient stop {
  transition: stop-color 1400ms cubic-bezier(0.22, 1, 0.36, 1);
}

#energyCurveGradient stop:nth-child(1) {
  stop-color: var(--accent);
}

#energyCurveGradient stop:nth-child(2) {
  stop-color: var(--green);
}

#energyCurveGradient stop:nth-child(3) {
  stop-color: var(--blue);
}

#energyCurvePoints circle {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 2.5;
  transition: stroke 1400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.energy-curve__axis {
  display: flex;
  justify-content: space-between;
  margin-top: -4px;
}

.result--compact {
  padding: 18px;
}

.result--compact .panel-header {
  align-items: center;
}

.result--compact .mix-summary,
.result--compact .energy-curve,
.result--compact .beta-note,
.result--compact .set-rationale,
.result--compact .playback-tip,
.result--compact .setlist-tools,
.result--compact .tracklist,
.result--compact .export-steps,
.result--compact .export-bar {
  display: none;
}

.result--compact .output-state {
  margin: 16px 0 0;
}

.output-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px dashed rgba(23, 24, 23, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 24px 18px;
  margin-bottom: 18px;
  text-align: center;
}

.output-state.is-hidden {
  display: none;
}

.output-state__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
  font-weight: 950;
}

.output-state.is-loading .output-state__icon {
  border: 4px solid color-mix(in srgb, var(--blue) 20%, transparent);
  border-top-color: var(--blue);
  background: transparent;
  color: transparent;
  animation: spin 0.85s linear infinite;
}

.output-state.is-success .output-state__icon {
  background: rgba(88, 200, 132, 0.16);
  color: #217044;
}

.output-state.is-error {
  border-color: rgba(255, 102, 62, 0.28);
  background: rgba(255, 102, 62, 0.08);
}

.output-state.is-error .output-state__icon {
  background: rgba(255, 102, 62, 0.14);
  color: var(--orange);
}

.output-state strong {
  color: var(--ink);
  font-size: 1rem;
}

.output-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
}

.beta-note,
.set-rationale,
.playback-tip,
.setlist-tools {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  margin-bottom: 12px;
}

.beta-note,
.set-rationale,
.playback-tip {
  padding: 13px 14px;
}

.beta-note strong,
.set-rationale strong,
.playback-tip strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 0.88rem;
}

.beta-note p,
.set-rationale p,
.playback-tip p,
.setlist-tools {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.45;
}

.beta-note p,
.set-rationale p,
.playback-tip p {
  margin: 0;
}

.set-rationale__reference {
  margin-top: 8px !important;
  color: var(--accent-dark) !important;
}

.playback-tip__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.playback-tip__links a {
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 11%, #fff);
  color: var(--accent-dark);
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
  transition:
    background-color 1400ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 1400ms cubic-bezier(0.22, 1, 0.36, 1),
    color 1400ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 180ms ease;
}

.playback-tip__links a:hover {
  transform: translateY(-1px);
}

.setlist-tools {
  padding: 10px 12px;
}

.export-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.export-steps span {
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, #fff);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 6px 8px;
}

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

.tracklist {
  display: grid;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  counter-reset: tracks;
}

.tracklist.is-loading {
  opacity: 0.45;
}

.track {
  animation: riseIn 0.32s ease both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.track {
  display: grid;
  grid-template-columns: 28px 44px minmax(0, 1fr) auto;
  grid-template-areas:
    "drag number name order"
    "drag number name meta"
    "drag number transition risk";
  column-gap: 12px;
  row-gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  counter-increment: tracks;
}

.track::before {
  content: counter(tracks, decimal-leading-zero);
  grid-area: number;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(88, 200, 132, 0.16);
  color: #217044;
  font-size: 0.76rem;
  font-weight: 900;
}

.track.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.track__drag {
  grid-area: drag;
  display: grid;
  place-items: center;
  width: 28px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
}

.track__drag:focus-visible {
  outline: 3px solid rgba(82, 116, 219, 0.25);
  outline-offset: 2px;
}

.track__name {
  grid-area: name;
  min-width: 0;
  max-width: 100%;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.track__order {
  grid-area: order;
  display: inline-flex;
  justify-self: end;
  gap: 5px;
}

.track__order button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

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

.track__name strong,
.track__name span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

.track__name strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: clamp(0.94rem, 1vw, 1.04rem);
  line-height: 1.22;
}

.track__name span,
.track__meta {
  color: var(--muted);
  font-size: clamp(0.74rem, 0.82vw, 0.82rem);
  font-weight: 700;
}

.track__meta {
  grid-area: meta;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.track__transition {
  grid-area: transition;
  color: #515751;
  font-size: 0.8rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.track__risk {
  grid-area: risk;
  justify-self: end;
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 0.7rem;
  font-weight: 950;
  white-space: nowrap;
}

.track__risk--smooth {
  background: rgba(88, 200, 132, 0.16);
  color: #217044;
}

.track__risk--check {
  background: rgba(255, 192, 72, 0.18);
  color: #7d5600;
}

.track__risk--risky {
  background: rgba(255, 102, 62, 0.14);
  color: #a23b1f;
}

@media (max-width: 620px) {
  .track {
    grid-template-columns: 28px 38px minmax(0, 1fr);
    grid-template-areas:
      "drag number name"
      "drag number order"
      "drag number meta"
      "drag number risk"
      "drag number transition";
  }

  .track__order,
  .track__meta,
  .track__risk {
    grid-column: auto;
    justify-self: start;
  }

  .track__meta {
    text-align: left;
  }

  .track__transition {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  .nav {
    display: none;
  }

  .app-footer {
    display: grid;
  }

  .topbar__right {
    gap: 0;
  }

  .hero {
    min-height: 590px;
  }

  .hero__content {
    margin-top: 80px;
  }

  .workspace {
    grid-template-columns: 1fr;
    margin-top: -70px;
  }

  .result {
    position: static;
  }
}

@media (max-width: 560px) {
  .topbar,
  .hero__content,
  .workspace {
    width: calc(100vw - 56px);
  }

  .builder,
  .result {
    padding: 18px;
  }

  h1 {
    font-size: clamp(3.35rem, 18vw, 4.4rem);
  }

  .hero__copy {
    max-width: min(100%, 310px);
  }

  .control-grid,
  .mix-summary,
  .insight-stats {
    grid-template-columns: 1fr;
  }

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

  .genre-bar__track {
    grid-column: 1 / 3;
    order: 3;
  }

  .track {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "number name"
      "number order"
      "number meta"
      "number risk"
      "number transition";
  }

  .track__drag {
    display: none;
  }

  .chips label {
    flex: 0 1 100%;
  }

  .chips span {
    justify-content: center;
    width: 100%;
    padding-inline: 8px;
  }

  .track__meta {
    text-align: left;
  }

  .track__order,
  .track__meta,
  .track__risk {
    justify-self: start;
  }
}

@media (min-width: 561px) and (max-width: 620px) {
  .track {
    grid-template-columns: 28px 38px minmax(0, 1fr);
    grid-template-areas:
      "drag number name"
      "drag number order"
      "drag number meta"
      "drag number risk"
      "drag number transition";
  }

  .track__order,
  .track__meta,
  .track__risk {
    justify-self: start;
  }

  .track__meta {
    text-align: left;
  }
}
