/* ===== Reset & base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #fafbfc;
  --surface: #ffffff;
  --border: #e4e7eb;
  --text: #1a1d21;
  --text-muted: #64707c;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --tag-bg: #eef2ff;
  --tag-text: #3730a3;
  --player-bg: #1a1d21;
  --player-text: #ffffff;
}
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Hiragino Sans", "BIZ UDPGothic", sans-serif;
  line-height: 1.6;
  font-size: 15px;
  padding-bottom: 80px; /* space for sticky player */
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 24px;
}
.header .brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.header .brand:hover { text-decoration: none; }
.header nav { display: flex; gap: 20px; font-size: 14px; }
.header nav a { color: var(--text); padding: 4px 0; border-bottom: 2px solid transparent; }
.header nav a:hover { color: var(--accent); text-decoration: none; }
.header nav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.header .search {
  margin-left: auto;
  min-width: 300px;
  position: relative;
}
.header .search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  font-size: 14px;
}
.header .search input:disabled {
  cursor: not-allowed;
  color: #999;
  background: #f5f5f7;
}
.header .search::before {
  content: '🔍';
  position: absolute;
  left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 14px;
}

/* ===== Main content wrapper ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.container.narrow { max-width: 800px; }

/* ===== Cards / Episode list ===== */
.ep-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 16px;
  align-items: center;
  transition: box-shadow .15s;
}
.ep-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.ep-card.clickable { cursor: pointer; }
.ep-card.clickable:hover { border-color: var(--accent); box-shadow: 0 3px 12px rgba(37,99,235,.1); }
.ep-card .ep-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}
.ep-card .ep-num small { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); }
.ep-card .ep-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.ep-card .ep-title a { color: var(--text); }
.ep-card .ep-meta { font-size: 13px; color: var(--text-muted); }
.ep-card .ep-tags { margin-top: 6px; }
.ep-card .ep-play-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer;
  font-size: 18px;
}

/* ===== Tag chips ===== */
.tag {
  display: inline-block;
  padding: 2px 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 12px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
  cursor: pointer;
  text-decoration: none;
}
.tag:hover { background: #dee5ff; text-decoration: none; }
.tag.big { padding: 5px 14px; font-size: 14px; }

/* ===== Episodes list controls (year group + view toggle) ===== */
.ep-list-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 20px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.ep-list-controls .year-nav {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.ep-list-controls .year-nav a {
  padding: 3px 10px;
  border-radius: 12px;
  background: #eef4ff;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 12px;
}
.ep-list-controls .year-nav a:hover { background: #dbe6ff; }
.ep-list-controls .mini-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
}
.ep-list-controls .mini-btn:hover { border-color: var(--accent); color: var(--accent); }
.view-toggle { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.view-btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 4px 12px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-muted);
}
.view-btn:first-of-type { border-radius: 6px 0 0 6px; }
.view-btn:last-of-type { border-radius: 0 6px 6px 0; margin-left: -1px; }
.view-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Year group */
.year-group { margin-bottom: 8px; }
.year-header {
  cursor: pointer;
  padding: 8px 12px;
  margin: 4px 0 8px;
  border-bottom: 2px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 18px;
  user-select: none;
}
.year-header:hover { background: #f5f7fa; }
.year-header .year-toggle { color: var(--accent); font-size: 12px; }
.year-header .year-label { font-weight: 700; }
.year-header .year-count { color: var(--text-muted); font-size: 13px; font-weight: normal; }
.year-group.collapsed .year-body { display: none; }

/* Compact list view */
.ep-list.view-compact .ep-card {
  padding: 6px 14px;
  min-height: auto;
  grid-template-columns: 50px 1fr auto;
  gap: 12px;
  margin-bottom: 4px;
}
.ep-list.view-compact .ep-card .ep-num {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}
.ep-list.view-compact .ep-card .ep-num small { display: none; }
.ep-list.view-compact .ep-card .ep-title {
  font-size: 13px;
  font-weight: 500;
  display: inline;
  margin-right: 8px;
}
.ep-list.view-compact .ep-card .ep-meta {
  font-size: 12px;
  display: inline;
  color: var(--text-muted);
}
.ep-list.view-compact .ep-card .ep-tags { display: none; }
.ep-list.view-compact .ep-card > div:nth-of-type(2) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ep-list.view-compact .ep-card .ep-play-btn {
  width: 28px; height: 28px; font-size: 13px;
}

/* ===== Filter bar ===== */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  flex-wrap: wrap;
}
.filter-bar label { color: var(--text-muted); }
.filter-bar select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; }

