/* =========================================================================
   Live call — Scrolling transcript log
   ========================================================================= */

.call-log-panel {
  max-height: 450px;
  overflow-y: auto;
  font-size: 0.8rem;
  line-height: 1.6;
  /* Force wrap of long URLs / unbreakable customer utterances so the panel
     never widens the parent card past its column budget. */
  overflow-wrap: anywhere;
  word-break: break-word;
  /* The JS auto-scroller (call-log.js scrollToBottomIfStuck) owns scroll
     position. Disable the browser's scroll-anchoring so it can't independently
     nudge scrollTop when a still-revealing bubble ABOVE the viewport grows —
     that fought the manual pin and drifted the view to older text mid-stream
     (worst in demo mode, two AI bubbles revealing at once). */
  overflow-anchor: none;
}
.call-log-panel::-webkit-scrollbar { width: 4px; }
.call-log-panel::-webkit-scrollbar-thumb {
  background: var(--border-emph);
  border-radius: 2px;
}

.log-entry {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  animation: fadeSlide 0.25s var(--ease);
}
.log-entry:last-child { border-bottom: none; }

/* A live AI bubble that has been created (to claim its chronological slot) but
   whose turn is not audible yet — a provider can stream a turn's audio to the server
   while the PREVIOUS actor is still playing out the browser's queue. Hidden until
   its first character is revealed (call-log.js renderUpTo / freezeEntry), so a
   turn's row never appears before that actor speaks it. display:none also skips
   the fadeSlide animation, so the row still animates in when it un-hides. */
.log-entry-pending { display: none; }

/* Timestamp */
.log-ts {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-faint);
  margin-right: 0.5rem;
}

/* Speaker label */
.log-speaker { font-weight: 700; margin-right: 0.3rem; }
.log-speaker-customer { color: var(--blue); }
.log-speaker-agent    { color: var(--teal); }
.log-speaker-rta      { color: var(--yellow); }
.log-speaker-system   { color: var(--text-muted); }

/* RTA coaching lines are hidden in the LIVE transcript: the alert already has
   its own card in the RTA panel, so the row duplicates it while the call is
   running. The rows are still BUILT and inserted — resortLog() groups them with
   their turn head, and rebuildCallLogEntries() feeds them to the post-call
   fallback transcript / export. Scoped to #call-log so the post-call panel
   (#call-log-final) and the Drive doc keep showing them.
   Known cosmetic: a display:none row still matches :last-child, so the last
   VISIBLE line keeps its divider when the newest row is an RTA one. */
#call-log .log-entry[data-speaker="RTA"] { display: none; }

/* Dropped RTA entry */
.log-entry-rta-dropped,
.log-entry-rta-dropped .log-speaker {
  color: var(--text-faint);
  font-style: italic;
}

/* Interrupted (barged-in) entry — the AI line was cut off at the heard point.
   The trailing " —" cue is added in the text node; this dims the line a touch
   so it reads as truncated. Not color-only: the em-dash + aria-label carry the
   meaning for screen readers / low-vision users. */
.log-entry-interrupted .log-text {
  opacity: 0.82;
}
.log-entry-interrupted .log-text::after {
  content: "";
}

/* System / separator entry — inherits the default .log-entry vertical
   padding (0.3rem) so it sits on the same rhythm as every other line. */
.log-entry-system {
  text-align: center;
  color: var(--text-faint);
  font-style: italic;
  font-size: 0.75rem;
  border-bottom: none;
}
