:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --border: #e9e2d8;
  --text: #2b2420;
  --text-muted: #8a7f73;
  --accent: #c0392b;
  --accent-soft: #fbe9e6;
  --focus: #c0392b;
  --shadow: 0 1px 2px rgba(43, 36, 32, 0.06), 0 1px 1px rgba(43, 36, 32, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18140f;
    --surface: #221c16;
    --border: #35291f;
    --text: #f1ebe2;
    --text-muted: #9c9087;
    --accent: #e0685a;
    --accent-soft: #3a211c;
    --focus: #e0685a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

header {
  padding: 40px 0 20px;
  text-align: center;
}

header .mark {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

header p a {
  color: var(--accent);
  text-decoration: none;
}

header p a:hover {
  text-decoration: underline;
}

.search-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 12px 0;
  margin-bottom: 4px;
}

.search-bar .field {
  position: relative;
}

.search-bar input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 12px 40px 12px 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-bar .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}

.search-bar .clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  display: none;
}

.search-bar .clear:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.search-bar.has-query .clear {
  display: block;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 4px 4px 10px;
}

.year-divider {
  position: sticky;
  top: 60px;
  z-index: 5;
  background: var(--bg);
  padding: 10px 4px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

ul.episodes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.episode {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}

a.episode {
  cursor: pointer;
}

a.episode:hover,
a.episode:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
}

a.episode:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.episode.no-video {
  opacity: 0.6;
}

.episode .date {
  flex: 0 0 auto;
  width: 62px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.episode .body {
  flex: 1 1 auto;
  min-width: 0;
}

.episode .title {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode .sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.episode .play {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
}

.episode.no-video .play {
  background: var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 0.95rem;
}

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 32px 0 0;
  line-height: 1.6;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

mark {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  padding: 0 1px;
}

@media (max-width: 420px) {
  .episode .date {
    width: 56px;
    font-size: 0.72rem;
  }

  .episode .title {
    font-size: 0.88rem;
  }
}