/* ===== Episode detail page ===== */
.ep-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}
.ep-header h1 { font-size: 26px; margin-bottom: 8px; }
.ep-header .ep-meta-row {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ep-header .speakers { margin: 16px 0; }
.ep-header .speakers .role-label {
  display: inline-block;
  color: var(--text-muted);
  font-size: 12px;
  margin-right: 6px;
}
.ep-header .speaker-chip {
  display: inline-block;
  background: #f0f4f8;
  padding: 3px 10px;
  border-radius: 12px;
  margin: 2px 4px 2px 0;
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
}
.ep-header .speaker-chip:hover { background: #e1e8f0; text-decoration: none; }
.ep-header .summary {
  background: #f7f8fa;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  margin-top: 12px;
}

/* ===== Chapters ===== */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.chapters .chapter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 44px 78px 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  transition: background .15s;
}
.chapters .chapter:hover { background: #f5f7fa; }
.chapters .chapter.active { background: #eef4ff; border-color: var(--accent); }
.chapters .chapter .play-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  width: 44px; height: 32px;
  cursor: pointer;
  font-size: 16px;
}
.chapters .chapter .ts {
  font-family: "SF Mono", monospace;
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 5px;
}
.chapters .chapter .body h3 {
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text);
}
.chapters .chapter .body p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* タグ詳細ページ用の chapter レイアウト（回番号・日付を優先表示） */
.chapters .chapter.chapter-in-tag { grid-template-columns: 44px 1fr; }
.chapter-in-tag .ep-info-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.chapter-in-tag .ep-badge {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
}
.chapter-in-tag .ep-badge a { color: var(--accent); }
.chapter-in-tag .date-badge {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.chapter-in-tag .ts-badge {
  font-family: "SF Mono", monospace;
  font-size: 12px;
  color: var(--text-muted);
  background: #f0f4f8;
  padding: 1px 8px;
  border-radius: 10px;
}
.chapter-in-tag .to-ep-link {
  font-size: 12px;
  margin-left: auto;
}

/* ===== Transcript (full text) ===== */
.transcript-full {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
}
.transcript-full > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  padding: 4px 0;
  list-style: none;
}
.transcript-full > summary::before {
  content: "▶ ";
  transition: transform .1s;
  display: inline-block;
}
.transcript-full[open] > summary::before { content: "▼ "; }
.transcript-content {
  margin-top: 16px;
  max-height: 600px;
  overflow-y: auto;
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.75;
}
.tr-para {
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 4px;
}
.tr-para:hover { background: #f7f9fb; }
.tr-ts {
  font-family: "SF Mono", monospace;
  font-size: 11px;
  color: var(--accent);
  background: #eef4ff;
  padding: 1px 6px;
  border-radius: 3px;
  cursor: pointer;
  margin-right: 4px;
  user-select: none;
}
.tr-ts:hover { background: #dbe6ff; }

/* ===== Avatar (X profile pic via unavatar.io) ===== */
.avatar-wrap {
  display: inline-block;
  position: relative;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #eee;
}
.avatar-wrap.avatar-32 { width: 32px; height: 32px; }
.avatar-wrap.avatar-36 { width: 32px; height: 32px; }
.avatar-wrap.avatar-40 { width: 36px; height: 36px; }
.avatar-wrap.avatar-52 { width: 80px; height: 80px; }
.avatar-wrap.avatar-96 { width: 64px; height: 64px; }

.avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  display: block;
}
.avatar-lg { }
.avatar-xl { }

.avatar-fallback {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  color: white;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  font-size: 40%;
  text-transform: uppercase;
}

/* Speaker card レイアウト */
.ep-card.speaker-card { grid-template-columns: 88px 1fr auto; align-items: center; gap: 14px; }
.avatar-link { display: inline-block; line-height: 0; transition: opacity .1s, transform .1s; }
.avatar-link:hover { opacity: .85; transform: scale(1.03); }

/* Speaker詳細ページのhero */
.speaker-hero { display: flex; gap: 16px; align-items: center; }
.speaker-hero-info { flex: 1; }
.speaker-hero-info h1 { margin: 0; font-size: 22px; }

/* Tweet card の avatar */
.tweet-avatar-img { border-radius: 50%; }

/* ===== Notice / info inline ===== */
.notice-inline {
  background: #fffbea;
  border-left: 3px solid #eab308;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #713f12;
  margin: 8px 0 14px;
  line-height: 1.55;
}
.notice-inline strong { color: #713f12; }

/* ===== X (Twitter) profile icon ===== */
.x-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  color: #0f1419;
  background: #f0f4f8;
  vertical-align: middle;
  margin-left: 4px;
  transition: background .1s, color .1s;
  text-decoration: none;
}
.x-link:hover {
  background: #0f1419;
  color: white;
  text-decoration: none;
}
.x-link.x-link-large {
  width: 28px; height: 28px;
}
.x-link.x-link-large .x-icon { width: 15px; height: 15px; }

/* ===== Search page ===== */
#search-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 16px;
  margin-bottom: 16px;
  transition: border-color .15s;
}
#search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.search-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-tabs button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
}
.search-tabs button:hover { border-color: var(--accent); color: var(--text); }
.search-tabs button.active {
  background: var(--accent); color: white; border-color: var(--accent);
}
.search-tabs .cnt {
  margin-left: 4px;
  font-weight: 700;
  font-size: 12px;
  opacity: .8;
}
.search-section-title {
  font-size: 16px;
  color: var(--text-muted);
  margin: 24px 0 8px;
  font-weight: 600;
}
.search-result-item {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .1s, box-shadow .1s;
}
.search-result-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(37,99,235,.08);
  text-decoration: none;
}
.sri-badge {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: .3px;
}
.sri-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.sri-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}
.search-result-item mark {
  background: #fef3c7;
  color: var(--text);
  padding: 1px 3px;
  border-radius: 2px;
}

