:root {
  color-scheme: light;
  --bg: #f3eadf;
  --bg-deep: #e8dccb;
  --panel: rgba(255, 250, 245, 0.82);
  --panel-strong: rgba(255, 252, 248, 0.95);
  --line: rgba(82, 58, 35, 0.12);
  --line-strong: rgba(82, 58, 35, 0.18);
  --text: #241b15;
  --muted: #6d5b4d;
  --accent: #2d7d63;
  --accent-soft: #79a98d;
  --accent-warm: #cc704d;
  --danger: #b4473d;
  --shadow: 0 22px 60px rgba(58, 36, 18, 0.12);
  --radius-panel: 20px;
  --radius-card: 8px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 10%, rgba(121, 169, 141, 0.18), transparent 20%),
    radial-gradient(circle at 86% 14%, rgba(204, 112, 77, 0.13), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(45, 125, 99, 0.08), transparent 24%),
    linear-gradient(180deg, #f7efe5 0%, #eee2d1 100%);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0)),
    radial-gradient(circle at top right, rgba(255, 214, 190, 0.2), transparent 24%);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  min-height: 100dvh;
  padding:
    calc(18px + var(--safe-top))
    calc(18px + var(--safe-right))
    calc(28px + var(--safe-bottom))
    calc(18px + var(--safe-left));
}

.topbar,
.content-shell {
  width: min(1320px, calc(100vw - 36px));
  margin: 0 auto;
}

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

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

.brand-badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 4px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow);
}

.brand-badge img {
  width: 100%;
  height: 100%;
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-copy h1,
.compose-head h2,
.empty-title {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.brand-copy h1 {
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 0.98;
}

.brand-copyline {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.45;
}

.eyebrow,
.meta-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.topbar-actions,
.form-actions,
.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ghost-button,
.primary-button {
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.58);
}

.ghost-button:hover,
.primary-button:hover,
.song-action:hover,
.service-link:hover {
  transform: translateY(-1px);
}

.primary-button {
  border-color: rgba(45, 125, 99, 0.26);
  color: #fbfff8;
  background: linear-gradient(180deg, #35866c, #2d725b);
  box-shadow: 0 12px 24px rgba(45, 125, 99, 0.18);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 251, 245, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(140%);
}

.hero,
.compose,
.toolbar {
  padding: 18px;
}

.content-shell {
  display: grid;
  gap: 16px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 16px;
}

.hero-copy {
  display: grid;
  gap: 14px;
}

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

.hero-chip,
.chip,
.status-chip,
.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.68);
}

.hero-status {
  display: grid;
  gap: 4px;
  align-content: start;
}

.stat-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.hero-note {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(121, 169, 141, 0.1), transparent 42%),
    rgba(255, 255, 255, 0.7);
}

.hero-note p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.compose-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.compose-head h2 {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.compose-tip {
  margin: 0;
  max-width: 44ch;
  color: var(--muted);
  line-height: 1.5;
}

.compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
}

.song-form {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 2px;
}

.song-form.is-drop-target {
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(45, 125, 99, 0.14);
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select,
.search-field input,
.sort-field select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 12px 12px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input:focus,
.search-field input:focus,
.sort-field select:focus {
  border-color: rgba(45, 125, 99, 0.52);
  box-shadow: 0 0 0 3px rgba(45, 125, 99, 0.12);
}

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

.is-hidden {
  display: none;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.preview-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-chip {
  color: var(--muted);
}

.song-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1.2fr) minmax(0, 0.8fr);
  aspect-ratio: 1 / 2;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 28px rgba(66, 46, 22, 0.08);
}

.song-card.preview-card {
  min-height: 100%;
}

.song-cover {
  position: relative;
  min-height: 0;
  background:
    linear-gradient(145deg, var(--cover-start, #c0d7c8), var(--cover-end, #547f69));
  overflow: hidden;
}

.song-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.08));
  mix-blend-mode: screen;
}

.song-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #fdfbf8;
  text-align: center;
}

.fallback-mark {
  display: grid;
  gap: 8px;
  place-items: center;
}

.fallback-mark strong {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.fallback-mark span {
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.song-body {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94));
  border-top: 1px solid rgba(82, 58, 35, 0.08);
}

.song-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chip {
  background: rgba(45, 125, 99, 0.08);
}

.chip.soft {
  color: var(--muted);
  background: rgba(204, 112, 77, 0.08);
}

.song-body h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 1.55vw, 1.18rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.song-artist,
.song-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.song-artist {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.song-note {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.song-note {
  padding-left: 10px;
  border-left: 2px solid rgba(45, 125, 99, 0.22);
}

.service-links,
.card-actions {
  display: grid;
  gap: 5px;
}

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

.card-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 180ms ease,
    opacity 180ms ease;
}

.service-link,
.song-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.82);
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
  min-height: 34px;
}

.song-card:hover .card-actions,
.song-card:focus-within .card-actions {
  max-height: 48px;
  opacity: 1;
}

.service-link.primary {
  color: #174c3b;
  border-color: rgba(45, 125, 99, 0.18);
  background: rgba(45, 125, 99, 0.08);
}

.service-link.spotify {
  color: #254f38;
  border-color: rgba(45, 125, 99, 0.14);
}

.service-link.youtube {
  color: #7a2d2a;
  border-color: rgba(204, 112, 77, 0.18);
  background: rgba(204, 112, 77, 0.08);
}

.service-link.pandora {
  color: #4f336f;
  border-color: rgba(111, 83, 154, 0.16);
  background: rgba(111, 83, 154, 0.08);
}

.song-action.danger {
  color: var(--danger);
  background: rgba(180, 71, 61, 0.08);
}

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

.search-field,
.sort-field {
  min-width: 220px;
}

.count-pill {
  color: var(--muted);
}

.garden-section {
  display: grid;
  gap: 14px;
}

.empty-state {
  padding: 20px;
  display: grid;
  gap: 6px;
}

.empty-title {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
}

.empty-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.section-list {
  display: grid;
  gap: 14px;
}

.section-group {
  display: grid;
  gap: 12px;
}

.section-group-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px;
}

.section-group-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  letter-spacing: -0.03em;
}

.section-group-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.section-song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.section-song-grid .song-card {
  min-height: 100%;
  aspect-ratio: 1 / 2;
}

.song-card.is-editing {
  border-color: rgba(45, 125, 99, 0.38);
  box-shadow: 0 16px 30px rgba(45, 125, 99, 0.14);
}

@media (max-width: 980px) {
  .topbar,
  .compose-head,
  .toolbar {
    align-items: start;
  }

  .hero,
  .compose-grid {
    grid-template-columns: 1fr;
  }

  .song-card {
    aspect-ratio: 1 / 2;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding:
      calc(14px + var(--safe-top))
      calc(14px + var(--safe-right))
      calc(22px + var(--safe-bottom))
      calc(14px + var(--safe-left));
  }

  .topbar {
    margin-bottom: 14px;
  }

  .brand {
    align-items: start;
  }

  .brand-badge {
    width: 56px;
    height: 56px;
  }

  .hero,
  .compose,
  .toolbar {
    padding: 14px;
    border-radius: 16px;
  }

  .section-song-grid {
    grid-template-columns: 1fr;
  }

  .search-field,
  .sort-field {
    min-width: 0;
    width: 100%;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }

  .toolbar-right {
    justify-content: space-between;
  }
}
