/*
 * Trainer talk state styles (trainer-talk run two): the talk's warning cards (no microphone, failure, cap and off),
 * the hand-off view and the voice note. Split from trainer-talk.css at its 500-line cap and linked right after it;
 * every rule sits under [data-tool="trainer"] and every value comes from tokens.css.
 */

/* The warning card (IMPL-018, TX17): the built sand callout with the glyph in --ink before its lines */
[data-tool="trainer"] .talk-warning {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

[data-tool="trainer"] .talk-warning__icon {
  flex: none;
  color: var(--ink);
}

[data-tool="trainer"] .talk-warning__lines {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

[data-tool="trainer"] .talk-warning__line,
[data-tool="trainer"] .talk-warning__note {
  margin: 0;
}

[data-tool="trainer"] .talk-warning__note {
  color: var(--ink-2);
  font-size: var(--tx-tiny-size);
  line-height: var(--tx-tiny-line-height);
}

[data-tool="trainer"] .talk-no-mic {
  margin-top: var(--space-md);
}

[data-tool="trainer"] .talk-start[data-mic="no"] .talk-start__actions {
  text-align: center;
}

/* FailureCallout (IMPL-019, TX16): the card above the dock's place, then «Спробувати ще раз» over the centred
   hand-off link; the dock and the help chips are hidden while it shows */
[data-tool="trainer"] .talk-failure-slot:empty {
  display: none;
}

[data-tool="trainer"] .talk-failure {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

[data-tool="trainer"] :is(.talk-failure__actions, .talk-handoff__actions) {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
  text-align: center;
}

/* talk-handoff (TA09): the heading, the reason card, the built hand-off and «Я поговорив/ла» in one column */
[data-tool="trainer"] .talk-handoff {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-top: var(--space-md);
}

/* VoiceNote (IMPL-020, TA12): under the partner's text in --ink-2 at the small size */
[data-tool="trainer"] .voice-note {
  margin: var(--space-xs) 0 0;
  color: var(--ink-2);
  text-align: start;
}

/* KD-K32: only the part label band of the TalkFrame sticks to the top edge while the thread scrolls the page
   (phone and desktop alike); it is opaque on the page background and above every other sticky region, so the task
   chips scroll away under it and a chip is either fully visible below the band or hidden by it */
[data-tool="trainer"] .talk-frame__header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-block: var(--space-xs);
  background: var(--bg);
  line-height: var(--lh-body);
}

/* TEST-051 (UX-004): at VIEWPORT_MIN_WIDTH with TEXT_ZOOM_MAX a partner bubble shrinks and wraps its words, so the
   avatar, the bubble and the speaker stay in the row with no sideways scroll */
[data-tool="trainer"] .turn__bubble {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* PartnerAvatar while the partner thinks (IMPL-025, ui.md): the listening pose at reduced opacity, the change by
   opacity over the state duration; under reduced motion opacity only within REDUCED_FADE_MS (UX-006) */
[data-tool="trainer"] .turn .goose-avatar {
  transition: opacity var(--tx-state-duration) var(--ease-toggle);
}

[data-tool="trainer"] .talk-frame[data-state="talk-thinking"] .turn--partner .goose-avatar {
  opacity: var(--tx-avatar-thinking-opacity);
}

@media (prefers-reduced-motion: reduce) {
  [data-tool="trainer"] .turn .goose-avatar {
    transition: opacity var(--tx-reduced-fade) var(--ease-toggle);
  }
}

/* KD-K32 (UX-004): the thread keeps THREAD_MIN_VISIBLE (160 px) between the band and a sticky bottom region, so on a
   short viewport the record dock and the text answer scroll with the page instead. The heights are the band plus
   the region plus 160 px at 320 px wide with TEXT_ZOOM_MAX (dock 58 + 180, text answer 58 + 530); em follows the
   reader's own text size */
@media (max-height: 25em) {
  [data-tool="trainer"] .talk-dock {
    position: static;
  }
}

@media (max-height: 47.5em) {
  [data-tool="trainer"] .talk-text-answer {
    position: static;
  }
}
