/* ===== Transcripts view (#view-transcripts) — task 61eeed59 P1-UI =====
   Jase's win list is the acceptance test: badge opens the page IN APP, episode
   dropdown, blocks + scrub-with-markers + summary right + Transcription-room chat.

   Structure deliberately mirrors #view-workspace (.ws-header / .ws-body) because
   Jase named the workspace view as the model he wants this to feel like — same
   header-with-dropdown shape, same split body. Copying that idiom rather than
   inventing a third layout vocabulary is the whole point.

   Tokens: fleet-* only, from foundation-shell.css / fleet-pit-wall.css (:root
   shared). Nothing forked — heat/marker colours come from the palette below,
   which is Jase-confirmed 2026-04-30 and already used by the standalone editor. */

#view-transcripts { display: none; height: 100%; }
#view-transcripts.active { display: flex; flex-direction: column; }

/* --- header: title + episode dropdown (mirrors .ws-header exactly) --- */
.tx-header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--fleet-hair);
  flex: 0 0 auto;
}
.tx-header h2 {
  font-family: var(--fleet-ink); font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.10em; font-size: 1.1rem; margin: 0;
}
.tx-episode-select {
  background: rgba(0,0,0,0.35); color: var(--text-primary);
  border: 1px solid var(--fleet-hair); border-radius: 6px;
  font-family: var(--fleet-mono); font-size: 12px; padding: 4px 8px;
  max-width: 340px;
}
.tx-episode-select:focus-visible { outline: 2px solid var(--fleet-working); outline-offset: 2px; }
.tx-header-status {
  margin-left: auto; font-family: var(--fleet-mono); font-size: 11px;
  letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap;
}

/* --- scrub rail: the "timeline" Jase means, with markers laid along it ---
   He confirmed scrub is what he meant, so this is the existing scrub concept
   carrying the markers rather than a separate waveform timeline. Markers are
   absolutely positioned by percentage of duration, so the rail needs no JS
   layout pass on resize. */
.tx-scrub-wrap { flex: 0 0 auto; padding: 10px 16px 12px; border-bottom: 1px solid var(--fleet-hair); }
.tx-scrub-rail {
  position: relative; height: 8px; border-radius: 4px;
  background: rgba(0,0,0,0.40); border: 1px solid var(--fleet-hair);
}
.tx-scrub-played {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px;
  background: linear-gradient(90deg, rgba(46,213,115,.42), var(--fleet-working));
  box-shadow: 0 0 12px rgba(46,213,115,.42);
}
.tx-scrub-head {
  position: absolute; top: -4px; width: 3px; height: 16px; border-radius: 2px;
  background: var(--text-primary); transform: translateX(-50%);
}
/* Marker palette — Jase-confirmed 2026-04-30. Same five types the editor's
   keyboard shortcuts set (H/R reel, I intro, S seg, C cut, A ch). Do not
   re-pick these colours; they are shared vocabulary with the editor. */
.tx-marker {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  transform: translateX(-50%); border-radius: 1px;
}
.tx-marker-reel  { background: #ffffff; }
.tx-marker-intro { background: #ff3b30; }
.tx-marker-seg   { background: #007aff; }
.tx-marker-cut   { background: #ff9500; }
.tx-marker-ch    { background: #34c759; }
.tx-marker:focus-visible { outline: 2px solid var(--fleet-working); outline-offset: 2px; }
.tx-scrub-legend {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px;
  font-family: var(--fleet-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
}
.tx-legend-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* --- body: blocks left, summary + chat right (his "summary is on the right") --- */
.tx-body { display: flex; flex: 1; min-height: 0; gap: 16px; padding: 14px 16px; }
.tx-blocks {
  flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.tx-side {
  flex: 0 0 34%; max-width: 420px; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; gap: 12px;
}

.tx-block {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--fleet-hair);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit;
}
.tx-block:hover { border-color: rgba(255,255,255,0.16); }
.tx-block:focus-visible { outline: 2px solid var(--fleet-working); outline-offset: 2px; }
.tx-block-head { display: flex; align-items: baseline; gap: 8px; }
.tx-block-speaker {
  font-family: var(--fleet-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--fleet-working);
}
.tx-block-time { font-family: var(--fleet-mono); font-size: 10px; color: var(--text-muted); margin-left: auto; }
.tx-block-text { font-family: var(--fleet-text); font-size: 0.84rem; line-height: 1.45; margin-top: 3px; }

/* Attribution states. The S4 gate accepts 95% coverage, so "who spoke" is not
   always known — the UI has to SAY so rather than render a confident guess.
   Three non-clean states, each visually distinct from a clean attribution. */
.tx-block-low .tx-block-speaker { color: var(--fleet-your-move); }
.tx-block-low .tx-block-speaker::after { content: ' ?'; }
.tx-block-crosstalk .tx-block-speaker { color: var(--fleet-waiting); }
.tx-block-unattributed { border-style: dashed; }
.tx-block-unattributed .tx-block-speaker { color: var(--text-muted); }

.tx-panel {
  border: 1px solid var(--fleet-hair); border-radius: 10px;
  background: var(--fleet-panel); min-height: 0; display: flex; flex-direction: column;
}
.tx-panel-head {
  padding: 8px 11px; border-bottom: 1px solid var(--fleet-hair);
  font-family: var(--fleet-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.tx-summary { flex: 1 1 auto; min-height: 120px; }
.tx-summary-body {
  overflow-y: auto; padding: 11px; font-family: var(--fleet-text);
  font-size: 0.82rem; line-height: 1.5; color: var(--text-secondary); white-space: pre-wrap;
}

/* Chat slot. The Transcription room chat is REPARENTED in here (messages.js
   already does this for the terminal — same element IDs, so the module and its
   socket keep working untouched). Reparenting is exclusive: while the chat
   lives here it cannot also render in the DM sidebar. */
.tx-chat { flex: 1 1 auto; min-height: 180px; }
.tx-chat-slot { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
/* The lend-wrapper messages.js hands back — holds the reparented #dm-thread and
   its .dm-compose as a single node so the slot only sees one child. Flex column
   so the thread scrolls and the composer sits pinned at the bottom, matching
   the sidebar's layout. */
.dm-lent-chat { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.dm-lent-chat > #dm-thread { flex: 1 1 auto; min-height: 0; }
.dm-lent-chat > .dm-compose { flex: 0 0 auto; }

/* Selection-wake coalescing (comms-claude R2): only the LAST selection inside
   the window wakes the room, so there is a beat where the page shows episode B
   while the room still knows A. Say so rather than let stale answers read as
   wrong ones. */
.tx-chat-context {
  font-family: var(--fleet-mono); font-size: 10px; letter-spacing: 0.04em;
  color: var(--text-muted); margin-left: auto; text-align: right;
}
.tx-chat-context b { color: var(--fleet-working); font-weight: 600; }
.tx-chat-pending b { color: var(--fleet-your-move); }
.tx-chat-pending::after { content: ' · syncing'; color: var(--fleet-your-move); }

.tx-empty {
  padding: 22px 16px; font-family: var(--fleet-text); font-size: 0.86rem;
  color: var(--text-muted); text-align: center;
}

/* Phone: side column drops under the blocks rather than squeezing both.
   Matches the .tasks-box stacking rule the rest of the app uses at this width. */
@media (max-width: 900px) {
  .tx-body { flex-direction: column; padding: 12px; gap: 12px; }
  .tx-side { flex: 0 0 auto; max-width: none; }
  .tx-blocks { flex: 1 1 auto; }
  .tx-episode-select { max-width: 200px; }
}
