* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #e8e8e8;
  color: #000;
  font-family: Geneva, Verdana, "Lucida Grande", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  padding: 2rem 1rem;
}

.container { max-width: 640px; margin: 0 auto; }

h1 {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 1rem;
}

.tagline { font-weight: normal; color: #555; }

.header-line {
  background: #bbb;
  border: 1px solid #888;
  border-bottom: 1px solid #888;
  padding: 3px 8px;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.section-title {
  font-weight: bold;
  font-size: 12px;
  margin: 1.5rem 0 0.6rem;
}

.section-title + .nav-links { margin: 1rem 0; }

.studio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}
.studio-head .section-title { margin: 0; }

.feed-box {
  background: #fff;
  border: 1px solid #888;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.feed-name { font-weight: bold; font-size: 14px; margin-bottom: 0.2rem; }
.feed-name a { color: #000; text-decoration: underline; }
.feed-desc { color: #333; font-size: 12px; }

.feed-meta {
  font-size: 11px;
  color: #555;
  margin-bottom: 0.4rem;
}
.feed-meta span + span::before { content: ' · '; }

.feed-row { display: flex; gap: 1rem; align-items: flex-start; }
.feed-cover { width: 80px; height: 80px; flex-shrink: 0; }
.feed-cover img { width: 100%; height: 100%; object-fit: cover; display: block; border: 1px solid #888; }
.feed-cover .no-cover { width: 100%; height: 100%; background: #ccc; border: 1px solid #888; display: flex; align-items: center; justify-content: center; color: #555; font-size: 10px; text-align: center; }
.feed-body { flex: 1; min-width: 0; }

.feed-links { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }

a { color: #0000ee; text-decoration: underline; }

.btn-rss {
  border: 1px outset #ccc;
  background: #ccc;
  color: #000;
  padding: 2px 10px;
  font-family: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.btn-rss:active { border-style: inset; }

.btn {
  border: 1px outset #ccc;
  background: #ccc;
  color: #000;
  padding: 3px 12px;
  font-family: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { border-style: inset; }
.btn-danger { background: #e0b8b8; border-color: #a88; }
.btn-sm {
  padding: 0 8px;
  font-size: 12px;
  line-height: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.btn-browse { font-size: 12px; }

.feed-items { margin: 0.6rem 0 0.8rem; }
.feed-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 3px 2px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  font-size: 12px;
  color: #000;
  text-decoration: none;
}
.feed-item:hover { background: #f0f0f0; }
.feed-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid #888;
  flex-shrink: 0;
}
.feed-item .dur {
  margin-left: auto;
  color: #555;
  font-size: 11px;
  white-space: nowrap;
}
.feed-empty { font-size: 11px; color: #888; padding: 3px 2px; }

/* episode page */
.feed-item--page {
  cursor: default;
  padding: 0.2rem 0;
  border-bottom: none;
  align-items: flex-start;
}
.feed-item--page:hover { background: transparent; }
.feed-item--page img {
  width: 140px;
  height: 140px;
}
.feed-item--page-text {
  padding-right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.feed-item--page-sub {
  font-size: 11px;
  color: #555;
  font-weight: normal;
  text-decoration: none;
}
.feed-item--page-sub:hover { text-decoration: underline; }
.feed-item--page-meta {
  margin-left: auto;
  flex-shrink: 0;
  align-self: flex-start;
}
#player { width: 100%; margin-top: 0.4rem; }

/* custom waveform player — replaces <audio controls> on the episode page.
   Layout: [▶][~~~~canvas~~~~]. The canvas carries both the waveform
   (upper ~40px) and a time strip (lower ~16px) that shows either the
   playhead position or a hover-preview under the cursor. */
.player {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.8rem;
  padding: 1.2rem 0 0.4rem 0.4rem;
  background: #f4f4f4;
  border: 1px solid #888;
}
.player-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin-top: 5px;
  border: 1px outset #ccc;
  background: #ccc;
  color: #000;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.player-btn:active { border-style: inset; }
.player-wave {
  flex: 1 1 auto;
  height: 62px;
  cursor: pointer;
  display: block;
  outline: none;
}
.player-wave:focus-visible { outline: 1px dotted #555; outline-offset: -1px; }
.player-bp {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin-top: 0.3rem;
  margin-bottom: 0.8rem;
}
.episode-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: 11px;
}
.episode-meta-left,
.episode-meta-right {
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
}
.episode-meta .sep { color: #aaa; }
.episode-meta .meta-label { color: #888; font-size: 11px; text-transform: lowercase; }
.episode-meta .meta-label:not(:first-child) { margin-left: 0.3rem; }

/* episode page: meta rendered as a vertical stack under the feed title,
   next to the cover, to balance the 140px cover height. */
.episode-meta--page {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: 0.6rem;
  padding-top: 0.4rem;
  border-top: 1px dotted #ccc;
}
.episode-meta--page .episode-meta-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.episode-meta--page .meta-label {
  width: 5rem;
  flex-shrink: 0;
  margin-left: 0;
}
.episode-desc {
  margin-top: 0.6rem;
  font-size: 12px;
  color: #333;
  white-space: pre-wrap;
}

/* comments */
.comment {
  background: #fff;
  border: 1px solid #888;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.6rem;
}
.comment-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.3rem;
}
.comment-author { font-weight: bold; font-size: 12px; }
.comment-time { color: #555; font-size: 11px; }
.comment-del { margin-left: auto; display: inline; }
.comment-body {
  font-size: 12px;
  color: #000;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.comment-form textarea { min-height: 100px; }

/* timestamp links parsed from show notes / comments */
a.ts { color: inherit; text-decoration: underline dotted; cursor: pointer; }
a.ts:hover { color: #8C4A8E; }
a.ts.ts-current { color: #8C4A8E; }
.ts-row.ts-current { font-weight: bold; }

.status-line {
  display: flex;
  gap: 1.5rem;
  font-size: 11px;
  color: #555;
  margin-top: 0.6rem;
}
.status-line span::before { content: '• '; }
.status-line .status-line-right { margin-left: auto; }
.status-line .status-line-right::before { content: ''; }

.subscribe-box {
  background: #fff;
  border: 1px solid #888;
  padding: 0.8rem 1rem;
  font-size: 12px;
  line-height: 1.9;
  color: #000;
}
.subscribe-box hr { border: none; border-top: 1px solid #ccc; margin: 0.4rem 0; }

.footer {
  margin-top: 2rem;
  border-top: 1px solid #888;
  padding-top: 0.6rem;
  font-size: 11px;
  color: #555;
  display: flex;
  justify-content: space-between;
}

.blink { animation: blink 1.1s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* forms */
form { display: block; }
.form-box {
  background: #fff;
  border: 1px solid #888;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}
.form-row { margin-bottom: 0.8rem; }
.form-row label { display: block; font-weight: bold; font-size: 12px; margin-bottom: 0.2rem; }
.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=password],
.form-row input[type=date],
.form-row textarea,
.form-row select {
  width: 100%;
  border: 1px solid #888;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
}
.form-row textarea { min-height: 80px; resize: vertical; }
.form-check { display: flex; align-items: center; gap: 0.4rem; font-size: 12px; }
.form-check input { margin: 0; }
.form-error { color: #b00; font-size: 11px; margin-top: 0.2rem; }
.form-actions { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.4rem; }

.flash {
  background: #fff7d6;
  border: 1px solid #d8c070;
  padding: 4px 8px;
  font-size: 12px;
  margin-bottom: 1rem;
}

.episode-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.episode-table th { text-align: left; font-weight: normal; color: #555; padding: 4px 4px; border-bottom: 1px solid #888; font-size: 11px; }
.episode-table td { padding: 4px 4px; border-bottom: 1px solid #ddd; vertical-align: middle; }
.episode-table .col-cover { width: 40px; }
.episode-table .col-date { width: 84px; }
.episode-table .col-meta { width: 180px; }
.episode-table .col-actions { width: 60px; text-align: right; }
.episode-cover { width: 40px; height: 40px; flex-shrink: 0; }
.episode-cover img { width: 100%; height: 100%; object-fit: cover; display: block; border: 1px solid #888; }
.episode-cover .no-cover { width: 100%; height: 100%; background: #ccc; border: 1px solid #888; display: flex; align-items: center; justify-content: center; color: #555; font-size: 9px; text-align: center; }

.muted { color: #555; font-size: 11px; }

.upload-progress {
  margin: 0.4rem 0;
  font-size: 11px;
  color: #555;
}
.upload-progress-track {
  height: 10px;
  background: #e8e8e8;
  border: 1px solid #bbb;
  overflow: hidden;
  margin-bottom: 0.2rem;
}
.upload-progress-bar {
  height: 100%;
  width: 0;
  background: #6a6;
  transition: width 0.15s linear;
}
.upload-progress--error .upload-progress-bar { background: #b00; }
.upload-progress-label { font-size: 11px; }
.key-box {
  background: #f4f4f4;
  border: 1px dashed #888;
  padding: 4px 6px;
  font-family: monospace;
  font-size: 11px;
  word-break: break-all;
}
.header-line .nav-links { display: flex; gap: 1rem; align-items: center; font-size: 12px; }
.header-email {
  max-width: 12rem;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  direction: rtl;
  text-align: left;
}

/* long feed description (Phase 1) — plain text, preserve line breaks */
.feed-description {
  margin: 0.4rem 0 0.8rem;
  padding: 0.4rem 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #222;
  background: #f7f7f7;
  border: 1px solid #ddd;
  white-space: pre-wrap;
}

/* my feed timeline (Phase 2) */
.timeline { margin-bottom: 0.6rem; }
.timeline-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 6px 2px;
  border-bottom: 1px solid #ddd;
  color: #000;
  text-decoration: none;
}
.timeline-item:hover { background: #f0f0f0; }
.timeline-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid #888;
  flex-shrink: 0;
}
.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
}

/* subscription row in my feed — mirrors timeline-item density:
   [cover][title + muted status][browse + unsubscribe] on a single line */
.sub-row { display: flex; align-items: center; gap: 0.6rem; }
.sub-cover { flex-shrink: 0; }
.sub-cover img { width: 48px; height: 48px; object-fit: cover; border: 1px solid #888; display: block; }
.sub-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.sub-title { font-weight: bold; font-size: 13px; text-decoration: underline; color: #000; }
/* category nav + pagination (Phase 1/3) */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  padding: 0.4rem 0 0.8rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid #ccc;
}
.cat-link {
  font-size: 11px;
  color: #0000ee;
  text-decoration: underline;
}
.cat-link--active { font-weight: bold; color: #000; text-decoration: none; }

.pagination {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
  font-size: 12px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 0.6rem;
}
.section-head .section-title { margin: 0; }
.section-head .see-all { font-size: 12px; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.cat-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  border: 1px solid #888;
  padding: 0.5rem 0.7rem;
  text-decoration: none;
  color: #000;
  font-size: 12px;
}
.cat-card:hover { background: #f0f0f0; }
.cat-card-name { font-weight: bold; }
.cat-card-count { color: #555; font-size: 11px; }

/* header search (Phase 3) */
.header-search { display: inline-flex; }
.header-search input {
  border: 1px solid #888;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 12px;
  background: #fff;
  width: 120px;
}
.search-form input[type=text] {
  border: 1px solid #888;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
  flex: 1 1 auto;
}
