* {
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  max-width: 900px;
  margin: 40px auto;
  padding: 0 24px;
  color: #222;
  line-height: 1.7;
}

header {
  border-bottom: 3px solid #1C4844;
  padding-bottom: 12px;
  margin-bottom: 28px;
  display: flex;
  align-items: baseline;
  gap: 24px;
}

header h1 {
  color: #1C4844;
  font-size: 1.4em;
  margin: 0;
}

.back-link {
  color: #1C4844;
  font-size: 0.88em;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* ── verdict highlight colours ── */
mark {
  border-radius: 3px;
  padding: 1px 2px;
  cursor: pointer;
}

mark.verified {
  background: #b7f5c8;
  color: #0a4a1e;
}

mark.unverified {
  background: #fde68a;
  color: #5a3e00;
}

mark.contested {
  background: #fed7aa;
  color: #6b2c00;
}

mark.false {
  background: #fecaca;
  color: #6b0000;
}

/* ── legend ── */
.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: 0.85em;
}

.legend-hint {
  color: #666;
  margin-left: 8px;
}

/* ── transcript ── */
.transcript {
  margin-bottom: 40px;
}

.transcript h2 {
  color: #1C4844;
  font-size: 1.1em;
  border-bottom: 1px solid #c8d8d7;
  padding-bottom: 4px;
}

.transcript-body {
  background: #f5faf9;
  border-left: 3px solid #1C4844;
  padding: 16px 20px;
  border-radius: 0 4px 4px 0;
  white-space: pre-wrap;
}

/* ── sources panel ── */
.sources-panel h2 {
  color: #1C4844;
  font-size: 1.1em;
  border-bottom: 1px solid #c8d8d7;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.claim-sources {
  border: 1px solid #c8d8d7;
  border-radius: 6px;
  margin-bottom: 10px;
  padding: 10px 14px;
}

