:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6862;
  --line: #e4e1da;
  --accent: #5b3df5;
  --accent-text: #ffffff;
  --accent-soft: #ece8ff;
  --ok: #157f4a;
  --ok-soft: #e3f4ea;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --bad: #b42318;
  --bad-soft: #fde7e5;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1c1c1a;
    --text: #edebe6;
    --muted: #a19d95;
    --line: #2f2e2b;
    --accent: #9a88ff;
    --accent-text: #120d2e;
    --accent-soft: #2a2450;
    --ok: #5fd39a;
    --ok-soft: #173326;
    --warn: #f0b45a;
    --warn-soft: #3a2b12;
    --bad: #ff8a80;
    --bad-soft: #3d1a17;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 1.8rem; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
pre { background: var(--bg); padding: 0.75rem; border-radius: 8px; overflow-x: auto; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface);
}
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.topbar nav a { color: var(--text); text-decoration: none; }
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--text); text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--surface) 0 3px, var(--accent) 4px 6px, var(--surface) 7px 8px, var(--accent) 9px);
}

main { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
main.wide { max-width: 1100px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem;
}
.card.narrow { max-width: 420px; margin: 1.5rem auto; }
.card.empty { text-align: center; color: var(--muted); }
.card.danger { border-color: var(--bad-soft); }
.stack > * + * { margin-top: 1rem; }

.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.pagehead h1, .pagehead h2 { margin: 0; }

label { display: block; font-weight: 600; font-size: 0.95rem; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.85rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.55rem 0.7rem;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; }
.grid2, .grid3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

button, .button {
  display: inline-block; padding: 0.55rem 1rem; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.link { background: none; border: none; color: inherit; padding: 0; font-weight: 400; }
button.link.danger { color: var(--bad); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
form.inline { display: inline; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.inline-form { display: flex; gap: 0.75rem; align-items: flex-end; }
.inline-form label { flex: 1; }

.flash { padding: 0.7rem 1rem; border-radius: 8px; }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.notice { background: var(--ok-soft); color: var(--ok); }
.error-text { color: var(--bad); }
.muted { color: var(--muted); }
.dev { background: var(--warn-soft); padding: 0.5rem; border-radius: 8px; }

.hero { text-align: center; padding-top: 2rem; }
.hero h1 { font-size: 2.3rem; max-width: 22ch; margin: 0 auto 0.5em; }
.lede { max-width: 60ch; margin: 0 auto; color: var(--muted); font-size: 1.1rem; }
.hero form { text-align: left; }
.hero form > * + * { margin-top: 1rem; }

.showgrid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.show-tile { padding: 0.75rem; margin: 0; }
.show-tile a { display: flex; flex-direction: column; gap: 0.3rem; color: var(--text); text-decoration: none; }
.show-tile img, .show-tile .art-placeholder { width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover; }
.art { width: 160px; height: 160px; border-radius: 10px; object-fit: cover; flex: none; }
.art-placeholder { background: linear-gradient(135deg, var(--accent-soft), var(--line)); }
.artrow { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

.showhead { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.5rem; }
.showhead > div { flex: 1; min-width: 0; }
.copyrow { display: flex; gap: 0.5rem; margin: 0.75rem 0; }
.copyrow input { margin: 0; font-family: ui-monospace, monospace; font-size: 0.85rem; }
.copyrow button { flex: none; }
.subnav { display: flex; gap: 1rem; flex-wrap: wrap; }

table.eps { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.eps th, .eps td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.eps th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.eps tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--line); color: var(--muted); white-space: nowrap; }
.badge.live { background: var(--ok-soft); color: var(--ok); }
.badge.scheduled { background: var(--warn-soft); color: var(--warn); }
.badge.error { background: var(--bad-soft); color: var(--bad); }

.uploader { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.75rem; }
.uploader .current { width: 100%; margin: 0; color: var(--muted); }
.filepick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filepick:focus-within .button { outline: 2px solid var(--accent); }
.uploader progress { width: 220px; height: 10px; accent-color: var(--accent); }
audio { width: 100%; margin: 0.5rem 0; }

.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 0.3rem 0 0.3rem 1.8rem; position: relative; }
.checks li::before { position: absolute; left: 0; font-weight: 700; }
.checks li.ok::before { content: "✓"; color: var(--ok); }
.checks li.bad::before { content: "✗"; color: var(--bad); }
.dirs { padding-left: 1.2rem; }
.dirs li { margin-bottom: 1.25rem; }
.dirs p { margin: 0.25rem 0 0.5rem; }

.public .notes, .public-eps .notes { color: var(--text); }
.public-eps { list-style: none; padding: 0; }
.subscribe { display: flex; gap: 0.5rem; flex-wrap: wrap; }
details summary { cursor: pointer; font-weight: 600; }

@media (max-width: 640px) {
  .showhead { flex-direction: column; }
  .art { width: 120px; height: 120px; }
  .eps th:nth-child(3), .eps td:nth-child(3) { display: none; }
  .hero h1 { font-size: 1.8rem; }
}
