:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --ink: #171717;
  --muted: #68635d;
  --line: #ddd7cd;
  --panel: #fffdf8;
  --panel-strong: #ffffff;
  --accent: #1e7f6e;
  --accent-dark: #126354;
  --accent-soft: #d9f2ec;
  --warn: #a55b16;
  --shadow: 0 20px 60px rgba(31, 27, 22, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(30, 127, 110, 0.14), transparent 36%),
    linear-gradient(220deg, rgba(201, 73, 54, 0.12), transparent 34%),
    var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 28px 0 22px;
}

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

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(3rem, 6vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: #45413b;
  font-size: 1.08rem;
  line-height: 1.6;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-strip span {
  border: 1px solid rgba(30, 127, 110, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  padding: 9px 12px;
  color: #2e4f48;
  font-size: 0.86rem;
  font-weight: 700;
}

.drop-zone {
  border: 1px dashed rgba(30, 127, 110, 0.45);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
  box-shadow: var(--shadow);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.drop-zone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.drop-content {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 132px;
  padding: 24px;
}

.drop-content svg {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #182521;
  padding: 13px;
  stroke: #d8fff5;
  stroke-width: 1.8;
  fill: none;
}

.drop-content p {
  margin-bottom: 0;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.track-list,
.editor-panel {
  border: 1px solid rgba(75, 67, 58, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 14px 42px rgba(31, 27, 22, 0.08);
}

.track-list {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 16px;
}

.panel-heading,
.editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.editor-top h2 {
  margin: 0;
}

.batch-actions {
  margin: 16px 0;
}

.track-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  margin-top: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 10px;
  color: inherit;
  text-align: left;
}

.track-item:hover,
.track-item.is-active {
  border-color: rgba(30, 127, 110, 0.22);
  background: #ffffff;
}

.track-art {
  width: 48px;
  aspect-ratio: 1;
  border-radius: 6px;
  background:
    linear-gradient(135deg, #1e7f6e, #f0bd5c),
    #e4ded2;
  background-size: cover;
  background-position: center;
}

.track-main {
  min-width: 0;
}

.track-main strong,
.track-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-main strong {
  font-size: 0.95rem;
}

.track-main small {
  margin-top: 4px;
  color: var(--muted);
}

.track-state {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--line);
}

.track-item.is-edited .track-state {
  background: var(--warn);
}

.tracks-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.tracks-empty p {
  margin: 0;
}

.editor-panel {
  min-height: 540px;
  padding: 22px;
}

.empty-editor {
  display: grid;
  place-content: center;
  min-height: 500px;
  text-align: center;
}

.empty-editor p {
  max-width: 480px;
  color: var(--muted);
  line-height: 1.55;
}

.editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.audio-preview {
  margin-top: 18px;
}

.audio-preview audio {
  display: block;
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  background: #ffffff;
}

.primary,
.secondary,
.ghost,
.artwork-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 7px;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
}

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

.primary:hover {
  background: var(--accent-dark);
}

.secondary,
.artwork-upload {
  border: 1px solid rgba(30, 127, 110, 0.22);
  background: #ffffff;
  color: var(--accent-dark);
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.ghost:hover {
  background: rgba(23, 23, 23, 0.05);
  color: var(--ink);
}

.full {
  width: 100%;
}

.editor-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  margin-top: 24px;
}

.artwork-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.artwork-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(30, 127, 110, 0.78), rgba(240, 189, 92, 0.85)),
    #e8e0d4;
  background-size: cover;
  background-position: center;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 900;
}

.artwork-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

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

label {
  display: grid;
  gap: 7px;
  color: #34312d;
  font-size: 0.82rem;
  font-weight: 800;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  padding: 11px 12px;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30, 127, 110, 0.12);
}

.raw-details {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.raw-details summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 900;
}

pre {
  max-height: 320px;
  overflow: auto;
  border-radius: 8px;
  background: #191714;
  padding: 16px;
  color: #f7f2e8;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 4;
  max-width: min(440px, calc(100vw - 40px));
  border-radius: 8px;
  background: #171717;
  color: #ffffff;
  padding: 13px 15px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .hero,
  .workspace,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .track-list {
    position: static;
    max-height: none;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding: 18px 0;
  }

  h1 {
    font-size: 3.2rem;
  }

  .drop-content {
    grid-template-columns: 1fr;
    min-height: auto;
  }

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

  .panel-heading,
  .editor-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .editor-actions,
  .primary,
  .secondary {
    width: 100%;
  }
}
