/* ==========================================================================
   PLINK — page « Transcrire une vidéo en texte » (transcription.html)
   S'appuie sur tokens.css et plink.css (carte, champs, boutons, FAQ, fenêtre publicitaire).
   ========================================================================== */

/* ---------- Source : un lien ou un fichier ---------- */
.tr-source [role="radio"] { min-height: 44px; }
.tr-source [role="radio"] .tr-src-l { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/20px var(--font); color: inherit; }
.tr-source [role="radio"][aria-checked="true"] .tr-src-l { color: #fff; }
.tr-src-l svg { width: 18px; height: 18px; flex: none; }

/* ---------- Dépôt d'un fichier ---------- */
.tr-drop { display: grid; justify-items: center; gap: 6px; padding: 28px 20px; border: 1.5px dashed var(--field); border-radius: var(--r-card); background: var(--surface); text-align: center; cursor: pointer; transition: border-color var(--t-hover) var(--ease), background-color var(--t-hover) var(--ease); }
.tr-drop:hover, .tr-drop.is-over { border-color: var(--plink-blue); background: var(--select); }
.tr-drop:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.tr-drop-ico { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 4px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); color: var(--accent-text); }
.tr-drop-ico svg { width: 24px; height: 24px; }
.tr-drop strong { font-size: 15px; line-height: 22px; font-weight: 600; }
.tr-souligne { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.tr-drop-sub { color: var(--text-2); font-size: 13px; line-height: 18px; }
.tr-choisi { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 10px 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctrl); background: var(--bg); animation: appear var(--t-in) var(--ease); }
.tr-choisi-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--select); color: var(--accent-text); }
.tr-choisi-ico svg { width: 20px; height: 20px; }
.tr-choisi-txt { display: grid; min-width: 0; font-size: 14px; line-height: 20px; }
.tr-choisi-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-choisi-txt span { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.tr-choisi .icon-btn svg { width: 18px; height: 18px; }

/* ---------- Interrupteur « Afficher les temps » (même hauteur qu'un champ) ---------- */
.tr-switch { position: relative; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border: 1px solid var(--field); border-radius: var(--r-ctrl); background: var(--bg); font-size: 16px; cursor: pointer; user-select: none; }
.tr-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tr-piste { position: relative; flex: none; width: 40px; height: 24px; border-radius: var(--r-pill); background: var(--line); transition: background-color var(--t-state) var(--ease); }
.tr-piste::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(17, 19, 24, .25); transition: transform var(--t-state) var(--ease); }
.tr-switch input:checked + .tr-piste { background: var(--plink-blue); }
.tr-switch input:checked + .tr-piste::after { transform: translateX(16px); }
.tr-switch:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }

.convert-card form > .tr-limite { margin-top: -4px; }

/* Aperçu d'un lien sans miniature (SoundCloud, X…) */
.link-preview .result.sans-miniature { grid-template-columns: minmax(0, 1fr); }

