/* Transcripts of voice room calls (EPIC 27c336ed58f5, plan item 5; voice_transcript.js): the notice
   that one runs, its latest lines and the member's own part on a room's stage, the toggle among the
   call's controls and the call bars' "Transcript on". Red marks a running transcript, as a recording
   light would. Also who spoke (EPIC 0ce4890fa47c): the room's note that speaker recognition is on and
   the "That was me" chips under a posted transcript (voice_claims.js). Uses the chat's design tokens
   (chat.css) and the voice styles (voice.css). */

.chat-transcript {
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 640px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-solid);
}

.chat-transcript[data-state="on"],
.chat-transcript[data-state="stopping"] {
  border-color: rgba(180, 35, 24, 0.42);
}

.chat-transcript-notice {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--text);
  font-weight: 650;
}

.chat-transcript-notice-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* The light: red and pulsing while the transcript is on, grey otherwise. */
.chat-transcript-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.chat-transcript[data-state="on"] .chat-transcript-dot,
.chat-voice-bar-transcript .chat-transcript-dot {
  background: var(--red);
  animation: chat-transcript-light 1.6s ease-in-out infinite;
}

.chat-transcript[data-state="stopping"] .chat-transcript-dot {
  background: var(--amber);
}

@keyframes chat-transcript-light {
  50% {
    opacity: 0.35;
  }
}

/* Speaker recognition is on (a member present has a voice profile): shown to everyone who sees the
   room, also on a phone. */
.chat-transcript-recognition {
  margin: 0;
  padding-left: 18px;
  color: var(--muted-bright);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.chat-transcript-captions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted-bright);
  font-size: 14px;
  line-height: 1.4;
}

.chat-transcript-line {
  overflow-wrap: anywhere;
}

.chat-transcript-speaker {
  color: var(--text);
  font-weight: 650;
}

.chat-transcript-line[data-missing="true"] .chat-transcript-words {
  color: var(--amber);
  font-style: italic;
}

.chat-transcript-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* The toggle shares the look of "Share screen" (voice.css); pressed, it shows red, not cyan. */
.chat-voice-transcript-toggle[aria-pressed="true"],
.chat-voice-transcript-toggle[aria-pressed="true"]:hover:not(:disabled) {
  border-color: var(--red);
  background: rgba(180, 35, 24, 0.08);
  color: var(--red);
}

.chat-voice-transcript-toggle:hover:not(:disabled):not([aria-pressed="true"]) {
  border-color: var(--red);
  color: var(--red);
}

/* The call bars: one short line under the controls. */
.chat-voice-bar-transcript {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 650;
}

.chat-voice-bar-transcript .chat-transcript-dot {
  width: 8px;
  height: 8px;
}

/* A phone's stage is short: its sticky call controls would cover older lines, so only the latest shows. */
html[data-chat-layout="phone"] .chat-transcript {
  padding: 10px 12px;
}

html[data-chat-layout="phone"] .chat-transcript-line:not(:last-child) {
  display: none;
}

/* On a phone the toggle is a round control like its neighbours (its words are its aria-label), so
   the call's controls stay in one row. */
html[data-chat-layout="phone"] .chat-voice-stage-controls .chat-voice-transcript-toggle {
  width: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: 50%;
}

html[data-chat-layout="phone"] .chat-voice-transcript-toggle .chat-voice-share-text,
html[data-chat-layout="phone"] .chat-transcript:has(.chat-transcript-captions:not([hidden])) .chat-transcript-hint {
  display: none;
}

/* "That was me" under a posted transcript (voice_claims.js): one chip per voice that matched no voice
   profile ("Speaker 2 · That was me"), the member's own claim with "Not me", and another member's
   claim without an action (dashed). Refusals show below the chips (chat-error). */
.chat-voice-claims {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.chat-voice-claims-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-voice-claim {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  padding: 2px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-solid);
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
}

button.chat-voice-claim {
  cursor: pointer;
}

button.chat-voice-claim:hover:not(:disabled),
button.chat-voice-claim:focus-visible {
  border-color: var(--cyan);
}

.chat-voice-claim[aria-busy="true"] {
  cursor: progress;
  opacity: 0.6;
}

.chat-voice-claim-who {
  overflow: hidden;
  min-width: 0;
  max-width: 220px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-voice-claim-sep,
.chat-voice-claim-note {
  color: var(--muted);
  white-space: nowrap;
}

.chat-voice-claim-act {
  color: var(--cyan);
  font-weight: 650;
  white-space: nowrap;
}

.chat-voice-claim[data-state="mine"] {
  padding-right: 3px;
  border-color: rgba(0, 111, 120, 0.42);
  background: var(--cyan-soft);
}

.chat-voice-claim[data-state="taken"] {
  border-style: dashed;
  color: var(--muted-bright);
}

.chat-voice-claim-undo {
  min-height: 24px;
  padding: 1px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-solid);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.chat-voice-claim-undo:hover:not(:disabled),
.chat-voice-claim-undo:focus-visible {
  border-color: var(--red);
  color: var(--red);
}

/* Phone: 44 px targets (mobile_shell.css). */
html[data-chat-layout="phone"] .chat-voice-claim {
  min-height: 44px;
}

html[data-chat-layout="phone"] .chat-voice-claim-undo {
  min-height: 38px;
  padding: 1px 14px;
}

html[data-chat-layout="phone"] .chat-voice-claim-who {
  max-width: 40vw;
}

@media (prefers-reduced-motion: reduce) {
  .chat-transcript[data-state="on"] .chat-transcript-dot,
  .chat-voice-bar-transcript .chat-transcript-dot {
    animation: none;
  }
}

/* Call recordings for the final transcript (EPIC 0d733696b65f, child 8; voice_test_recording.js): the
   room's notice of who is recorded and the "Call recordings" section of "Edit profile". */
.chat-test-recording-notice {
  font-weight: 600;
}

.chat-test-recording-status {
  margin: 0;
  color: var(--text);
}

.chat-test-recording-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-test-recording-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.92em;
  line-height: 1.45;
}

.chat-test-recording-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-test-recording-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* An empty room's transcript: end it before its countdown runs out (EPIC 0d733696b65f, child 13). */
.chat-transcript-end-now {
  margin-left: auto;
  padding: 2px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.85em;
  cursor: pointer;
}
.chat-transcript-end-now:disabled {
  opacity: 0.6;
  cursor: default;
}
