:root {
  --bg: #faf8f5; --fg: #1f1d1a; --muted: #6b665e; --line: #e3ded6; --card: #ffffff;
  --accent: #b5482a; --accent-fg: #ffffff; --ok: #2f7a3b; --bad: #b3261e; --notice: #fff4d6;
  --radius: 8px; --max: 1080px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514; --fg: #ece8e1; --muted: #a39d93; --line: #34312d; --card: #1f1e1c;
    --accent: #e0714f; --accent-fg: #161514; --ok: #6cc07a; --bad: #f2867d; --notice: #3a3220;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
img { max-width: 100%; }
main { max-width: var(--max); margin: 0 auto; padding: 16px 16px 120px; }
h1 { font-size: 1.8rem; line-height: 1.2; margin: .3em 0 .4em; }
h2 { font-size: 1.2rem; margin: 1.6em 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.ok { color: var(--ok); } .bad { color: var(--bad); }
.text { white-space: pre-line; overflow-wrap: anywhere; }
.lead { font-size: 1.15rem; color: var(--muted); }
.notice { background: var(--notice); padding: 10px 14px; border-radius: var(--radius); }
.tag { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
       border: 1px solid currentColor; border-radius: 4px; padding: 1px 6px; vertical-align: middle; }
.hp { position: absolute; left: -9999px; }

/* header / footer */
.bar { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between;
       padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
.bar nav { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.bar nav a { text-decoration: none; }
.bar nav .muted { color: var(--muted); }
footer { text-align: center; color: var(--muted); padding: 24px 16px 140px; font-size: .9rem; }
footer a { color: var(--muted); }

/* forms */
form.inline { display: inline; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.narrow { max-width: 460px; margin: 24px auto; }
label, .field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; font-weight: 500; }
label .muted, .field .muted { font-weight: 400; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line);
       border-radius: 6px; padding: 8px 10px; width: 100%; }
input[type=checkbox] { width: auto; margin-top: 4px; }
input[type=file] { padding: 6px; }
textarea { resize: vertical; }
.row { display: flex; gap: 12px; } .row > label { flex: 1; }
.row.wrap { flex-wrap: wrap; align-items: flex-end; }
.row.wrap > label { min-width: 200px; margin-bottom: 0; }
button, .button { font: inherit; font-weight: 600; cursor: pointer; display: inline-block; text-decoration: none;
       background: var(--accent); color: var(--accent-fg); border: 1px solid var(--accent);
       border-radius: 6px; padding: 8px 16px; }
button:disabled { opacity: .5; cursor: progress; }
.secondary { background: transparent; color: var(--fg); border-color: var(--line); }
.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button.small, .button.small { padding: 4px 10px; font-size: .86rem; }
button.link { background: none; border: 0; padding: 0; font-weight: 400; color: var(--muted); }
.danger-zone { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
progress { width: 100%; margin-top: 8px; }

/* public listings */
.hero { padding: 16px 0 8px; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid a { display: flex; flex-direction: column; gap: 2px; color: var(--fg); text-decoration: none; }
.grid a:hover strong { text-decoration: underline; }
.cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--line); display: block; margin-bottom: 6px; }
.cover.none { display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px;
              color: var(--muted); font-weight: 600; overflow: hidden; }
.artists { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.artists a { display: flex; gap: 12px; align-items: center; color: var(--fg); text-decoration: none; }
.artists a span { display: flex; flex-direction: column; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar.none { display: flex; align-items: center; justify-content: center; background: var(--line);
               color: var(--muted); font-weight: 700; font-size: 1.4rem; }
.profile, .release { display: grid; gap: 24px; grid-template-columns: minmax(0, 320px) 1fr; align-items: start; }
.photo { width: 100%; border-radius: var(--radius); }
.photo.small { width: 160px; }
.links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.by { font-size: 1.1rem; margin: 0 0 16px; }
.play-all { font-size: 1.05rem; padding: 10px 22px; }
@media (max-width: 640px) { .profile, .release { grid-template-columns: 1fr; } .row { flex-direction: column; gap: 0; } }

/* tracklist */
ol.tracks { list-style: none; padding: 0; margin: 24px 0; border-top: 1px solid var(--line); }
ol.tracks li { border-bottom: 1px solid var(--line); }
button.track { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 8px; width: 100%; text-align: left;
               background: none; color: var(--fg); border: 0; border-radius: 0; padding: 12px 4px; font-weight: 400; }
button.track:hover { background: var(--card); }
.track .n { color: var(--muted); }
li.playing .track { color: var(--accent); font-weight: 600; }
.tracks .notes { padding: 0 4px 12px 2.8em; font-size: .92rem; }
.player { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
          padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.player button { padding: 6px 12px; background: transparent; color: var(--fg); border-color: var(--line); }
.player .now { flex: 1; min-width: 140px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player audio { flex: 1 1 100%; width: 100%; height: 36px; }
@media (min-width: 800px) { .player audio { flex: 2 1 320px; } }

/* studio + admin */
.head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.head h1 { margin-right: auto; }
.head p { margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
table.list { width: 100%; border-collapse: collapse; }
.list th, .list td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list th { font-size: .86rem; color: var(--muted); font-weight: 600; }
td.thumb { width: 64px; } td.thumb .cover { width: 56px; margin: 0; font-size: .6rem; padding: 2px; }
.tracks-edit input.pos { width: 3.4em; text-align: center; }
.tracks-edit textarea { margin-top: 4px; font-size: .9rem; }
.tracks-edit td.actions { white-space: nowrap; }
.field .cover { width: 160px; }
@media (max-width: 640px) {
  .tracks-edit thead { display: none; }
  .tracks-edit tr { display: grid; grid-template-columns: 3.6em 1fr; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tracks-edit td { border: 0; padding: 4px; }
  .tracks-edit td:nth-child(n+3) { grid-column: 2; }
}
ul.users { list-style: none; padding: 0; }
.users li { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.users li.pending { border-color: var(--accent); }
.users .who { display: flex; flex-direction: column; gap: 2px; min-width: 240px; flex: 1; }
.users .note { background: var(--bg); border-radius: 6px; padding: 8px; margin-top: 6px; font-size: .92rem; }
.users .actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.users details { width: 100%; max-width: 520px; }
.users details form { margin-top: 10px; }
.users summary { cursor: pointer; color: var(--muted); text-align: right; }
.prose { max-width: 680px; }
code { font-size: .9em; background: var(--bg); padding: 1px 4px; border-radius: 4px; }

/* fixes from the phone screenshots */
.card > h2:first-of-type, .card > h1:first-of-type { margin-top: 0; }
.users .who .tag { align-self: flex-start; }
@media (max-width: 640px) {
  .row.wrap { align-items: stretch; }
  .row.wrap > label { min-width: 0; margin-bottom: 10px; }
  .users .actions { align-items: flex-start; width: 100%; }
  .users summary { text-align: left; }
}
