:root {
  color-scheme: dark;
  --ink: #000;
  --panel: #111113;
  --line: #34343a;
  --paper: #f3f1ea;
  --dim: #a2a2ab;
  --red: #ff4b3a;
  --yellow: #ffd21f;
  --display: 'Big Shoulders Display', Impact, 'Arial Narrow', sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 15px/1.5 var(--mono);
}

h1 {
  margin: 0;
  font: 900 clamp(38px, 7vw, 56px)/1 var(--display);
  text-transform: uppercase;
}

small { color: var(--dim); font-size: 12px; font-weight: 400; }

button, .file-button {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--paper);
  background: transparent;
  color: var(--paper);
  font: 700 14px var(--mono);
  cursor: pointer;
}

button:hover, .file-button:hover { background: #26262b; }
button:disabled { opacity: 0.5; cursor: progress; }
button.primary { background: var(--paper); color: var(--ink); }
button.primary:hover { background: #fff; }
button.quiet { border-color: var(--line); color: var(--dim); }
button.danger { border-color: var(--red); color: var(--red); }

:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--paper);
  font: 16px/1.4 var(--mono);
}

input[type='checkbox'] { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--paper); }
textarea { resize: vertical; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--dim); font-size: 13px; }
#user { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { max-width: 1040px; margin: 0 auto; padding: 28px 24px 64px; }

.panel { max-width: 420px; margin: 12vh auto 0; }
.panel h1 { margin-bottom: 12px; }

.list-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.edit-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--yellow); color: var(--yellow); }
.edit-banner p { margin: 0; }
.edit-banner button { color: var(--paper); }
.conflict { margin-top: 24px; padding: 14px; border: 1px solid var(--yellow); }
.conflict h2 { margin: 0 0 8px; }
.conflict-choice label { display: flex; align-items: center; gap: 9px; min-height: 32px; overflow-wrap: anywhere; cursor: pointer; }
.conflict-choice input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; accent-color: var(--paper); }
.conflict .actions .danger { margin-left: 0; }
.tag.editing { border-color: var(--yellow); color: var(--yellow); }
input:disabled, textarea:disabled, select:disabled { opacity: 0.6; cursor: not-allowed; }
#users-back { margin-bottom: 18px; }
#users-view > .hint { margin-top: 10px; }
.user-form { display: grid; gap: 14px; max-width: 480px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); }
.user-form h2 { margin: 0; }
.user-form .actions { margin: 4px 0 0; }
.check { display: flex; align-items: center; gap: 9px; min-height: 32px; cursor: pointer; }
.user-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.list-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
h2 { margin: 36px 0 8px; font: 900 28px/1.1 var(--display); text-transform: uppercase; }
#publish-back { margin-bottom: 18px; }
#publish-view .actions .danger { margin-left: 0; }
.plain-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.plain-list:empty { display: none; }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.plain-list small { display: block; }
.version-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.change-kind { color: var(--yellow); }
.history { margin-top: 28px; }
.history h2 { margin-top: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0 8px; }
.search { flex: 1 1 260px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { border-color: var(--line); color: var(--dim); font-weight: 400; }
.tabs button[aria-pressed='true'] { border-color: var(--paper); background: var(--paper); color: var(--ink); font-weight: 700; }

.listings { margin: 0; padding: 0; list-style: none; }
.listings li { border-bottom: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 92px;
  padding: 10px 4px;
  border: 0;
  background: none;
  font-weight: 400;
  text-align: left;
}

.row img, .row .no-thumb { width: 56px; height: 70px; object-fit: cover; background: var(--panel); }
.row-title { display: block; font-weight: 700; overflow-wrap: anywhere; }
.row-meta { display: block; color: var(--dim); font-size: 13px; overflow-wrap: anywhere; }
.row-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 220px; }

.tag { padding: 1px 7px; border: 1px solid var(--line); color: var(--dim); font-size: 12px; white-space: nowrap; }
.tag.sold { border-color: var(--red); color: var(--red); }
.tag.warning { border-color: var(--yellow); color: var(--yellow); }

.empty { margin-top: 28px; color: var(--dim); }

#back { margin-bottom: 18px; }
#form { margin-top: 22px; }

.columns { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: start; }
.fields { display: grid; gap: 18px; min-width: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; font-weight: 700; font-size: 14px; }
.field legend { padding: 0 0 6px; }
.field small { display: block; }
.field-error { color: var(--red); font-size: 13px; font-weight: 400; }
.invalid input, .invalid textarea, .invalid select { border-color: var(--red); }

.checks label, .tags label { display: flex; align-items: center; gap: 9px; min-height: 32px; font-weight: 400; cursor: pointer; }
.tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 12px; }

.song { padding: 12px; border: 1px solid var(--line); }
.song legend { padding: 0 6px; }
.song .note { margin: 0; font-weight: 400; }
.song-now { margin: 0; font-weight: 400; overflow-wrap: anywhere; }
.song-actions, .song-search { display: flex; flex-wrap: wrap; gap: 8px; }
.song-search label { flex: 1 1 200px; }
.song-close { width: 44px; padding: 0; font-size: 24px; font-weight: 400; line-height: 1; }
#song-query::-webkit-search-cancel-button { display: none; }
.song-results { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.song-results:empty { display: none; }
.song-result { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-weight: 400; }
.song-result img { width: 44px; height: 44px; background: var(--panel); }
.song-result b { display: block; overflow-wrap: anywhere; }
.song-result span span { color: var(--dim); font-size: 13px; overflow-wrap: anywhere; }

.poster-side { position: sticky; top: 16px; display: grid; gap: 10px; }
.poster-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--dim);
  overflow: hidden;
}

.poster-frame img { width: 100%; height: 100%; object-fit: cover; }
.file-button { position: relative; display: grid; place-items: center; text-align: center; }
.file-button input { position: absolute; inset: 0; min-height: 0; padding: 0; opacity: 0; cursor: pointer; }
.file-button:focus-within { outline: 2px solid var(--yellow); outline-offset: 2px; }

.hint { margin: 0; color: var(--dim); font-size: 13px; }
.note { margin: 12px 0 0; color: var(--yellow); }
.problem { color: var(--red); }

.message { margin: 22px 0 0; padding: 10px 12px; border: 1px solid var(--line); }
.message.good { border-color: var(--paper); }
.message.bad { border-color: var(--red); color: var(--red); }
.message.warn { border-color: var(--yellow); color: var(--yellow); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 10px; }
.actions .danger { margin-left: auto; }

@media (max-width: 760px) {
  .bar { padding: 8px 16px; }
  main { padding: 20px 16px 48px; }
  .columns { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .poster-side { position: static; grid-row: 1; max-width: 240px; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: 56px 1fr; }
  .row-tags { grid-column: 2; justify-content: flex-start; max-width: none; }
  .tabs { width: 100%; }
  .tabs button { flex: 1 1 auto; padding-inline: 8px; }
  .song-result { grid-template-columns: 44px minmax(0, 1fr); }
  .song-result button { grid-column: span 1; }
  .song-result button:first-of-type { grid-column: 1 / -1; }
  .song-result button:last-of-type { grid-column: 1 / -1; }
}