/* ---------- Progression ---------- */
.tr-progres { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg); animation: appear var(--t-in) var(--ease); }
.tr-progres-titre { display: grid; gap: 2px; min-width: 0; }
.tr-progres-titre strong { font-size: 16px; line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-progres-titre span { color: var(--text-2); font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; }
.tr-phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tr-phases li { display: grid; align-content: start; gap: 8px; color: var(--text-2); font-size: 13px; line-height: 18px; font-weight: 600; }
.tr-phases li::before { content: ""; height: 4px; border-radius: var(--r-pill); background: var(--line); transition: background-color var(--t-state) var(--ease); }
.tr-phases li.is-fait::before { background: var(--plink-blue); }
.tr-phases li.is-en-cours { color: var(--text); }
.tr-phases li.is-en-cours::before { background: linear-gradient(90deg, var(--plink-blue) var(--p, 35%), var(--line) var(--p, 35%)); }
.tr-progres .status { padding: 0; background: none; font-weight: 600; }
.tr-progres .status [data-pct] { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Lecteur du texte ---------- */
.tr-card.is-resultat > form { display: none; }
.tr-card, .tr-lecteur { scroll-margin-top: 96px; }
.tr-lecteur { display: grid; gap: 16px; min-width: 0; animation: appear var(--t-in) var(--ease); }
.tr-entete { display: grid; gap: 6px; min-width: 0; }
.tr-pret { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: 14px; line-height: 20px; font-weight: 600; }
.tr-pret svg { width: 18px; height: 18px; }
.tr-titre { font-size: 22px; line-height: 30px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.tr-faits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 6px 0 0; }
.tr-faits > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-ctrl); background: var(--surface); min-width: 0; }
.tr-faits dt { color: var(--text-2); font-size: 12px; line-height: 16px; }
.tr-faits dd { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-faits dd::first-letter { text-transform: uppercase; }
.tr-lecteur > .upsell { margin-top: 0; }

.tr-media { border-radius: var(--r-ctrl); overflow: hidden; background: #000; }
.tr-media video { display: block; width: 100%; max-height: 300px; background: #000; }
.tr-media audio { display: block; width: 100%; }
.tr-media.is-audio { background: none; }

.tr-barre { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tr-recherche { position: relative; flex: 1 1 220px; min-width: 0; display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 6px 0 40px; border: 1px solid var(--field); border-radius: var(--r-ctrl); background: var(--bg); }
.tr-recherche:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.tr-recherche > svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--text-2); pointer-events: none; }
.tr-recherche input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 400 15px var(--font); }
.tr-recherche input::placeholder { color: var(--text-2); }
.tr-recherche input::-webkit-search-cancel-button { cursor: pointer; }
.tr-compte { flex: none; color: var(--text-2); font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-compte:empty { display: none; }
.tr-nav { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; }
.tr-nav:hover { background: var(--surface); }
.tr-nav svg { width: 18px; height: 18px; }
.tr-actions { display: flex; gap: 8px; flex: none; }
.tr-actions .btn { min-height: 44px; padding: 0 14px; }
.tr-actions .btn svg { width: 18px; height: 18px; }
.tr-dl { display: flex; }
.tr-dl .btn { border-radius: 0; margin-left: -1px; }
.tr-dl .btn:first-child { border-radius: var(--r-ctrl) 0 0 var(--r-ctrl); margin-left: 0; }
.tr-dl .btn:last-child { border-radius: 0 var(--r-ctrl) var(--r-ctrl) 0; }
.tr-dl .btn:hover, .tr-dl .btn:focus-visible { position: relative; z-index: 1; }

.tr-cadre { position: relative; min-width: 0; }
.tr-texte { max-height: min(62vh, 560px); overflow: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg); font-size: 16px; line-height: 27px; scroll-padding: 48px 0; }
.tr-texte:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tr-seg { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; margin: 0; padding: 6px 8px; border-radius: 10px; transition: background-color var(--t-state) var(--ease); }
.tr-seg:hover { background: var(--surface); }
.tr-seg.is-actif { background: var(--select); }
.tr-t { align-self: start; display: inline-flex; justify-content: center; margin-top: 2px; padding: 1px 0; border: 0; border-radius: 6px; background: none; color: var(--accent-text); font: 600 13px/22px var(--font); font-variant-numeric: tabular-nums; text-decoration: none; cursor: pointer; }
.tr-t:hover { background: var(--select); }
.tr-s { min-width: 0; overflow-wrap: anywhere; }
.tr-par { margin: 0; padding: 8px 10px; overflow-wrap: anywhere; }
.tr-par + .tr-par { padding-top: 4px; }
.tr-texte mark { padding: 0 1px; border-radius: 3px; background: rgba(0, 87, 255, .16); color: inherit; }
.tr-texte mark.is-courant { background: var(--plink-blue); color: #fff; }
:root[data-theme="dark"] .tr-texte mark { background: rgba(130, 170, 255, .26); }
:root:not([data-theme="light"]) .tr-texte mark { background: rgba(130, 170, 255, .26); }

/* Offre Gratuit : aperçu des premières lignes, la suite après les publicités */
.tr-cadre.is-verrou .tr-texte { max-height: none; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%); mask-image: linear-gradient(180deg, #000 45%, transparent 100%); }
.tr-verrou { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; max-width: 460px; margin: -72px auto 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-raised); box-shadow: var(--shadow); text-align: center; }
.tr-verrou-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--select); color: var(--accent-text); }
.tr-verrou-ico svg { width: 20px; height: 20px; }
.tr-verrou strong { font-size: 16px; line-height: 24px; }
.tr-verrou p { color: var(--text-2); font-size: 14px; line-height: 20px; }
.tr-verrou .btn { margin-top: 6px; }

