:root {
  --page: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f0f3f8;
  --ink: #050914;
  --muted: #687084;
  --line: #dde3ee;
  --accent: #7a4dff;
  --accent-strong: #111827;
  --accent-soft: #f0ebff;
  --brand-pink: #ff3aa5;
  --brand-purple: #8d48ff;
  --brand-blue: #287cff;
  --warn: #b45309;
  --danger: #b42318;
  --dark: #050914;
  --shadow: 0 18px 45px rgba(5, 9, 20, 0.09);
  --brand-gradient: linear-gradient(135deg, var(--brand-blue), var(--brand-purple) 52%, var(--brand-pink));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.modern {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.playlist-page {
  background: var(--playlist-theme, var(--page));
}

a {
  color: var(--accent-strong);
}

.site-nav,
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 40px;
  background: rgba(247, 248, 251, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup img {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(5, 9, 20, 0.16);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a,
.text-link {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover,
.text-link:hover {
  color: var(--ink);
}

.hero-home {
  position: relative;
  min-height: 68vh;
  display: flex;
  align-items: center;
  padding: 88px 40px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 9, 20, 0.96), rgba(5, 9, 20, 0.74)),
    url("/images/music_collaboration.jpg") center right / cover no-repeat;
  color: #ffffff;
}

.hero-inner,
.section-inner,
.app-shell,
.auth-card,
.form-card,
.playlist-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.hero-copy {
  max-width: 620px;
}

.hero-logo-mark {
  display: block;
  width: 74px;
  height: 74px;
  margin-bottom: 22px;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.eyebrow {
  margin: 0 0 14px;
  color: #d8d9ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-card .eyebrow,
.form-card .eyebrow {
  color: var(--brand-purple);
}

.page-title .eyebrow,
.playlist-title .eyebrow,
.section-heading .eyebrow {
  color: var(--accent-strong);
}

.app-header .eyebrow,
.hero-copy .eyebrow {
  color: #b8ddd6;
}

.hero-copy h1,
.page-title h1,
.auth-card h1,
.form-card h1,
.playlist-title h1 {
  margin: 0;
  color: inherit;
  font-size: 46px;
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-copy p,
.page-title p,
.auth-card p,
.form-card p,
.muted {
  color: var(--muted);
}

.hero-copy p {
  max-width: 580px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.hero-actions,
.toolbar,
.button-row,
.share-links,
.spotify-paste,
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 28px;
}

.button,
.btn,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--brand-gradient);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.btn:hover,
button:hover,
input[type="submit"]:hover {
  background: linear-gradient(135deg, #1769f0, #743bff 52%, #ed238f);
}

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

.button.secondary,
.btn-secondary,
.button-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.button.secondary:hover,
.btn-secondary:hover,
.button-secondary:hover {
  background: var(--surface-soft);
}

.button.danger,
.btn-danger,
.delete-btn {
  background: var(--danger);
  color: #ffffff;
}

.button.dark {
  background: var(--dark);
  color: #ffffff;
}

.section-band {
  padding: 56px 0;
  background: var(--page);
}

.section-band.alt {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 680px;
  margin-bottom: 28px;
}

.section-heading h2,
.section-heading h3,
.page-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.16;
  letter-spacing: 0;
}

.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
}

.feature-grid,
.plan-grid,
.stats,
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.feature-card,
.plan,
.stat-card,
.playlist-card,
.panel,
.track-add-box,
.guest-access-box,
.track {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.feature-card,
.plan,
.stat-card,
.playlist-card,
.panel {
  padding: 20px;
}

.feature-card h3,
.plan h3,
.plan h4,
.stat-card h3,
.playlist-card h3,
.playlist-card h4,
.panel h3,
.track-add-box h3,
.guest-access-box h3 {
  margin: 0 0 8px;
  color: var(--ink);
}

.feature-card p,
.plan p,
.stat-card p,
.playlist-card p,
.panel p {
  margin: 0;
  color: var(--muted);
}

.stat-card.stat-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.stat-card.alert {
  border-left: 5px solid var(--danger);
}

.stat-card.alert h3,
.stat-card.alert .stat-number {
  color: var(--danger);
}

.plan-price,
.stat-number {
  color: var(--brand-purple);
  font-size: 28px;
  font-weight: 800;
}

.plan ul {
  margin: 16px 0 20px;
  padding-left: 20px;
  color: var(--muted);
}

.plan li {
  margin-bottom: 8px;
}

.app-shell,
.playlist-shell {
  padding: 34px 0 56px;
}

.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.app-header {
  background: linear-gradient(135deg, #050914, #111827 58%, #19112c);
  color: #ffffff;
  padding: 36px 0;
}

.app-header .page-title {
  margin-bottom: 0;
}

.app-header p {
  color: rgba(255, 255, 255, 0.72);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.action-tile {
  display: block;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.action-tile strong {
  display: block;
  margin-bottom: 4px;
}

.action-tile span {
  color: var(--muted);
  font-size: 14px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-top: 24px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table form {
  margin: 0;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 6px 6px 0;
}

.inline-form select,
.inline-form input {
  width: auto;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-chip.good {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-chip.warn {
  background: #fff7ed;
  color: var(--warn);
}

.status-chip.danger {
  background: #fef3f2;
  color: var(--danger);
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.range-control {
  width: 100%;
  accent-color: var(--accent);
}

.output {
  margin-top: 12px;
  color: var(--accent-strong);
  font-size: 18px;
  font-weight: 800;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.photo-card {
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}

.photo-card form {
  display: flex;
  gap: 8px;
}

.usage-bar {
  width: 100%;
  height: 28px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.usage-fill {
  height: 100%;
  min-width: 42px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 28px;
  text-align: center;
}

.usage-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

@media (max-width: 860px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .auth-brand {
    margin-bottom: 42px;
  }

  .auth-card,
  .form-card {
    max-width: none;
  }
}

.auth-page {
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 52px) 20px;
  background:
    linear-gradient(180deg, #fbfcff 0%, #eef2f8 100%);
}

.auth-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: stretch;
}

.auth-intro {
  position: relative;
  display: flex;
  min-height: 560px;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px;
  background: linear-gradient(145deg, #050914 0%, #111827 62%, #251247 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ffffff;
  box-shadow: 0 24px 70px rgba(5, 9, 20, 0.18);
}

.auth-intro::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: 0;
  left: 34px;
  height: 4px;
  background: var(--brand-gradient);
  border-radius: 999px 999px 0 0;
}

.auth-intro > * {
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.auth-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
}

.auth-card-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.auth-card-brand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(5, 9, 20, 0.14);
}

.auth-intro h1 {
  max-width: 620px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-intro p:not(.eyebrow) {
  max-width: 560px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.auth-proof-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.auth-proof-grid span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 800;
}

.auth-card,
.form-card {
  max-width: 460px;
  padding: 32px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(5, 9, 20, 0.12);
}

.auth-shell .auth-card {
  align-self: center;
}

.auth-shell .auth-card-brand {
  display: none;
}

.form-card {
  margin-top: 48px;
  margin-bottom: 48px;
}

.auth-card h1,
.auth-card h2,
.form-card h1 {
  font-size: 30px;
}

.auth-card h2 {
  margin: 0;
  color: var(--ink);
  line-height: 1.1;
}

.auth-card-copy {
  margin-top: 8px;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
}

@media (max-width: 900px) {
  .auth-shell {
    width: min(560px, 100%);
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: 0;
    padding: 28px;
  }

  .auth-brand {
    margin-bottom: 48px;
  }

  .auth-intro h1 {
    font-size: 34px;
  }

  .auth-shell .auth-card {
    justify-self: center;
    width: 100%;
  }
}

.form-grid {
  display: grid;
  gap: 14px;
}

label {
  color: var(--ink);
  font-weight: 800;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="file"],
input[type="color"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(141, 72, 255, 0.18);
  border-color: var(--accent);
}

.check-row,
.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-row input,
.checkbox-row input {
  width: auto;
  margin-top: 4px;
}

.hint {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.error {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef3f2;
  color: var(--danger);
  font-weight: 700;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  justify-content: center;
  margin-top: 16px;
  text-align: center;
}

.playlist-hero-image {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.playlist-shell {
  max-width: 980px;
}

.playlist-card-main {
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.playlist-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.playlist-title h1 {
  color: var(--ink);
  font-size: 34px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.track-add-box,
.guest-access-box {
  margin-top: 18px;
  padding: 18px;
  box-shadow: none;
}

.search-row {
  align-items: stretch;
}

.search-row input {
  flex: 1 1 260px;
}

#search_results {
  margin-top: 12px;
}

.search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.search-result > div {
  flex: 1;
  min-width: 0;
}

.search-result audio,
.apple-preview audio {
  width: 100%;
  margin-top: 8px;
}

.explicit {
  display: inline-block;
  margin-left: 8px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.apple-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.apple-preview img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}

.apple-preview-body {
  flex: 1;
  min-width: 0;
}

.track-list {
  margin-top: 16px;
}

#preview-container {
  min-height: 0;
}

.mt-sm {
  margin-top: 10px;
}

.mt-md {
  margin-top: 20px;
}

.mt-lg {
  margin-top: 28px;
}

.pb-0 {
  padding-bottom: 0;
}

.is-hidden {
  display: none;
}

.track {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  margin-top: 10px;
  box-shadow: none;
}

.track-info {
  flex: 1;
  min-width: 0;
}

.track-title {
  font-weight: 800;
}

.cover-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-soft);
}

.playlist-card a {
  color: inherit;
  text-decoration: none;
}

.visibility-toggle {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 760px) {
  .site-nav,
  .app-nav {
    align-items: flex-start;
    padding: 16px 20px;
    flex-direction: column;
  }

  .hero-home {
    min-height: 0;
    padding: 68px 20px;
    background-position: center;
  }

  .hero-inner,
  .section-inner,
  .app-shell,
  .auth-card,
  .form-card,
  .playlist-shell {
    width: min(1120px, calc(100% - 28px));
  }

  .auth-shell {
    width: min(1020px, calc(100% - 28px));
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .auth-page .auth-intro {
    display: none;
  }

  .auth-shell .auth-card-brand {
    display: inline-flex;
  }

  .auth-card,
  .form-card {
    width: 100%;
    padding: 24px;
    margin-inline: auto;
  }

  .hero-copy h1,
  .page-title h1,
  .playlist-title h1 {
    font-size: 34px;
  }

  .page-title,
  .playlist-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-result,
  .track {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .btn,
  button,
  input[type="submit"] {
    width: 100%;
  }
}