.claim-sources summary {
  cursor: pointer;
  font-size: 0.9em;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.claim-sources summary::-webkit-details-marker {
  display: none;
}

.claim-sources summary::before {
  content: "▶";
  font-size: 0.7em;
  color: #888;
}

.claim-sources[open] summary::before {
  content: "▼";
}

/* label badges mirror mark colours */
.label-badge {
  font-size: 0.72em;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: bold;
  white-space: nowrap;
}

.label-badge.verified   { background: #b7f5c8; color: #0a4a1e; }
.label-badge.unverified { background: #fde68a; color: #5a3e00; }
.label-badge.contested  { background: #fed7aa; color: #6b2c00; }
.label-badge.false      { background: #fecaca; color: #6b0000; }

.justification {
  margin: 8px 0 6px 0;
  font-size: 0.88em;
  color: #444;
  font-style: italic;
}

.source-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85em;
}

.source-list li {
  margin-bottom: 6px;
}

.source-list a {
  color: #1C4844;
}

.snippet {
  display: block;
  color: #555;
  font-size: 0.92em;
  margin-top: 2px;
}

.no-sources {
  font-size: 0.85em;
  color: #888;
  margin: 6px 0 0 0;
}

/* ── home page ── */
.intro {
  color: #444;
  margin-bottom: 28px;
  max-width: 680px;
}

.submit-section {
  margin-bottom: 48px;
}

.submit-form {
  max-width: 540px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.88em;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.text-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #b0c8c6;
  border-radius: 4px;
  font-size: 0.92em;
  color: #222;
}

.text-input:focus {
  outline: none;
  border-color: #1C4844;
}

.file-input {
  font-size: 0.88em;
  color: #444;
}

.form-divider {
  text-align: center;
  color: #999;
  font-size: 0.85em;
  margin: 18px 0;
}

.submit-btn {
  background: #1C4844;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 24px;
  font-size: 0.95em;
  cursor: pointer;
  margin-top: 8px;
}

.submit-btn:hover {
  background: #155540;
}

/* ── recent episodes table ── */
.recent-section h2 {
  color: #1C4844;
  font-size: 1.05em;
  border-bottom: 1px solid #c8d8d7;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.recent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
}

.recent-table th {
  background: #1C4844;
  color: white;
  text-align: left;
  padding: 6px 10px;
}

.recent-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #e0e8e8;
  vertical-align: middle;
}

.recent-table tr:nth-child(even) td {
  background: #f7fafa;
}

.ep-url {
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #444;
}

.view-link {
  color: #1C4844;
  font-size: 0.88em;
  text-decoration: none;
  white-space: nowrap;
}

.view-link:hover {
  text-decoration: underline;
}

.status-badge {
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: bold;
  white-space: nowrap;
  background: #e0e8e8;
  color: #333;
}

.limits-note {
  font-size: 0.8em;
  color: #999;
  margin: -16px 0 20px;
}

.override-section {
  margin-top: 20px;
  font-size: 0.88em;
  color: #888;
}

.override-toggle {
  cursor: pointer;
  user-select: none;
  color: #888;
  list-style: none;
}

.override-toggle::-webkit-details-marker {
  display: none;
}

.override-toggle::before {
  content: "▶ ";
  font-size: 0.7em;
}

details[open] .override-toggle::before {
  content: "▼ ";
}

.override-input {
  max-width: 260px;
}

.status-badge.status-done       { background: #b7f5c8; color: #0a4a1e; }
.status-badge.status-error      { background: #fecaca; color: #6b0000; }
.status-badge.status-transcribing,
.status-badge.status-cleaning,
.status-badge.status-extracting,
.status-badge.status-searching,
.status-badge.status-scoring,
.status-badge.status-rendering  { background: #fde68a; color: #5a3e00; }

/* ── processing page ── */
.processing-section {
  text-align: center;
  padding: 60px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #c8d8d7;
  border-top-color: #1C4844;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 24px;
}

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

.processing-heading {
  color: #1C4844;
  font-size: 1.2em;
  margin: 0 0 8px;
}

.processing-sub {
  color: #555;
  font-size: 0.9em;
  margin: 0 0 6px;
}

.processing-url {
  font-style: italic;
  word-break: break-all;
}

.processing-hint {
  color: #999;
  font-size: 0.82em;
  margin-top: 24px;
}

.error-box {
  max-width: 520px;
  margin: 0 auto;
  background: #fff4f4;
  border-left: 3px solid #c84444;
  padding: 20px 24px;
  border-radius: 0 6px 6px 0;
  text-align: left;
}

.error-box h2 {
  color: #c84444;
  margin-top: 0;
  font-size: 1.05em;
}

.error-box p {
  color: #555;
  font-size: 0.9em;
  margin: 8px 0 0;
}

/* ── episode split layout ── */
body.episode-page {
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

body.episode-page header {
  flex-shrink: 0;
  padding: 10px 24px;
  margin-bottom: 0;
  align-items: center;
}

.audio-bar {
  flex-shrink: 0;
  background: #f5faf9;
  border-bottom: 1px solid #c8d8d7;
  padding: 6px 24px;
}

.audio-bar audio {
  width: 100%;
  height: 36px;
  display: block;
}

body.episode-page .legend {
  margin-bottom: 0;
}

.biographies-section {
  flex-shrink: 0;
  padding: 16px 24px;
  background: #f9fbff;
  border-bottom: 1px solid #c8d8d7;
}

.biographies-section h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #2c4a47;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bio-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.bio-card {
  flex: 1 1 300px;
  background: #fff;
  border: 1px solid #d6e4e3;
  border-radius: 6px;
  padding: 12px 16px;
}

.bio-name {
  display: block;
  font-size: 0.95rem;
  color: #1a3330;
  margin-bottom: 4px;
}

.bio-text {
  margin: 0;
  font-size: 0.85rem;
  color: #4a6b68;
  line-height: 1.5;
}

.episode-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid #c8d8d7;
}

.transcript-pane {
  border-right: 2px solid #c8d8d7;
}

.pane-header {
  padding: 12px 20px 10px;
  background: white;
  border-bottom: 1px solid #e0e8e8;
  flex-shrink: 0;
}

.pane-header h2 {
  color: #1C4844;
  font-size: 1.05em;
  margin: 0 0 8px;
  border: none;
  padding: 0;
}

.pane-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  min-height: 0;
}

body.episode-page .transcript-body {
  background: none;
  border-left: none;
  padding: 0;
  white-space: normal;
}

/* ── v2: speaker-block transcript layout ── */
.speaker-block {
  display: grid;
  grid-template-columns: var(--meta-width, 72px) 1fr;
  gap: 0 14px;
  padding: 14px 0;
  border-bottom: 1px solid #e8f0ef;
}

.speaker-block:last-child {
  border-bottom: none;
}

.speaker-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-top: 3px;
}

.speaker-label {
  font-weight: 700;
  font-size: 0.78em;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--speaker-color, #1C4844);
}

.play-btn {
  background: none;
  border: 1px solid currentColor;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65em;
  padding: 0 0 0 2px;
  opacity: 0.55;
  transition: opacity 0.15s;
  color: var(--speaker-color, #1C4844);
  flex-shrink: 0;
}

.play-btn:hover { opacity: 1; }

.speaker-ad {
  background: #f7f7f5;
  margin: 6px -12px;
  padding: 10px 12px;
  border-radius: 5px;
  border-bottom: none;
  opacity: 0.65;
}

.speaker-ad .speaker-label {
  color: #999;
  font-weight: 400;
  letter-spacing: 0;
}

.speaker-ad .play-btn { display: none; }

.speaker-text {
  font-size: 0.91em;
  line-height: 1.75;
  color: #222;
}

.speaker-ad .speaker-text {
  font-style: italic;
  color: #555;
}

/* ── editorial overview ── */
.overview-section {
  flex-shrink: 0;
  padding: 16px 24px;
  background: #fafaf7;
  border-bottom: 1px solid #c8d8d7;
}

.overview-section h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #2c4a47;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.overview-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 860px;
}

.overview-summary {
  margin: 0;
  font-size: 0.92rem;
  color: #222;
  line-height: 1.6;
}

.overview-block {
  background: #fff;
  border: 1px solid #d6e4e3;
  border-left: 3px solid #1C4844;
  border-radius: 0 5px 5px 0;
  padding: 10px 14px;
}

.overview-critical {
  border-left-color: #b94444;
}

.overview-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4a6b68;
  margin-bottom: 4px;
}

.overview-critical .overview-label {
  color: #b94444;
}

.overview-block p {
  margin: 0;
  font-size: 0.88rem;
  color: #333;
  line-height: 1.6;
}

/* ── episode title/subtitle ── */
.episode-header-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.episode-subtitle {
  font-size: 0.85rem;
  color: #4a6b68;
  margin: 0;
}

mark.active {
  outline: 2px solid #1C4844;
  outline-offset: 1px;
}

.claim-card {
  border: 1px solid #c8d8d7;
  border-radius: 6px;
  margin-bottom: 12px;
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.claim-card.active {
  border-color: #1C4844;
  box-shadow: 0 0 0 2px rgba(28, 72, 68, 0.15);
}

.claim-card-header {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.claim-card-header:hover .claim-card-text {
  color: #1C4844;
}

.claim-card-text {
  font-size: 0.88em;
  color: #444;
  line-height: 1.4;
}
