/* MAMOUSSO — texte suivi pendant l'écoute (karaoké), commun à « Créer un audio », « Mes audios » et à l'éditeur
   de transcription (V40). Le mot lu est surligné (.ttsW.isNow), la phrase lue aussi (.ttsS.isNow). Script : tts_follow.js. */

.ttsFollowHost { min-width: 0; }
.ttsFollow { display: flex; flex-direction: column; gap: 10px; }
.ttsFollowBar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.ttsFollowHint { flex: 1 1 240px; margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.45; }
.ttsFollowAuto {
  display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 0 14px 0 10px; border-radius: 99px;
  border: 1px solid var(--ui-line-strong); background: var(--ui-surface); color: var(--ui-text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.ttsFollowAuto:hover { background: var(--ui-surface-2); border-color: var(--ui-accent); }
.ttsFollowSwitch { position: relative; flex: none; width: 30px; height: 18px; border-radius: 99px; background: var(--ui-line-strong); transition: background .15s; }
.ttsFollowSwitch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.ttsFollowAuto.isOn .ttsFollowSwitch { background: var(--ui-accent); }
.ttsFollowAuto.isOn .ttsFollowSwitch::after { transform: translateX(12px); }
.ttsFollowStage { position: relative; }
.ttsFollowText {
  max-height: min(46vh, 420px); overflow-y: auto; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--ui-line); background: var(--ui-surface-2); color: var(--ui-text-2);
  font-size: 17px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-overflow-scrolling: touch;
}
.ttsFollowText:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.ttsS { border-radius: 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-color .12s; }
.ttsS.isNow { background: var(--ui-accent-soft); color: var(--ui-text); }
.ttsW { border-radius: 5px; padding: 1px 0; -webkit-box-decoration-break: clone; box-decoration-break: clone; cursor: pointer; }
.ttsW.isNow { background: var(--ui-accent); color: #fff; box-shadow: 0 0 0 2px var(--ui-accent); }
.ttsFollow.isSentenceOnly .ttsS { cursor: pointer; }
.ttsFollow.isSentenceOnly .ttsS.isNow { background: color-mix(in srgb, var(--ui-accent) 24%, transparent); }
@media (hover: hover) {
  .ttsW:hover:not(.isNow) { background: color-mix(in srgb, var(--ui-accent) 16%, transparent); }
  .ttsFollow.isSentenceOnly .ttsS:hover:not(.isNow) { background: color-mix(in srgb, var(--ui-accent) 12%, transparent); }
}
.ttsFollowBack {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); min-height: 36px; padding: 0 16px; border-radius: 99px;
  border: 1px solid var(--ui-accent); background: var(--ui-accent); color: #fff; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}
@media (max-width: 640px) {
  .ttsFollowText { max-height: 40vh; padding: 12px 14px; font-size: 18px; }
  .ttsFollowAuto { width: 100%; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .ttsS, .ttsFollowSwitch, .ttsFollowSwitch::after { transition: none; }
}

/* Grande fiche de lecture (V39.2) : le texte suivi en grand pendant l'écoute ; plein écran par le bas sur téléphone. */
.ttsReader [hidden] { display: none !important; }              /* la fiche est hors de la page : même règle qu'elle */
.ttsReader { width: min(1100px, calc(100% - 48px)); height: min(90vh, 940px); max-height: none; padding: 0; overflow: hidden; }
.ttsReader[open] { display: flex; flex-direction: column; }
.ttsReaderHead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 20px 10px 24px; }
.ttsReaderHead small { display: block; margin-bottom: 2px; color: var(--ui-faint); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ttsReaderHead h3 { margin: 0; font-family: var(--ui-sans); font-size: clamp(19px, 2vw, 24px); font-weight: 700; overflow-wrap: anywhere; color: var(--ui-text); }
.ttsReaderClose {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--ui-line-strong); background: var(--ui-surface); color: var(--ui-text); cursor: pointer;
}
.ttsReaderClose svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ttsReaderClose:hover { border-color: var(--ui-accent); }
.ttsReaderBar { display: flex; align-items: center; gap: 12px; padding: 4px 24px 14px; border-bottom: 1px solid var(--ui-line); }
.ttsReaderPlay {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--ui-grad-from), var(--ui-grad-to)); color: #fff; box-shadow: 0 8px 18px -8px rgba(233, 98, 47, .6);
}
.ttsReaderPlay svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.ttsReaderPlay .ttsIconPause, .ttsReaderPlay.isPlaying .ttsIconPlay { display: none; }
.ttsReaderPlay.isPlaying .ttsIconPause { display: block; }
.ttsReaderPlay:focus-visible, .ttsReaderClose:focus-visible { outline: none; box-shadow: var(--ui-ring); }
.ttsReaderTime { min-width: 38px; color: var(--ui-muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ttsReaderTime:last-child { text-align: right; }
.ttsReaderSeek { flex: 1; min-width: 0; accent-color: var(--ui-accent); }
.ttsReaderBody { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 24px 22px; }
.ttsReaderBody .ttsFollowHost, .ttsReaderBody .ttsFollow, .ttsReaderBody .ttsFollowStage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ttsReaderBody .ttsFollowText { flex: 1; max-height: none; padding: 18px 22px; font-size: clamp(19px, 1.9vw, 24px); line-height: 1.85; color: var(--ui-text); }
@media (max-width: 640px) {
  .ttsReader { width: 100%; max-width: 100%; height: 92vh; height: 92dvh; margin: auto 0 0; border-radius: 26px 26px 0 0; border-bottom: 0; }
  .ttsReaderHead { padding: 20px 14px 8px 20px; }
  .ttsReaderBar { padding: 4px 18px 12px; gap: 10px; }
  .ttsReaderBody { padding: 12px 14px 18px; }
  .ttsReaderBody .ttsFollowText { padding: 14px 16px; font-size: 19px; line-height: 1.8; }
}
