:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --primary: #146c5f;
  --primary-dark: #0f5148;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--primary);
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 30px;
  margin-bottom: 6px;
}

h2 {
  font-size: 20px;
  margin-bottom: 18px;
}

h3 {
  font-size: 17px;
  margin-bottom: 4px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.narrow {
  max-width: 460px;
  margin: 72px auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stack {
  display: grid;
  gap: 16px;
}

.wide,
.actions {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-weight: 650;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 9px 14px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:disabled,
.button:disabled {
  opacity: 0.6;
  cursor: wait;
}

button:hover,
.button:hover {
  background: var(--primary-dark);
}

.ghost {
  background: #fff;
  color: var(--primary);
}

.ghost:hover {
  background: #edf7f5;
}

.danger {
  border-color: var(--danger);
  background: #fff;
  color: var(--danger);
}

.danger:hover {
  background: #fff1f0;
}

.notice,
.error,
.warning {
  border-radius: 6px;
  padding: 11px 13px;
  margin-bottom: 18px;
}

.notice {
  border: 1px solid #a6d8c8;
  background: #effaf6;
}

.error {
  border: 1px solid #fecdca;
  background: #fff1f0;
  color: var(--danger);
}

.warning {
  border: 1px solid #fedf89;
  background: #fffaeb;
  color: #7a4504;
}

.error ul,
.warning ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.episodes {
  display: grid;
  gap: 12px;
}

.episode {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.episode:first-child {
  border-top: 0;
  padding-top: 0;
}

.episode audio {
  width: 100%;
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 6px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.ok {
  background: #e7f6ee;
  color: #067647;
}

.badge.warn {
  background: #fff4d6;
  color: #8a4b00;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.row-actions form {
  margin: 0;
}

.upload-progress {
  display: none;
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #f8fafc;
}

.upload-progress.is-active {
  display: block;
}

.upload-progress.has-error {
  border-color: #fecdca;
  background: #fff1f0;
}

.upload-progress__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.upload-progress__bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e7ec;
}

.upload-progress__bar div {
  width: 36%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.upload-progress__bar.is-indeterminate div {
  animation: upload-progress-slide 1.1s ease-in-out infinite;
}

.upload-progress__hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@keyframes upload-progress-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(300%);
  }
}

@media (max-width: 760px) {
  .wrap {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .top,
  .episode,
  .row-actions {
    display: grid;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}
