/* ============================================================
   MAMOUSSO V42 — page « Transcrire un audio ou une vidéo » au design de la maquette
   Même en-tête que « Créer un audio » (retour, titre, guide), trois cartes d'action
   comme l'accueil (fichiers, lien, micro), boutons orange (le bleu des boutons de
   transcription disparaît, fenêtre « Transcrire des fichiers » comprise), solde en
   encart, barre du haut lisible sur téléphone et liste « Mes transcriptions » qui
   garde le nom des fichiers sur téléphone.
   Chargé après shell.css : n'utilise que les jetons --ui-* et --sh-*.
   ============================================================ */

/* les boutons de transcription prennent l'orange du site (fenêtre comprise) */
body.mxTranscribe {
  --up-blue: var(--ui-grad-from);
  --up-blue-2: var(--ui-grad-to);
  --up-blue-soft: var(--ui-accent-soft);
  --up-blue-shadow: rgba(233, 98, 47, .6);
}

/* ---------------------------------------------------------------- en-tête */
.trHead svg, .trActions svg, .trBtn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.trHead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin: 4px 0 20px; }
.trHeadText { min-width: 0; }
.trBack {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--ui-muted);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.trBack svg { width: 18px; height: 18px; }
.trBack:hover { color: var(--ui-accent); }
.mxTranscribe .trHead h1 {
  margin: 0 0 6px; color: var(--ui-text); font-size: clamp(26px, 2.6vw, 34px); font-weight: 800;
  letter-spacing: -.025em; line-height: 1.15;
}
.trHead p { max-width: 640px; margin: 0; color: var(--ui-muted); font-size: 15px; line-height: 1.55; }
.trGuideBtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--ui-line-strong); background: var(--ui-surface); color: var(--ui-text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--ui-card-shadow);
}
.trGuideBtn svg { width: 18px; height: 18px; color: var(--ui-accent); }
.trGuideBtn:hover, .trGuideBtn[aria-expanded="true"] { border-color: var(--ui-accent); }
.trGuideBtn:focus-visible { outline: none; box-shadow: var(--ui-ring); border-color: var(--ui-accent); }
.mxTranscribe .trGuide { margin: 0 0 18px; padding: 16px 20px; }
.trGuide[hidden] { display: none; }
.trGuide ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ui-text-2); font-size: 14.5px; line-height: 1.55; }
.trGuide strong { color: var(--ui-text); }

/* ---------------------------------------------------------------- cartes d'action */
.trActions {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin: 0 0 18px;
}
.trAction {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  background: var(--ui-surface);
  box-shadow: var(--ui-card-shadow);
  transition: box-shadow .25s, transform .25s;
}
.trAction:hover { box-shadow: var(--ui-hover-shadow); transform: translateY(-2px); }
.trActionMain {
  border-color: color-mix(in srgb, var(--ui-accent) 22%, var(--ui-line));
  background:
    radial-gradient(120% 90% at 100% 0%, var(--ui-accent-soft), transparent 60%),
    var(--ui-surface);
}
.trActionIcon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  border-radius: 13px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}
.trActionIcon svg { width: 24px; height: 24px; }
.mxTranscribe .trAction h2 { margin: 0; color: var(--ui-text); font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.trAction p { flex: 1; margin: 0 0 10px; color: var(--ui-muted); font-size: 14px; line-height: 1.55; }

.mxTranscribe .trBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .2s, transform .2s, background-color .2s, color .2s;
}
.trBtn svg { width: 18px; height: 18px; flex: none; }
.trBtn .trBtnArrow { stroke-width: 2; }
.mxTranscribe .trBtn:hover { transform: translateY(-1px); }
.mxTranscribe .trBtn:focus-visible { outline: none; box-shadow: var(--ui-ring); }
.mxTranscribe .trBtnPrimary {
  min-height: 50px;
  padding: 0 22px;
  background: linear-gradient(180deg, var(--ui-grad-from), var(--ui-grad-to));
  color: #fff;
  font-size: 16px;
  box-shadow: 0 12px 24px -12px rgba(233, 98, 47, .9), 0 1px 0 rgba(255, 255, 255, .25) inset;
}
.mxTranscribe .trBtnPrimary:hover { filter: brightness(1.05); }
.mxTranscribe .trBtnSoft { background: var(--ui-accent-soft); color: var(--ui-accent); }
.mxTranscribe .trBtnSoft:hover { background: color-mix(in srgb, var(--ui-accent) 18%, var(--ui-surface)); }
.trRecDot { width: 14px !important; height: 14px !important; }
.trRecDot circle { fill: currentColor; stroke: none; }
/* enregistrement en cours, fenêtre fermée : le bouton le rappelle */
.mxTranscribe .trRecBtn.isLive { background: var(--ui-danger-soft); color: var(--ui-danger); }
.mxTranscribe .trRecBtn.isLive .trRecDot { animation: upPulse 1.2s ease-in-out infinite; }

