:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #65717d;
  --line: #dce2e7;
  --surface: #fff;
  --background: #f3f6f8;
  --accent: #1967d2;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
h1, h2, h3 { line-height: 1.2; margin-top: 0; }
a { color: var(--accent); }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem max(1rem, calc((100% - 1000px) / 2));
  color: white;
  background: #17202a;
}
.topbar h1 { margin-bottom: .2rem; font-size: 1.35rem; }
.topbar a { color: #b7d4ff; }
.layout { width: min(1000px, calc(100% - 2rem)); margin: 2rem auto; display: grid; gap: 1.25rem; }
.card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 3px 14px rgb(0 0 0 / 5%);
}
.auth { width: min(460px, calc(100% - 2rem)); margin: 10vh auto; }
form { display: grid; gap: 1rem; }
label { display: grid; gap: .35rem; color: #34404b; font-weight: 600; }
input, textarea {
  width: 100%;
  padding: .7rem .8rem;
  border: 1px solid #aeb8c2;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font: inherit;
}
textarea { resize: vertical; }
button {
  width: fit-content;
  padding: .68rem 1rem;
  border: 0;
  border-radius: 7px;
  color: white;
  background: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
button:disabled { opacity: .55; cursor: wait; }
button.secondary { color: var(--ink); background: #e8edf2; }
button.danger { color: var(--danger); background: #fff0ee; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.section-heading, .episode-head, .episode-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.episode {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.episode:first-child { border-top: 0; }
.episode h3 { margin-bottom: .25rem; }
.episode-meta, .status { color: var(--muted); font-size: .9rem; }
.episode form { margin-top: 1rem; }
.episode-actions { justify-content: flex-start; }
.error { color: var(--danger); }
progress { width: 100%; height: 1rem; }

@media (max-width: 650px) {
  .grid { grid-template-columns: 1fr; }
  .topbar, .section-heading, .episode-head { align-items: flex-start; }
}