.tr-pied { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.tr-astuce { color: var(--text-2); font-size: 13px; line-height: 18px; }
.tr-pied .btn { margin-left: auto; }

/* ---------- Pour aller plus loin : Clips IA et Pro ---------- */
.tr-offres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; animation: appear var(--t-in) var(--ease); }
.tr-offres.une-seule { grid-template-columns: minmax(0, 1fr); }
.tr-offre { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-raised); color: var(--text); text-decoration: none; transition: border-color var(--t-hover) var(--ease), transform var(--t-hover) var(--ease); }
.tr-offre:hover { border-color: var(--plink-blue); }
.tr-offre-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--select); color: var(--accent-text); }
.tr-offre-ico svg { width: 20px; height: 20px; }
.tr-offre-txt { display: grid; gap: 4px; }
.tr-offre-txt strong { font-size: 16px; line-height: 24px; }
.tr-offre-txt span { color: var(--text-2); font-size: 14px; line-height: 20px; }
.tr-offre-cta { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-size: 14px; line-height: 20px; font-weight: 600; }
.tr-offre-cta svg { width: 16px; height: 16px; transition: transform var(--t-hover) var(--ease); }
.tr-offre:hover .tr-offre-cta svg { transform: translateX(3px); }

/* ---------- Contenu sous l'outil ---------- */
.tr-etapes-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.tr-etapes-guide li { display: grid; gap: 10px; align-content: start; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg); }
.tr-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--plink-blue); color: #fff; font-size: 14px; font-weight: 700; }
.tr-etapes-guide h3 { font-size: 18px; line-height: 26px; }
.tr-etapes-guide p { color: var(--text-2); font-size: 15px; line-height: 24px; }

.tr-plateformes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 820px; margin: 0 auto; padding: 0; list-style: none; }
.tr-plateformes .platform { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--bg); font-size: 15px; line-height: 22px; }
.tr-plateformes .platform svg { width: 20px; height: 20px; }

.tr-usages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tr-usages article { display: grid; gap: 10px; align-content: start; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg); }
.tr-usage-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--select); color: var(--accent-text); }
.tr-usage-ico svg { width: 22px; height: 22px; }
.tr-usages h3 { font-size: 18px; line-height: 26px; }
.tr-usages p { color: var(--text-2); font-size: 15px; line-height: 24px; }

/* ---------- Petits écrans ---------- */
@media (max-width: 1023px) {
  .tr-usages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-etapes-guide { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin-inline: auto; }
}
@media (max-width: 639px) {
  .tr-faits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-faits > div { padding: 8px 12px; }
  .tr-offres { grid-template-columns: minmax(0, 1fr); }
  .tr-barre { display: grid; grid-template-columns: minmax(0, 1fr); }
  .tr-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .tr-dl .btn { flex: 1; padding: 0 8px; }
  .tr-dl .btn svg { display: none; }
  .tr-seg { grid-template-columns: 52px minmax(0, 1fr); gap: 6px; padding: 6px 4px; }
  .tr-texte { padding: 6px; font-size: 15px; line-height: 25px; max-height: 64vh; }
  .tr-drop { padding: 22px 16px; }
  .tr-card .row-2 { gap: 12px; }
  #tr-temps-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tr-switch { height: 52px; }
  .tr-usages { grid-template-columns: minmax(0, 1fr); }
  .tr-etapes-guide li, .tr-usages article { padding: 20px; }
  .tr-verrou { margin-top: -56px; padding: 18px 16px; }
  .tr-pied .btn { width: 100%; }
  .tr-plateformes .platform { padding: 8px 14px 8px 12px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .tr-lecteur, .tr-progres, .tr-offres, .tr-choisi { animation: none; }
  .tr-texte { scroll-behavior: auto; }
}
