:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --fg: #e7e9ee;
  --muted: #9aa1ad;
  --accent: #4f8cff;
  --ok: #3ecf8e;
  --warn: #f2b544;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    16px/1.5 system-ui,
    sans-serif;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  position: sticky;
  top: 0;
}
.brand {
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}
.container {
  padding: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}
.btn {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--fg);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.card {
  background: var(--card);
  border-radius: 0.75rem;
  overflow: hidden;
  text-decoration: none;
  color: var(--fg);
  display: flex;
  flex-direction: column;
}
.card-art img,
.card-art-ph {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: #2a2e37;
}
.card-body {
  padding: 0.6rem 0.7rem;
}
.card-title {
  font-weight: 600;
  font-size: 0.95rem;
}
@media (max-width: 520px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 520px;
}
.input {
  padding: 0.6rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid #333;
  background: #12141a;
  color: var(--fg);
  font-size: 1rem;
}
.error {
  color: #ff6b6b;
}
.preview-card {
  display: flex;
  gap: 1rem;
  background: var(--card);
  padding: 1rem;
  border-radius: 0.75rem;
  margin-top: 1rem;
}
.preview-art {
  width: 120px;
  height: 120px;
  border-radius: 0.5rem;
  object-fit: cover;
}
@media (max-width: 520px) {
  .preview-card {
    flex-direction: column;
  }
  .preview-art {
    width: 100%;
    height: auto;
  }
}
.detail-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.detail-art {
  width: 96px;
  height: 96px;
  border-radius: 0.5rem;
  object-fit: cover;
}
.episodes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ep-row {
  background: var(--card);
  border-radius: 0.6rem;
  padding: 0.7rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.ep-main {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.ep-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  width: max-content;
}
.badge-analyzed {
  background: var(--ok);
  color: #04160e;
}
.badge-none {
  background: #333;
  color: var(--muted);
}
.badge-queued,
.badge-running {
  background: var(--warn);
  color: #241a02;
}
.badge-failed {
  background: #ff6b6b;
  color: #2a0606;
}
@media (max-width: 520px) {
  .ep-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
audio {
  width: 100%;
  margin: 0.5rem 0;
}
.timeline {
  position: relative;
  height: 34px;
  background: #12141a;
  border-radius: 0.4rem;
  margin: 0.4rem 0 1rem;
  overflow: hidden;
}
.tl-seg {
  position: absolute;
  top: 0;
  height: 50%;
  opacity: 0.85;
  border-radius: 2px;
}
.tl-seg.human {
  top: 50%;
}
.tl-seg[data-source="llm"] {
  background: var(--accent);
}
.tl-seg[data-source="human"] {
  background: var(--ok);
}
.tl-cursor {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #fff;
}
.controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 760px) {
  .cols {
    grid-template-columns: 1fr;
  }
}
.transcript {
  background: var(--card);
  border-radius: 0.5rem;
  padding: 0.7rem;
  max-height: 60vh;
  overflow: auto;
}
.tline {
  cursor: pointer;
}
.tline:hover {
  background: #2a2e37;
}
.tline.active {
  background: var(--accent);
  color: #fff;
}
.tline.selected {
  background: #b45309;
  color: #fff;
  box-shadow: inset 0 0 0 1px #f59e0b;
}
.hint-select {
  margin: 0.3rem 0 0.6rem;
}
/* Let the browser paint text selection clearly over transcript lines. */
.transcript ::selection {
  background: #f59e0b;
  color: #111;
}
.seg-row {
  background: var(--card);
  border-radius: 0.5rem;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid transparent;
}
.seg-row.seg-llm {
  border-left-color: var(--accent);
}
.seg-row.seg-human {
  border-left-color: var(--ok);
}
.seg-head {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.seg-actions {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
}
.badge-llm {
  background: var(--accent);
  color: #fff;
}
.badge-human {
  background: var(--ok);
  color: #04160e;
}
.badge.rev {
  background: #333;
  color: var(--muted);
}
