html,
body {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.podcast-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) 92px;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.podcast-layout {
  display: grid;
  grid-template-columns: minmax(290px, 350px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.podcast-sidebar {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.episode-form,
.transcript-tools {
  display: grid;
  gap: 14px;
}

.source-panel textarea {
  min-height: 72px;
  resize: none;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.transcribe-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--lime);
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
}

.button-icon {
  font-size: 11px;
}

.ingest-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.ingest-status.loading .status-indicator {
  animation: status-pulse 1s ease-in-out infinite;
  background: var(--warning);
}

.ingest-status.ready {
  color: var(--lime);
}

.ingest-status.ready .status-indicator {
  background: var(--lime);
}

.ingest-status.error {
  color: var(--danger);
}

.ingest-status.error .status-indicator {
  background: var(--danger);
}

@keyframes status-pulse {
  50% { opacity: 0.25; }
}

.episode-profile {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.episode-profile img {
  width: 62px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
}

.episode-profile div {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.episode-profile span,
.episode-profile small {
  color: var(--muted);
  font-size: 10px;
}

.episode-profile strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
}

.search-control:focus-within {
  border-color: var(--lime);
}

.search-control input {
  border: 0;
}

.search-control span {
  min-width: 42px;
  padding-right: 10px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.toggle-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
}

.toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  background: var(--muted);
  content: "";
  transition: transform 140ms ease, background 140ms ease;
}

.toggle-row input:checked + .toggle-track {
  border-color: var(--lime);
}

.toggle-row input:checked + .toggle-track::after {
  background: var(--lime);
  transform: translateX(16px);
}

.transcript-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.transcript-stats div {
  display: grid;
  gap: 4px;
  padding: 11px 8px;
  border-right: 1px solid var(--line);
}

.transcript-stats div:last-child {
  border-right: 0;
}

.transcript-stats span {
  color: var(--faint);
  font-size: 9px;
  text-transform: uppercase;
}

.transcript-stats strong {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 500;
}

.transcript-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.transcript-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px 30px;
  border-bottom: 1px solid var(--line);
}

.transcript-heading h2 {
  max-width: min(68vw, 900px);
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transcript-state {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.transcript-state.ready {
  color: var(--lime);
}

.transcript-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.transcript-empty {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  min-height: 100%;
  color: var(--faint);
}

.empty-wave {
  color: var(--line-strong);
  font-size: 24px;
  letter-spacing: 4px;
}

.transcript-empty strong {
  font-size: 12px;
  font-weight: 500;
}

.operation-view {
  width: min(620px, calc(100% - 48px));
  margin: clamp(34px, 8vh, 92px) auto 40px;
}

.operation-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 0 0 20px;
}

.operation-spinner {
  width: 30px;
  height: 30px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: operation-spin 900ms linear infinite;
}

@keyframes operation-spin {
  to { transform: rotate(360deg); }
}

.operation-summary div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.operation-summary span,
.operation-summary small,
.operation-summary time {
  color: var(--muted);
  font-size: 10px;
}

.operation-summary strong {
  overflow: hidden;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-summary time {
  min-width: 46px;
  color: var(--lime);
  text-align: right;
}

.operation-progress {
  height: 3px;
  overflow: hidden;
  background: var(--line);
}

.operation-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--lime);
  transition: width 300ms ease;
}

.operation-view.inference-active .operation-progress span {
  animation: operation-breathe 1.6s ease-in-out infinite;
}

.operation-view.operation-error .operation-spinner {
  border-color: var(--danger);
  animation: none;
}

.operation-view.operation-error .operation-progress span {
  background: var(--danger);
}

.operation-view.operation-error .operation-summary time {
  color: var(--danger);
}

@keyframes operation-breathe {
  50% { opacity: 0.35; }
}

.operation-stages {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.operation-stages li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
}

.operation-stages li > span,
.operation-stages li > small {
  font-size: 9px;
}

.operation-stages li > strong {
  font-size: 11px;
  font-weight: 500;
}

.operation-stages li.active {
  color: var(--text-strong);
}

.operation-stages li.active > span,
.operation-stages li.active > small {
  color: var(--lime);
}

.operation-stages li.complete {
  color: var(--muted);
}

.operation-stages li.complete > span,
.operation-stages li.complete > small {
  color: var(--lime);
}

.transcript {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 34px 52px 120px;
}

.pipeline-timing-summary {
  margin-bottom: 24px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.pipeline-timing-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.pipeline-timing-heading strong {
  color: var(--lime);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.pipeline-timing-heading span {
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-timing-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}

.pipeline-timing-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  min-width: 0;
}

.pipeline-timing-list dt,
.pipeline-timing-list dd {
  overflow: hidden;
  margin: 0;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-timing-list dt {
  color: var(--muted);
}

.pipeline-timing-list dd {
  color: var(--text-strong);
  text-align: right;
}

.pipeline-timing-track {
  grid-column: 1 / -1;
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.pipeline-timing-track > span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.transcript-turn {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.transcript-turn[hidden] {
  display: none;
}

.turn-meta {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 6px;
  padding-top: 5px;
}

.speaker-name {
  color: var(--blue);
  font-size: 10px;
  text-transform: uppercase;
}

.speaker-1 .speaker-name,
.speaker-3 .speaker-name {
  color: var(--rose);
}

.speaker-2 .speaker-name {
  color: var(--lime);
}

.turn-time {
  padding: 0;
  background: transparent;
  color: var(--faint);
  font-size: 10px;
}

.turn-time:hover,
.turn-time:focus-visible {
  color: var(--lime);
  outline: none;
}

.turn-words {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1.8;
}

.word {
  display: inline;
  margin: 0;
  padding: 3px 1px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  transition: color 80ms linear, background 80ms linear;
}

.word:hover {
  color: var(--text-strong);
  outline: 1px solid var(--line-strong);
}

.word:focus-visible {
  color: var(--text-strong);
  outline: 1px solid var(--lime);
  outline-offset: 2px;
}

.word.spoken {
  color: var(--muted);
}

.word.active-word {
  background: var(--lime);
  color: var(--lime-ink);
  outline: 3px solid var(--lime);
}

.word.search-hit:not(.active-word) {
  background: color-mix(in srgb, var(--warning) 22%, transparent);
  color: var(--text-strong);
}

.transcript-turn.active-turn {
  border-bottom-color: var(--line-strong);
}

.player-bar {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) auto minmax(300px, 1.4fr) auto;
  align-items: center;
  gap: 24px;
  min-width: 0;
  padding: 12px 24px;
  border-top: 1px solid var(--line-strong);
  background: var(--surface-2);
  box-shadow: 0 -12px 30px rgb(0 0 0 / 18%);
}

.now-playing {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.now-playing img {
  width: 54px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-3);
}

.now-playing div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.now-playing strong,
.now-playing span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-playing strong {
  color: var(--text-strong);
  font-size: 11px;
  font-weight: 600;
}

.now-playing span {
  color: var(--muted);
  font-size: 9px;
}

.transport {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transport-button,
.play-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-size: 10px;
}

.play-button {
  width: 44px;
  height: 44px;
  border-color: var(--lime);
  background: var(--lime);
  color: var(--lime-ink);
  font-size: 14px;
}

.transport-button:hover,
.transport-button:focus-visible {
  border-color: var(--lime);
  color: var(--lime);
  outline: none;
}

.timeline {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
}

.timeline span:last-child {
  text-align: right;
}

input[type="range"] {
  height: 3px;
  padding: 0;
  border: 0;
  accent-color: var(--lime);
  cursor: pointer;
}

.speed-control select {
  width: 68px;
  min-width: 68px;
  height: 38px;
  padding: 0 8px;
  color: var(--text);
  font-size: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .podcast-shell {
    grid-template-rows: auto auto minmax(0, 1fr) 112px;
  }

  .podcast-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .transcript-stats {
    display: none !important;
  }

  .player-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 9px 16px;
    padding: 10px 16px;
  }

  .timeline {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .speed-control {
    display: none;
  }

  .transcript {
    padding: 24px 28px 90px;
  }

  .pipeline-timing-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .transcript-turn {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 16px;
  }
}

@media (max-width: 680px) {
  .podcast-header {
    padding-inline: 16px;
  }

  .header-meta .model-badge {
    display: none;
  }

  .workflow-tabs {
    overflow-x: auto;
  }

  .workflow-tab {
    min-width: 138px;
    padding-inline: 13px;
    font-size: 11px;
  }

  .podcast-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .podcast-sidebar {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.75fr);
    gap: 10px;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .podcast-sidebar .instrument {
    padding: 11px;
  }

  .source-panel textarea {
    min-height: 46px;
    max-height: 46px;
  }

  .ingest-status {
    margin-top: 7px;
  }

  .transcript-tools {
    align-content: start;
    gap: 8px;
  }

  .transcript-tools .field:nth-of-type(2) {
    display: none;
  }

  .transcript-heading {
    min-height: 58px;
    padding: 10px 16px;
  }

  .transcript-heading h2 {
    max-width: 70vw;
    margin-top: 3px;
    font-size: 12px;
  }

  .transcript {
    padding: 12px 16px 72px;
  }

  .pipeline-timing-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .pipeline-timing-heading span {
    max-width: 100%;
  }

  .pipeline-timing-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operation-view {
    width: calc(100% - 32px);
    margin-top: 24px;
  }

  .operation-stages li {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    min-height: 39px;
    gap: 8px;
  }

  .transcript-turn {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 13px 0;
  }

  .turn-meta {
    display: flex;
    gap: 10px;
  }

  .turn-words {
    font-size: 15px;
    line-height: 1.7;
  }

  .now-playing {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .now-playing img {
    width: 42px;
  }
}

@media (max-height: 720px) and (min-width: 681px) {
  .podcast-sidebar {
    gap: 10px;
    padding-block: 12px;
  }

  .podcast-sidebar .instrument {
    padding: 12px;
  }

  .episode-panel {
    display: none;
  }
}
.podcast-sidebar { grid-auto-rows: max-content; }
.episode-profile strong { overflow-wrap: anywhere; }
.episode-profile strong { display: block; -webkit-line-clamp: unset; overflow: visible; }
.source-example {
  border: 1px solid #4a523e;
  background: transparent;
  color: #c3df88;
  padding: 9px 10px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.source-example:hover { background: #1c2315; }
#episodeSourceDetail { display: block; margin-top: 8px; line-height: 1.5; }
#episodeSourceDetail[hidden] { display: none; }
