.tq-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .tq-layout {
    grid-template-columns: 1fr;
  }
}
.tq-clip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.tq-clip-btn {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
}
.tq-clip-btn.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.tq-clip-mark {
  width: 1.2rem;
  flex-shrink: 0;
  opacity: 0.85;
}
.tq-clip-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tq-summary-table td,
.tq-summary-table th {
  font-size: 0.9rem;
}

/* ---------- Stage: one card holding media, transcript, transport and decision ---------- */
.tq-stage-head h2 {
  margin-bottom: 0.15rem;
}
.tq-stage-head p {
  margin-top: 0;
}
.tq-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius, 10px);
  background: var(--surface);
  overflow: hidden;
}
audio.tq-media {
  display: none;
}
video.tq-media {
  display: block;
  width: 100%;
  max-height: 300px;
  background: #000;
}
.tq-media-missing {
  margin: 0;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--rule);
}

.tq-reader {
  max-height: 46vh;
  overflow-y: auto;
  padding: 1.1rem 1.25rem 0.6rem;
  font-size: 1.12rem;
  line-height: 1.7;
  scroll-behavior: smooth;
}
.tq-transcript {
  max-width: 68ch;
}
.tq-para {
  margin: 0 0 0.9rem;
}
.tq-line {
  display: block;
}
.tq-transcript-plain {
  white-space: pre-wrap;
}
/* Karaoke: only colour changes, never size or weight, so text does not reflow. */
.tq-word {
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: color 0.18s ease, background-color 0.12s ease;
}
.tq-word.is-spoken {
  color: var(--ink);
}
.tq-word.is-active {
  color: var(--ink);
  background-color: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.tq-word:hover {
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .tq-word,
  .tq-reader {
    transition: none;
    scroll-behavior: auto;
  }
}

.tq-transport {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--rule);
  background: var(--surface-2);
}
.tq-play {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink, #fff);
  cursor: pointer;
}
.tq-play:focus-visible,
.tq-speed:focus-visible,
.tq-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tq-time {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 2.6rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tq-seek {
  flex: 1;
  min-width: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.tq-speed {
  flex-shrink: 0;
  min-width: 3rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.tq-decide {
  padding: 0.75rem 1rem 0.6rem;
  border-top: 1px solid var(--rule);
}
.tq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.tq-chip {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.tq-chip:hover {
  border-color: var(--ink-2);
}
.tq-chip.on {
  background: var(--bad-soft);
  border-color: var(--bad);
  color: var(--ink);
}
.tq-chip-good.on {
  background: var(--ok-soft);
  border-color: var(--ok);
}
.tq-decide-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.tq-note {
  flex: 1;
  min-width: 0;
  min-height: 2.4rem;
  resize: vertical;
}
.tq-save {
  flex-shrink: 0;
  min-width: 7.5rem;
}
.tq-hint {
  margin: 0.45rem 0 0;
}
@media (max-width: 600px) {
  .tq-decide-row {
    flex-direction: column;
  }
  .tq-reader {
    padding: 0.9rem 1rem 0.4rem;
  }
}
