:root {
  --bg: #0c1118;
  --bg-glow: #152033;
  --surface: #151d2b;
  --surface2: #1c2638;
  --border: #2a3548;
  --text: #eef2f8;
  --muted: #93a0b5;
  --accent: #6eb0ff;
  --accent-strong: #3d8fff;
  --active-bg: rgba(110, 176, 255, 0.22);
  --active-text: #fff;
  --radius: 14px;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Cascadia Code", ui-monospace, monospace;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg-glow), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.hero {
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

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

.eyebrow a:hover {
  text-decoration: underline;
}

.hero h1 {
  margin: 0 0 6px;
  font-family: var(--font);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.date {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.98rem;
}

.summary {
  margin: 0;
  color: #c8d2e4;
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 62ch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.player {
  padding: 18px 18px 14px;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.transport {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}

.btn:hover {
  border-color: var(--accent);
  background: #243149;
}

.btn:active {
  transform: scale(0.97);
}

.btn.icon {
  min-width: 48px;
  height: 40px;
  padding: 0 12px;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--muted);
}

.btn.play {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #061018;
  font-size: 1rem;
  box-shadow: 0 6px 18px rgba(61, 143, 255, 0.35);
}

.btn.play:hover {
  filter: brightness(1.05);
  border-color: transparent;
  background: linear-gradient(160deg, var(--accent), var(--accent-strong));
}

.btn.play.is-playing .play-icon { display: none; }
.btn.play.is-playing .pause-icon { display: inline; }
.btn.play .pause-icon[hidden] { display: none !important; }
.btn.play.is-playing .pause-icon[hidden] { display: inline !important; }

.times {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.times .sep { margin: 0 4px; opacity: 0.6; }

.scrubber-wrap {
  position: relative;
  margin-bottom: 6px;
}

.scrubber {
  width: 100%;
  accent-color: var(--accent);
  height: 28px;
  cursor: pointer;
}

.clip-marks {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  pointer-events: none;
  transform: translateY(-50%);
}

.clip-marks .gap {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(255, 209, 102, 0.35);
  border-radius: 2px;
}

.transcript-section {
  padding: 14px 16px 16px;
}

.transcript-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.transcript-toolbar h2 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.auto-scroll {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  user-select: none;
  cursor: pointer;
}

.auto-scroll input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.transcript {
  position: relative;
  max-height: min(58vh, 640px);
  overflow: auto;
  padding: 14px 16px 20px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 1.08rem;
  line-height: 1.7;
  color: #d7deea;
  scroll-behavior: auto;
}

.transcript-placeholder {
  margin: 0;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 0.95rem;
}

.transcript .seg {
  display: inline;
  border-radius: 3px;
  padding: 0.05em 0.08em;
  transition: background 0.12s, color 0.12s;
  cursor: pointer;
}

.transcript .seg.active {
  background: var(--active-bg);
  color: var(--active-text);
  box-shadow: 0 0 0 1px rgba(110, 176, 255, 0.35);
}

.foot {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 560px) {
  .page { padding: 18px 14px 36px; }
  .player { position: static; }
  .btn.icon { min-width: 44px; }
}

.nav-sermons {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 0;
  flex-wrap: wrap;
}
.nav-sermons a, .nav-sermons span {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}
.nav-sermons a:hover { text-decoration: underline; }
.nav-sermons .disabled {
  color: var(--muted);
  opacity: 0.55;
  pointer-events: none;
}
.seg-popover {
  position: fixed;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  padding: 4px;
  background: #121a28;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-family: var(--ui);
}
.seg-popover[hidden] {
  display: none !important;
}
.seg-popover-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.seg-popover-btn:hover {
  background: var(--surface2);
  color: var(--accent);
}
.seg-popover-icon {
  font-size: 0.95em;
  line-height: 1;
}
