@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
  --bg-1: #f4f8ef;
  --bg-2: #e6f5ff;
  --panel: #ffffff;
  --ink: #112022;
  --muted: #4e6064;
  --brand: #0f766e;
  --brand-2: #d97706;
  --danger: #b91c1c;
  --queued: #a16207;
  --running: #0f766e;
  --completed: #166534;
  --failed: #991b1b;
  --stroke: rgba(17, 32, 34, 0.12);
  --shadow: 0 14px 34px rgba(15, 118, 110, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Avenir Next', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 14% 8%, var(--bg-2), transparent 42%),
              radial-gradient(circle at 86% 0%, #fff5d6, transparent 38%),
              var(--bg-1);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(to right, rgba(17, 32, 34, 0.03) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(17, 32, 34, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
}

.shell,
.login-shell {
  width: min(1080px, 92vw);
  margin: 0 auto;
  padding: 24px 0 46px;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 30px 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.panel,
.login-card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.login-card {
  width: min(460px, 92vw);
}

h1,
h2,
h3 {
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.52;
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

label,
.label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

textarea,
input {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

button,
.ghost-btn,
.asset {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button {
  background: linear-gradient(120deg, var(--brand), #0a4b54);
  color: #fff;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--ink);
}

.compose {
  margin-bottom: 18px;
}

.panel-header {
  margin-bottom: 14px;
}

.history .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.episode-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.episode-link {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
  transition: transform 120ms ease, border-color 120ms ease;
}

.episode-link:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.32);
}

.episode-link p {
  max-width: 740px;
}

.episode-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
  white-space: nowrap;
  color: var(--muted);
}

.status {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 9px;
  width: fit-content;
  color: #fff;
}

.status.queued {
  background: var(--queued);
}

.status.running {
  background: var(--running);
}

.status.completed {
  background: var(--completed);
}

.status.failed {
  background: var(--failed);
}

.error,
.error-box {
  color: var(--danger);
  font-size: 0.95rem;
}

.error-box {
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.25);
  border-radius: 12px;
  padding: 10px;
  margin-top: 12px;
}

.hidden {
  display: none;
}

.empty {
  color: var(--muted);
  padding: 12px;
}

.episode-detail {
  display: grid;
  gap: 15px;
}

.episode-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 14px;
}

.episode-summary p {
  margin-top: 6px;
  color: var(--ink);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.asset {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  background: linear-gradient(120deg, #fbf7e5, #eef8ff);
  border: 1px solid var(--stroke);
  color: var(--ink);
}

.audio-player {
  width: 100%;
}

@media (max-width: 740px) {
  .shell {
    width: min(980px, 94vw);
  }

  .episode-link {
    flex-direction: column;
  }

  .episode-meta {
    justify-items: start;
  }
}