/* solde disponible, sous les cartes */
.mxTranscribe .trWallet {
  grid-column: 1 / -1;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  min-height: 54px;
  padding: 10px 16px 10px 58px;
  border: 1px solid var(--sh-wallet-line);
  border-radius: 14px;
  background: var(--sh-wallet-bg);
  color: var(--ui-muted);
  font-size: 14px;
}
.mxTranscribe .trWallet[hidden] { display: none; }
.trWallet::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  border-radius: 9px;
  background: var(--ui-accent-soft);
}
.trWallet::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: var(--ui-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cellipse cx='12' cy='6.5' rx='7' ry='2.5'/%3E%3Cpath d='M5 6.5v5c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5v-5M5 11.5v5c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5v-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cellipse cx='12' cy='6.5' rx='7' ry='2.5'/%3E%3Cpath d='M5 6.5v5c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5v-5M5 11.5v5c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5v-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.trWallet .upQuotaText b { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.mxTranscribe .trWallet .upQuotaLink {
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--ui-surface);
  border: 1px solid var(--sh-wallet-line);
  font-size: 13.5px;
  white-space: nowrap;
}
.mxTranscribe .trWallet .upQuotaLink:hover { border-color: var(--ui-accent); text-decoration: none; }

.mxTranscribe .trStats { margin-bottom: 18px; }

/* ---------------------------------------------------------------- Mes transcriptions */
/* « Nouveau dossier » ne concurrence plus « Transcrire des fichiers » */
.mxTranscribe #libNewFolderBtn {
  border: 0;
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  box-shadow: none;
}
.mxTranscribe #libNewFolderBtn:hover { filter: none; background: color-mix(in srgb, var(--ui-accent) 18%, var(--ui-surface)); }
/* recherche : un seul cadre (la case de saisie garde le sien) */
.mxTranscribe .libToolbar .libSearch {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.mxTranscribe .libToolbar .libSearch:focus-within { box-shadow: none; }
.mxTranscribe .libToolbar .libSearch svg { z-index: 1; }

/* ---------------------------------------------------------------- écrans moyens et petits */
@media (max-width: 1100px) {
  .trActions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .trActionMain { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  /* le choix de la langue prend la largeur de son nom (il débordait sur le bouton du thème) */
  .mxTranscribe .appTopbar .languageControl.lpControl { flex: none; width: auto; min-width: 0; }
}
@media (max-width: 720px) {
  /* liste : le nom du fichier garde toute la ligne, le statut passe dessous */
  .mxTranscribe.appBody .libCard:not(.libGrid) .libRow {
    grid-template-columns: 22px 38px minmax(0, 1fr) auto;
    grid-template-areas:
      "check icon text acts"
      "check icon status acts";
    row-gap: 6px;
    align-items: center;
  }
  .libCard:not(.libGrid) .libRow > .libCheck { grid-area: check; }
  .libCard:not(.libGrid) .libRow > .libRowIcon { grid-area: icon; }
  .libCard:not(.libGrid) .libRow > .historyRowText { grid-area: text; align-self: end; }
  .libCard:not(.libGrid) .libRow > .libCellStatus { grid-area: status; align-self: start; justify-self: start; }
  .libCard:not(.libGrid) .libRow > .libRowActs { grid-area: acts; }
  .libCard:not(.libGrid) .libRow .historyRowText b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .libCard:not(.libGrid) .libRow .historyRowText small { white-space: normal; }
  .mxTranscribe .libCellStatus .historyBadge { padding: 3px 8px; font-size: 11.5px; }
  /* barre d'outils : recherche sur toute la largeur, date / tri / affichage sur une ligne */
  .mxTranscribe .libToolbar { gap: 8px; }
  .mxTranscribe .libToolbar .libSearch { order: 1; flex: 1 1 calc(100% - 100px); width: auto; max-width: none; }
  .mxTranscribe .libToolbar .libViewToggle { order: 2; flex: none; }
  .mxTranscribe .libToolbar .libSelect { order: 3; flex: 1 1 0; min-width: 40%; max-width: none; }
  .mxTranscribe .libToolbar .libSelect { padding-left: 4px; }
  .mxTranscribe .libToolbar .libSelect svg { display: none; }
}
@media (max-width: 640px) {
  .trHead { align-items: stretch; margin-bottom: 16px; }
  .trGuideBtn { justify-content: center; }
  .trActions { gap: 10px; }
  .trAction { padding: 16px; border-radius: 16px; gap: 6px; }
  .trActionMain { padding: 20px 18px; }
  .trActionMain .trBtn { align-self: stretch; }
  .trAction:not(.trActionMain) .trActionIcon { width: 40px; height: 40px; border-radius: 11px; margin-bottom: 2px; }
  .trAction:not(.trActionMain) .trActionIcon svg { width: 20px; height: 20px; }
  .mxTranscribe .trAction:not(.trActionMain) h2 { font-size: 15.5px; }
  .trAction:not(.trActionMain) p { font-size: 13px; line-height: 1.45; margin-bottom: 6px; }
  .mxTranscribe .trAction:not(.trActionMain) .trBtn { align-self: stretch; min-height: 42px; padding: 0 10px; font-size: 14px; }
  .trAction:not(.trActionMain) .trBtnArrow { display: none; }
  .mxTranscribe .trWallet { padding: 12px 14px 12px 56px; font-size: 13.5px; }
  .mxTranscribe .trWallet .upQuotaLink { margin-left: 0; }
  /* barre du haut : le drapeau seul pour la langue, la recherche garde sa place */
  .mxTranscribe .appTopbar .lpTriggerName { display: none; }
  .mxTranscribe .appTopbar .lpTrigger { padding: 0 8px 0 10px; gap: 4px; }
  .mxTranscribe .appTopbar .topbarActions .appSearch { flex: 1 1 0; min-width: 0; width: auto; }
}

/* ---------------------------------------------------------------- V92 : confiance (visiteur) */
.trTrust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.trTrust p { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 14px 16px; border: 1px solid var(--ui-line); border-radius: 14px; background: var(--ui-surface); color: var(--ui-muted); font-size: 14px; line-height: 1.5; }
.trTrust b { color: var(--ui-text); font-weight: 600; }
.trTrust a { color: var(--ui-text); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.trTrust svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--ui-accent); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 860px) { .trTrust { grid-template-columns: minmax(0, 1fr); } }
