:root {
  --bg: #f7f7f3;
  --surface: #ffffff;
  --line: #deded6;
  --text: #202124;
  --muted: #666a6d;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --danger-bg: #fff1f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

.site-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--accent-dark);
  font-size: 20px;
  font-weight: 800;
}

.main-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
}

.main-nav a,
.logout-form button,
.button-link,
.primary-button,
.secondary-button,
.danger-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
}

.main-nav a {
  color: var(--muted);
  padding: 6px 0;
}

.main-nav .button-link,
.primary-button {
  background: var(--accent);
  color: white;
  padding: 9px 14px;
}

.logout-form {
  margin: 0;
}

.logout-form button,
.secondary-button {
  background: #e9ece8;
  color: var(--text);
}

.danger-button {
  background: var(--danger-bg);
  color: var(--danger);
}

.page-shell {
  margin: 0 auto;
  max-width: 1120px;
  padding: 40px 24px 72px;
}

.hero {
  align-items: center;
  background: linear-gradient(135deg, #fdfdfb 0%, #e5f4f1 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  min-height: 320px;
  padding: 48px;
}

.hero-cover {
  aspect-ratio: 1;
  border: 1px solid rgba(17, 94, 89, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(32, 33, 36, 0.12);
  height: auto;
  justify-self: end;
  max-width: 100%;
  object-fit: cover;
  width: 320px;
}

.hero h1,
.page-title-row h1,
.detail-heading h1,
.form-shell h1 {
  font-size: 42px;
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0;
}

.hero-copy,
.lead {
  color: var(--muted);
  font-size: 18px;
  max-width: 680px;
}

.hero-copy {
  white-space: nowrap;
}

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

.action-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.action-row.compact {
  margin-top: 0;
}

.two-column {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 32px;
}

.detail-columns {
  align-items: start;
}

.section-heading,
.page-title-row,
.detail-heading {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading h2,
.track-card h2,
.form-shell h2 {
  font-size: 22px;
  margin: 0;
}

.section-heading a {
  color: var(--accent-dark);
  font-weight: 700;
}

.list-panel,
.detail-panel,
.form-shell,
.track-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.list-item {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding: 18px 20px;
}

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

.list-item span,
.meta,
.help-text,
.auth-link {
  color: var(--muted);
}

.list-item.static {
  color: var(--text);
}

.empty-state {
  color: var(--muted);
  margin: 0;
  padding: 24px;
}

.page-title-row {
  margin-bottom: 24px;
}

.track-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.track-card {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.ranking-card {
  position: relative;
}

.rank-badge {
  align-items: center;
  background: var(--accent-dark);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  left: 14px;
  min-width: 38px;
  padding: 0 12px;
  position: absolute;
  top: 14px;
}

.track-cover,
.detail-cover {
  aspect-ratio: 1;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.track-cover {
  border: 1px solid var(--line);
  max-height: 260px;
}

.track-card h2 a {
  color: var(--text);
}

.rating-summary {
  align-items: baseline;
  display: flex;
  gap: 8px;
}

.rating-summary strong {
  color: var(--accent-dark);
  font-size: 32px;
}

.rating-summary span {
  color: var(--muted);
}

.rating-summary.large strong {
  font-size: 46px;
}

audio {
  width: 100%;
}

.detail-panel,
.form-shell {
  padding: 28px;
}

.track-detail-header {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: 220px minmax(0, 1fr);
}

.track-detail-header .detail-heading {
  margin-bottom: 0;
}

.detail-cover {
  border: 1px solid var(--line);
  max-width: 220px;
}

.body-text {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 24px;
}

.wide-player {
  margin-top: 18px;
}

.form-shell {
  margin: 0 auto;
  max-width: 720px;
}

.form-shell.inline {
  margin: 0;
  max-width: none;
}

.auth-shell {
  max-width: 480px;
}

.stacked-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  font-weight: 800;
}

.form-field input,
.form-field textarea,
.form-field select {
  background: #fff;
  border: 1px solid #cfd3cf;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

.form-field textarea {
  resize: vertical;
}

.field-error,
.form-errors {
  color: var(--danger);
  margin: 0;
}

.help-text {
  font-size: 14px;
}

.help-text ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.message {
  background: #e6f4f1;
  border: 1px solid #b8ddd6;
  border-radius: 8px;
  margin: 0;
  padding: 12px 14px;
}

.user-label {
  color: var(--accent-dark);
  font-weight: 800;
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .page-shell {
    padding: 24px 16px 48px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 28px;
  }

  .hero-cover {
    justify-self: start;
    width: min(100%, 280px);
  }

  .hero h1,
  .page-title-row h1,
  .detail-heading h1,
  .form-shell h1 {
    font-size: 32px;
  }

  .hero-copy {
    white-space: normal;
  }

  .two-column,
  .track-detail-header,
  .detail-heading,
  .page-title-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .detail-cover {
    max-width: 220px;
  }

  .section-heading,
  .page-title-row,
  .detail-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}
