:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --panel: #ffffff;
  --text: #1d1d1f;
  --muted: #66615b;
  --line: #ded8cf;
  --accent: #0c6b58;
  --accent-dark: #074d40;
  --warning: #9c3d22;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 48px);
}

.brand {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.nav-right {
  align-items: center;
  display: flex;
  gap: 14px;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 14px;
  text-decoration: none;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

.button,
button {
  align-items: center;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  gap: 8px;
  padding: 9px 13px;
  text-decoration: none;
}

.button.secondary {
  background: var(--panel);
  border-color: var(--line);
  color: var(--accent-dark);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.icon-button {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-dark);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  padding: 8px;
}

.icon-button:hover {
  background: var(--bg);
}

.icon-button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.icon {
  height: 20px;
  width: 20px;
}

.button .icon {
  height: 16px;
  width: 16px;
}

[hidden] {
  display: none !important;
}

main {
  margin: 0 auto;
  max-width: 980px;
  padding: 28px clamp(18px, 4vw, 48px) 64px;
}

.page-header {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.header-meta {
  align-items: center;
  display: flex;
  gap: 14px;
}

.header-meta .count {
  margin: 0;
}

.sort-toggle {
  display: flex;
  gap: 4px;
}

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

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.25;
  margin-bottom: 8px;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 24px 0 8px;
}

ul {
  padding-left: 22px;
}

li + li {
  margin-top: 8px;
}

.episode-list {
  display: grid;
  gap: 14px;
}

.episode-card,
.podcast-row,
.empty,
.detail,
.share {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.podcast-groups {
  display: grid;
  gap: 40px;
}

.podcast-group-header {
  align-items: flex-end;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.podcast-group-empty {
  opacity: 0.5;
}

.empty-card .episode-card-body {
  color: var(--muted);
}

.group-art {
  height: 84px;
  width: 84px;
}

.podcast-name {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.episode-card {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 18px;
}

.episode-title {
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0 0 6px;
}

.episode-title a {
  text-decoration: none;
}

.episode-title a:hover {
  text-decoration: underline;
}

.date-chip {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  padding: 3px 10px;
}

.episode-card-body {
  min-width: 0;
}

.cover-link {
  display: block;
  text-decoration: none;
}

.podcast-art {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

.episode-art {
  height: 72px;
  width: 72px;
}

.podcast-picker {
  display: grid;
  gap: 16px;
}

.podcast-row {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 14px;
  grid-template-columns: 22px 56px minmax(0, 1fr);
  padding: 14px 16px;
}

.picker-art {
  height: 56px;
  width: 56px;
}

.podcast-row input {
  height: 18px;
  margin: 0;
  width: 18px;
}

.podcast-row strong,
.podcast-row em {
  display: block;
}

.podcast-row em {
  color: var(--muted);
  font-style: normal;
}

.sticky-actions {
  background: var(--bg);
  border-top: 1px solid var(--line);
  bottom: 0;
  padding: 14px 0;
  position: sticky;
}

.secondary-action {
  margin-top: 16px;
}

.podcast,
.meta,
.muted {
  color: var(--muted);
}

.podcast {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.tldr {
  margin-bottom: 0;
}

.large {
  font-size: 1.18rem;
}

.warning {
  color: var(--warning);
}

.empty {
  padding: 28px;
}

.detail {
  padding: clamp(22px, 4vw, 42px);
  position: relative;
}

.detail-archive-top {
  position: absolute;
  right: clamp(16px, 3vw, 30px);
  top: clamp(16px, 3vw, 30px);
  z-index: 1;
}

.detail-header {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 104px minmax(0, 1fr);
  padding-right: 44px;
}

.detail-art {
  height: 104px;
  width: 104px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.summary {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 24px;
}

.summary hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

.detail-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.bottom-actions {
  justify-content: space-between;
}

.actions-left,
.actions-right {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.top-actions {
  margin: 22px 0 0;
}

.inline-status,
.countdown {
  margin-bottom: 0;
}

.share {
  margin-top: 26px;
  padding: 18px;
}

label {
  display: grid;
  font-weight: 700;
  gap: 6px;
  margin-bottom: 12px;
}

input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  padding: 10px 12px;
  width: 100%;
}

.notice {
  background: #e5f4ef;
  border: 1px solid #c3ded5;
  border-radius: 8px;
  color: var(--accent-dark);
  padding: 10px 12px;
}

@media (max-width: 620px) {
  .topbar,
  .page-header {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .topbar,
  .page-header {
    display: grid;
    gap: 12px;
  }

  .group-art {
    height: 64px;
    width: 64px;
  }

  .bottom-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions-left,
  .actions-right {
    justify-content: space-between;
  }

  .detail-header {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .detail-art {
    height: 76px;
    width: 76px;
  }
}