/* ===== Speaker list card ===== */
/* .ep-card.speaker-card レイアウトは avatar 追加のため上部で再定義 */
.speaker-tags-inline { margin-top: 8px; }
.speaker-tags-inline .tag { font-size: 11px; padding: 2px 8px; }
.speaker-tags-inline .tag .count {
  color: var(--text-muted);
  font-size: 10px;
  margin-left: 3px;
}

/* ===== Tabs ===== */
.tab-container { margin-top: 8px; }
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin: 0;
  overflow-x: auto;
}
.tab-btn {
  background: transparent;
  border: none;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .1s, border-color .1s;
  white-space: nowrap;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-panel { display: none; padding-top: 16px; }
.tab-panel.active { display: block; }

/* ===== Timeline (chapters+tweets統合ビュー) ===== */
.timeline { display: flex; flex-direction: column; gap: 14px; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 18px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--border) 20px, var(--border) calc(100% - 20px), transparent);
  z-index: 0;
}
.timeline > * { position: relative; z-index: 1; }

/* Chapter in timeline: distinct header */
.timeline-chapter {
  background: linear-gradient(to right, #eef4ff, var(--surface) 100px);
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 8px;
  transition: background .15s;
}
.timeline-chapter:hover { background: linear-gradient(to right, #dbe6ff, var(--surface) 100px); }
.timeline-chapter.current {
  border-color: var(--accent);
  background: linear-gradient(to right, #c7d7fe, #eef4ff 100px);
  box-shadow: 0 2px 6px rgba(37,99,235,.15);
}
.timeline-chapter .timeline-marker {
  font-size: 20px;
  padding-top: 6px;
  text-align: center;
}
.timeline-chapter .chapter-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.timeline-chapter .chapter-title-line {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  letter-spacing: .3px;
}
.timeline-chapter .chapter-content { min-width: 0; }
.timeline-chapter .ts {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.timeline-chapter p {
  font-size: 13px;
  color: var(--text);
  margin: 4px 0 6px;
}

/* Tweet in timeline: keep card, add left indent for timeline flow */
.timeline-tweet { padding-left: 40px; }

/* Chapters tab: highlight current */
.chapters .chapter.current {
  border-color: var(--accent);
  background: #eef4ff;
  box-shadow: 0 2px 8px rgba(37,99,235,.12);
}

/* 検索経由スクロール時のフラッシュハイライト */
@keyframes flash-highlight {
  0%   { box-shadow: 0 0 0 6px rgba(234,179,8,.4), 0 4px 20px rgba(234,179,8,.3); }
  100% { box-shadow: 0 0 0 0 rgba(234,179,8,0), 0 0 0 rgba(234,179,8,0); }
}
.scroll-target-flash {
  animation: flash-highlight 2.4s ease-out;
}

/* ===== Tweets (実況ツイート) - X風カード ===== */
.tweets {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tweet-item {
  background: var(--surface);
  border: 1px solid #d0d7de;
  border-radius: 12px;
  padding: 14px 16px 12px;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s, border-color .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  position: relative;
}
.tweet-item:hover {
  border-color: #a8b3bd;
  box-shadow: 0 3px 8px rgba(0,0,0,.08);
  transform: translateY(-1px);
}
.tweet-item.current {
  background: #fffbea;
  border-color: #eab308;
  box-shadow: 0 0 0 3px #fef08a, 0 3px 10px rgba(234,179,8,.15);
}
.tweet-item.current::before {
  content: "▶ 再生中付近";
  position: absolute;
  top: -10px;
  left: 14px;
  background: #eab308;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: .5px;
}

/* header row: avatar + name + time badge */
.tweet-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
/* .tweet-avatar は avatar-wrap で置換されたため未使用 (旧グラデ) */
.tweet-namestack { min-width: 0; flex: 1; }
.tweet-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  line-height: 1.2;
}
.tweet-metaline {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 1px;
}
.tweet-metaline .handle { }
.tweet-metaline .dot { margin: 0 5px; }
.tweet-metaline .abs-time { font-family: monospace; }

/* audio time badge (right side of header) */
.tweet-audio-time {
  background: #eef4ff;
  color: var(--accent);
  border: 1px solid #c7d7fe;
  border-radius: 20px;
  padding: 3px 10px;
  font-family: "SF Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.tweet-item.current .tweet-audio-time {
  background: #fef08a;
  color: #713f12;
  border-color: #eab308;
}

.tweet-media-badge {
  display: inline-block;
  background: #eef4ff;
  color: var(--accent);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  font-weight: 600;
}

.tweet-text {
  font-size: 14.5px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  color: var(--text);
  padding-left: 46px; /* align with name (avatar 36 + gap 10) */
}
.tweet-text a {
  color: var(--accent);
  word-break: break-all;
}

.tweet-footer {
  padding-left: 46px;
  margin-top: 10px;
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.tweet-footer .metric { display: inline-flex; gap: 3px; align-items: center; }
.tweet-footer .tweet-x-link {
  color: var(--accent);
  margin-left: auto;
  font-weight: 500;
}
.tweet-footer .tweet-x-link:hover { text-decoration: underline; }

/* ===== Sticky player ===== */
.player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--player-bg);
  color: var(--player-text);
  padding: 12px 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  z-index: 200;
  box-shadow: 0 -2px 15px rgba(0,0,0,.1);
}
.player .now-playing {
  min-width: 200px;
  max-width: 300px;
}
.player .now-playing .title { font-size: 13px; font-weight: 600; }
.player .now-playing .sub { font-size: 11px; color: #94a3b8; }
.player .controls { display: flex; gap: 8px; align-items: center; }
.player .controls button {
  background: transparent;
  color: white;
  border: 1px solid #4a5058;
  border-radius: 4px;
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: 14px;
  transition: background .1s;
}
.player .controls button:hover { background: #2a2f36; }
.player .controls button.skip {
  width: auto;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
}
.player .controls button.play { background: var(--accent); border-color: var(--accent); font-size: 15px; }
.player .controls button.play:hover { background: var(--accent-hover); }
.player .seek {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  font-family: "SF Mono", monospace;
}
.player .seek .bar {
  flex: 1;
  height: 5px;
  background: #4a5058;
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}
.player .seek .bar .fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--accent);
  border-radius: 3px;
  width: 30%;
}
.player .speed {
  background: #2a2f36;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

/* ===== Tag cloud (tag list page) ===== */
.tag-cloud { line-height: 2.2; }
.tag-cloud .tag { font-size: 14px; padding: 4px 12px; }
.tag-cloud .tag .count { color: var(--text-muted); margin-left: 4px; }

/* ===== Search results ===== */
.search-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 12px;
  align-items: start;
}
.search-result .ts { font-family: monospace; font-size: 13px; color: var(--accent); font-weight: 600; }
.search-result .snippet { font-size: 14px; }
.search-result .snippet mark { background: #fef3c7; padding: 1px 3px; }
.search-result .meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.search-result .play-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  width: 44px; height: 32px;
  cursor: pointer;
}

/* ===== Statistics / hero ===== */
.hero {
  background: linear-gradient(135deg, #eef2ff, #ffffff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}
.hero h1 { font-size: 28px; margin-bottom: 8px; }
.hero .stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.hero .stat { text-align: center; padding: 12px; background: white; border-radius: 8px; border: 1px solid var(--border); }
.hero .stat .num { font-size: 24px; font-weight: 700; color: var(--accent); }
.hero .stat .label { font-size: 12px; color: var(--text-muted); }

/* ===== Utility ===== */
.text-muted { color: var(--text-muted); }
.mt { margin-top: 16px; }

/* ===== Responsive (Mobile / Tablet) ===== */
@media (max-width: 768px) {
  html, body { font-size: 14px; padding-bottom: 100px; }

  .container { padding: 12px; }

  /* Header */
  .header {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .header .brand { font-size: 15px; }
  .header nav { gap: 12px; font-size: 13px; order: 3; width: 100%; }
  .header nav a { padding: 2px 0; }
  .header .search { min-width: 0; flex: 1; order: 2; }
  .header .search input { font-size: 13px; padding: 6px 10px 6px 30px; }
  .header .search::before { left: 8px; font-size: 12px; }

  /* Hero */
  .hero { padding: 20px 16px; margin-bottom: 16px; }
  .hero h1 { font-size: 22px; }
  .hero .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero .stat .num { font-size: 20px; }

  /* Episode cards */
  .ep-card { grid-template-columns: 60px 1fr auto; padding: 12px; gap: 10px; }
  .ep-card .ep-num { font-size: 18px; }
  .ep-card .ep-title { font-size: 14px; }
  .ep-card .ep-meta { font-size: 12px; }
  .ep-card .ep-tags { margin-top: 4px; }
  .ep-card .ep-play-btn { width: 36px; height: 36px; font-size: 15px; }

  /* Episode header on detail */
  .ep-header { padding: 16px; }
  .ep-header h1 { font-size: 20px; line-height: 1.4; }
  .ep-header .ep-meta-row { font-size: 12px; gap: 8px; }
  .ep-header .speakers { margin: 10px 0; }
  .ep-header .speaker-chip { font-size: 12px; padding: 2px 8px; }

  /* Section titles */
  .section-title { font-size: 16px; }

  /* Timeline / chapters */
  .chapters .chapter {
    grid-template-columns: 36px 62px 1fr;
    padding: 10px 12px;
    gap: 8px;
  }
  .chapters .chapter .play-btn { width: 36px; height: 28px; font-size: 14px; }
  .chapters .chapter .ts { font-size: 11px; }
  .chapters .chapter .body h3 { font-size: 14px; }
  .chapters .chapter .body p { font-size: 12px; }
  .chapters .chapter.chapter-in-tag { grid-template-columns: 36px 1fr; }

  .timeline-chapter { grid-template-columns: 32px 1fr; padding: 10px 12px; }
  .timeline-chapter .timeline-marker { font-size: 16px; }
  .timeline-chapter .chapter-title-line { font-size: 13px; }
  .timeline-tweet { padding-left: 20px; }

  /* Tweets */
  .tweet-item { padding: 10px 12px; }
  .tweet-header { gap: 8px; margin-bottom: 6px; }
  .tweet-avatar-img, .avatar-wrap.avatar-36 { width: 32px; height: 32px; }
  .tweet-name { font-size: 13px; }
  .tweet-metaline { font-size: 11px; }
  .tweet-audio-time { font-size: 11px; padding: 2px 8px; }
  .tweet-text { font-size: 13.5px; padding-left: 40px; }
  .tweet-footer { padding-left: 40px; font-size: 11px; }

  /* Tabs */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { padding: 10px 12px; font-size: 13px; }

  /* Episodes list controls */
  .ep-list-controls { flex-direction: column; align-items: stretch; padding: 10px 12px; }
  .ep-list-controls .year-nav { justify-content: flex-start; }
  .view-toggle { margin-left: 0; }

  /* Year header */
  .year-header { padding: 6px 8px; font-size: 16px; }

  /* Filter bar */
  .filter-bar { padding: 10px 12px; font-size: 12px; }

  /* Speaker cards */
  .ep-card.speaker-card { grid-template-columns: 64px 1fr auto; gap: 10px; }
  .avatar-wrap.avatar-52 { width: 56px; height: 56px; }

  .speaker-hero { flex-direction: row; gap: 12px; align-items: center; padding: 16px !important; }
  .avatar-wrap.avatar-96 { width: 56px; height: 56px; }
  .speaker-hero-info h1 { font-size: 18px; }

  /* Tag cloud */
  .tag-cloud { line-height: 2; }
  .tag-cloud .tag.big { font-size: 12px; padding: 3px 10px; }
  .tag { font-size: 11px; padding: 2px 8px; }

  /* Transcript full text */
  .transcript-content { max-height: 400px; font-size: 12.5px; }
  .transcript-full { padding: 10px 12px; }

  /* Player bar */
  .player { padding: 8px 10px; gap: 8px; flex-wrap: wrap; }
  .player .now-playing { min-width: 0; max-width: 40%; }
  .player .now-playing .title { font-size: 12px; }
  .player .now-playing .sub { font-size: 10px; }
  .player .controls button { width: 30px; height: 30px; font-size: 13px; }
  .player .controls button.skip { padding: 0 6px; font-size: 10px; }
  .player .seek { flex: 1 1 100%; order: 3; font-size: 10px; }
  .player .speed { padding: 3px 5px; font-size: 10px; }

  /* Search page */
  #search-input { font-size: 14px; padding: 10px 12px; }
  .search-tabs button { font-size: 11px; padding: 4px 8px; }
  .search-result-item { padding: 10px 12px; }
  .sri-title { font-size: 13px; }
  .sri-body { font-size: 12px; }
}

/* さらに小さい画面 (iPhone SE等) */
@media (max-width: 380px) {
  .hero .stats { grid-template-columns: repeat(2, 1fr); }
  .ep-card .ep-num { font-size: 16px; }
  .header .brand { font-size: 14px; }
  .header nav { gap: 8px; }
}
