:root {
  --bg: #100f0d;
  --ink: #f6f1e7;
  --muted: #a89b8a;
  --faint: #6f675c;
  --line: rgba(232, 214, 184, 0.14);
  --brass: #e0b15a;
  --brass-deep: #a9782e;
  --danger: #e07a68;
  --panel: rgba(255, 248, 236, 0.035);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -160px, rgba(224, 177, 90, 0.18), transparent 60%),
    var(--bg);
  font-family: ui-sans-serif, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

main {
  width: 100%;
  margin: 0;
  padding: 18px 28px 48px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(380px, 1.1fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 0.9rem;
}

button, input { font: inherit; color: inherit; }

h1, h2, .track-name, .job-title, .preview-title {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-weight: 500;
}

h1 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

h2 { margin: 0; font-size: 1.15rem; }

.heading {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.mark {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #f6f1e7 0 3px, #1a1713 4px 8px, transparent 9px),
    repeating-radial-gradient(circle at 50% 50%, #241f19 0 2px, #3a3126 3px 4px);
  box-shadow: inset 0 0 0 2px var(--brass), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  margin: 0 0 0.15rem;
  color: var(--brass);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.lede {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel,
.downloads {
  padding: 1.15rem 1.15rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

label[for="url"] {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.url-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

input[type="url"] {
  width: 100%;
  padding: 0.85rem 0.95rem;
  background: #100f0d;
  border: 1px solid var(--line);
  border-radius: 12px;
}

input[type="url"]:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
  border-color: transparent;
}

button {
  cursor: pointer;
  border-radius: 12px;
}

button:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.85rem 1rem;
}

button.ghost.small { padding: 0.4rem 0.75rem; color: var(--muted); }

button.primary {
  width: 100%;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 0;
  background: linear-gradient(180deg, #f0cb7a, #d7a24a);
  color: #24180a;
  font-weight: 650;
}

button.primary:hover { filter: brightness(1.05); }
button.primary:disabled,
button.ghost:disabled { opacity: 0.55; cursor: progress; }

fieldset {
  border: 0;
  margin: 1.15rem 0 0;
  padding: 0;
}

legend {
  margin-bottom: 0.5rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.choices { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.choice { position: relative; }

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}

.choice span {
  display: block;
  padding: 0.38rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.choice input:checked + span {
  background: var(--brass);
  border-color: var(--brass);
  color: #24180a;
}

.choice input:focus-visible + span {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.hint, .check em, .meta, .job-meta, footer, .empty {
  color: var(--faint);
}

.hint { margin: 0.45rem 0 0; font-size: 0.88rem; }

.error { margin: 0.8rem 0 0; color: var(--danger); }
.error[hidden], [hidden] { display: none; }

.help {
  margin-top: 1.15rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.help summary { cursor: pointer; }
.help p { margin: 0.45rem 0 0; }
.help code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--ink);
}

.layout section { margin-top: 0; }

#activity:not([hidden]) { margin-bottom: 1.4rem; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

ul { list-style: none; margin: 0.4rem 0 0; padding: 0; }

.preview {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 0.9rem;
  align-items: center;
  margin-top: 0.85rem;
  padding: 0.7rem;
  background: #14120f;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.preview.has-picks { align-items: start; }

.preview-head {
  display: contents;
}

.pick-tools,
.picks { grid-column: 1 / -1; }

.pick-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  margin-top: 0.2rem;
}

.pick-count { color: var(--muted); font-size: 0.88rem; }

.picks { margin: 0; }

.pick label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.38rem 0.1rem;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.pick input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--brass);
  flex: 0 0 auto;
}

.pick-title { flex: 1; min-width: 0; }

.pick-time {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
}

.pick:has(input:not(:checked)) .pick-title {
  color: var(--faint);
  text-decoration: line-through;
}

.preview img {
  width: 168px;
  height: 94px;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
}

.preview-title { margin: 0; font-size: 1.25rem; line-height: 1.2; }
.preview p { margin: 0.2rem 0 0; }
.preview ol { margin: 0.45rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.9rem; }

.job, .track {
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}

.job-title { margin: 0; font-size: 1.05rem; line-height: 1.25; }

.track-name {
  margin: 0;
  font-family: ui-sans-serif, "Segoe UI", sans-serif;
  font-size: 0.92rem;
  font-weight: 550;
  line-height: 1.3;
}
.job-meta { margin: 0.25rem 0 0; font-size: 0.9rem; }
.job-meta.bad { color: var(--danger); }

.bar {
  height: 4px;
  margin-top: 0.55rem;
  overflow: hidden;
  border-radius: 99px;
  background: #2a261f;
}

.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brass-deep), var(--brass));
}

.bar.busy > span {
  width: 38%;
  animation: slide 1.15s ease-in-out infinite;
}

@keyframes slide {
  from { transform: translateX(-130%); }
  to { transform: translateX(340%); }
}

.track-top, .job-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.badge {
  flex: 0 0 auto;
  color: var(--brass);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.track audio { width: 100%; height: 28px; margin-top: 0.28rem; }

.track-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.1rem;
}

.track-foot .meta { margin: 0; font-size: 0.78rem; }

.actions { display: flex; gap: 0.65rem; margin: 0; font-size: 0.82rem; }

.actions a, .actions button, .dismiss {
  background: transparent;
  border: 0;
  padding: 0.2rem 0;
  color: var(--muted);
  text-decoration: none;
}

.actions button.danger, .dismiss { color: var(--danger); }
.actions a:hover, .actions button:hover, .dismiss:hover { color: var(--ink); }

.meta { margin: 0.15rem 0 0; font-size: 0.88rem; }

footer { margin-top: 3rem; font-size: 0.82rem; }

@media (max-width: 860px) {
  main { padding: 16px 16px 40px; }
  h1 { font-size: 1.4rem; }
  .layout { grid-template-columns: 1fr; }
  .url-row, .preview, .preview-head { grid-template-columns: 1fr; }
  .preview-head { display: grid; }
  .preview img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .url-row button.ghost { width: 100%; }
}
