:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #20231f;
  --muted: #63675f;
  --line: #d9ddd2;
  --panel: #ffffff;
  --accent: #1f6f5b;
  --accent-dark: #154b40;
  --soft: #edf3ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  min-height: 40px;
}

button:hover {
  border-color: var(--accent);
}

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

.workspace {
  display: grid;
  gap: 16px;
}

.toolbar,
.add-row,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

p,
span {
  color: var(--muted);
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  padding: 0 18px;
  font-weight: 700;
}

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

.add-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 12px;
  padding: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.panel {
  min-height: 220px;
  padding: 14px;
}

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

.playlist {
  display: grid;
  gap: 10px;
}

.placeholder {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
  background: var(--soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.playlist-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 92px auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.song-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.song-main strong,
.song-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-actions {
  display: flex;
  gap: 6px;
}

.item-actions button {
  width: 38px;
  padding: 0;
  font-weight: 700;
}

.side {
  display: grid;
  gap: 12px;
}

.song-list {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-right: 2px;
}

.song-list button {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 6px 10px;
  text-align: left;
}

.song-list strong {
  color: var(--accent-dark);
}

.song-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .toolbar,
  .add-row,
  .content,
  .playlist-item {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
  }

  .content {
    display: grid;
  }

  .item-actions {
    justify-content: flex-end;
  }

  .song-list {
    max-height: 360px;
  }
}
