/* ==========================================================================
   Montage libre (éditeur façon CapCut) — public/js/views/montage.js
   Éditeur plein écran, toujours sombre (les couleurs de la vidéo restent lisibles).
   ========================================================================== */

/* ---------- Liste ---------- */
.mt-liste-tete { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.mt-liste-tete p { margin: 0; flex: 1; min-width: 220px; }
.mt-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.mt-carte { display: flex; flex-direction: column; background: var(--carte); border: 1px solid var(--bord); border-radius: var(--radius);
  overflow: hidden; color: inherit; text-decoration: none; box-shadow: var(--ombre); transition: transform .15s; }
.mt-carte:hover { transform: translateY(-2px); }
.mt-carte-img { position: relative; aspect-ratio: 9 / 16; background: #15131c; display: flex; align-items: center; justify-content: center; font-size: 40px; max-height: 260px; }
.mt-carte-img img { width: 100%; height: 100%; object-fit: cover; }
.mt-duree { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 8px; }
.mt-carte-corps { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.mt-carte-titre { font-weight: 700; }

/* ---------- Éditeur ---------- */
body.mt-open { overflow: hidden; }
.mt-ed {
  --mt-fond: #121117; --mt-panneau: #1c1b24; --mt-panneau-2: #24232e; --mt-bord: #33313f; --mt-texte: #ece9f5; --mt-texte-2: #9b98ad;
  --mt-accent: #FF5436; --mt-jaune: #FFC933; --mt-lilas: #C8B8FF;
  position: fixed; inset: 0; z-index: 1000; background: var(--mt-fond); color: var(--mt-texte);
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); font-size: 14px;
}
/* Rangées explicites : le bandeau masqué ([hidden]) ne décale pas la grille */
.mt-top { grid-row: 1; }
.mt-bandeau { grid-row: 2; }
.mt-corps { grid-row: 3; }
.mt-timeline { grid-row: 4; }
/* Colonne bornée à l'écran : une timeline longue défile au lieu d'élargir tout l'éditeur */
.mt-ed > * { min-width: 0; }
.mt-ed .muted { color: var(--mt-texte-2); }
.mt-ed .small { font-size: 12px; }
.mt-ed .err-txt { color: #ff8a73; }
.mt-ed h3 { margin: 0 0 6px; font-size: 16px; }
.mt-ed h4 { margin: 16px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mt-texte-2); }
.mt-ed .btn { background: var(--mt-panneau-2); color: var(--mt-texte); border-color: var(--mt-bord); }
.mt-ed .btn:hover { border-color: #55526a; }
.mt-ed .btn-primary { background: var(--mt-accent); border-color: var(--mt-accent); color: #fff; }
.mt-ed .btn-danger { background: transparent; color: #ff8a73; border-color: #6b3a33; }
.mt-ed .progress { background: var(--mt-bord); height: 6px; margin: 4px 0 2px; }
.mt-ed .progress span { background: var(--mt-jaune); }
.mt-btn-ic { background: transparent; border: 1px solid transparent; color: var(--mt-texte); font-size: 18px; min-width: 34px; height: 34px;
  border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 0 6px; }
.mt-btn-ic:hover { background: var(--mt-panneau-2); }
.mt-btn-ic:disabled { opacity: .35; cursor: default; }
.mt-btn-ic.petit { font-size: 13px; min-width: 28px; height: 28px; }
.mt-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mt-texte-2); cursor: pointer; }

.mt-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--mt-bord); background: var(--mt-panneau); }
.mt-titre { background: transparent; border: 1px solid transparent; color: var(--mt-texte); font-size: 16px; font-weight: 700; padding: 6px 8px;
  border-radius: 8px; min-width: 120px; width: 30ch; max-width: 40vw; font-family: inherit; }
.mt-titre:hover, .mt-titre:focus { border-color: var(--mt-bord); outline: none; background: var(--mt-fond); }
.mt-bandeau { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #2b2347; border-bottom: 1px solid #4a3d7a; flex-wrap: wrap; }

.mt-corps { display: grid; grid-template-columns: 290px minmax(0, 1fr) 320px; min-height: 0; }
.mt-gauche, .mt-droite { background: var(--mt-panneau); min-height: 0; overflow-y: auto; }
.mt-gauche { border-right: 1px solid var(--mt-bord); display: flex; flex-direction: column; }
.mt-droite { border-left: 1px solid var(--mt-bord); padding: 12px 14px 20px; }

/* Champs du panneau (reprend .slide-form de l'app, en sombre) */
.mt-ed .slide-form label { color: var(--mt-texte-2); }
.mt-ed .slide-form input, .mt-ed .slide-form select, .mt-ed .slide-form textarea {
  background: var(--mt-fond); color: var(--mt-texte); border-color: var(--mt-bord); padding: 7px 9px; font-size: 14px; border-radius: 8px; }
.mt-ed .slide-form input[type=range] { padding: 0; border: 0; background: transparent; accent-color: var(--mt-accent); }
.mt-ed .slide-form input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--mt-accent); }
.mt-ed .slide-form label.check { flex-direction: row; color: var(--mt-texte); }
.mt-ed .row-2 { gap: 4px 10px; grid-template-columns: 1fr 1fr; }
.mt-range { display: grid; grid-template-columns: 1fr 74px; gap: 8px; align-items: center; }
.mt-boutons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mt-couleurs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.mt-couleurs button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--mt-bord); cursor: pointer; padding: 0; }
.mt-couleurs button.on { outline: 3px solid var(--mt-jaune); outline-offset: 1px; }
.mt-ed .mt-couleurs input[type=color] { width: 34px; height: 28px; padding: 0 2px; }
.mt-rendu { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--mt-bord); }
.mt-rendu a { color: var(--mt-jaune); }

/* Colonne médias */
.mt-onglets { display: flex; border-bottom: 1px solid var(--mt-bord); position: sticky; top: 0; background: var(--mt-panneau); z-index: 1; }
.mt-onglets button { flex: 1; background: transparent; border: 0; color: var(--mt-texte-2); padding: 11px 6px; cursor: pointer; font: inherit; font-weight: 600; border-bottom: 2px solid transparent; }
.mt-onglets button.on { color: var(--mt-texte); border-bottom-color: var(--mt-accent); }
.mt-medias { padding: 10px 12px 20px; }
.mt-medias-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.mt-rush { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; background: var(--mt-panneau-2); margin-top: 8px; }
.mt-rush-img { width: 44px; height: 70px; border-radius: 6px; background: #000; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.mt-rush-img img { width: 100%; height: 100%; object-fit: cover; }
.mt-rush .grow { min-width: 0; }
.mt-rush-nom { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-rush-act { display: flex; flex-direction: column; gap: 2px; }
.mt-rush-act [data-ajout-rush] { background: var(--mt-accent); color: #fff; font-size: 20px; }
.mt-rush-act [data-ajout-rush]:disabled { background: var(--mt-bord); }
.mt-ajouts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mt-ajout { background: var(--mt-panneau-2); border: 1px solid var(--mt-bord); color: var(--mt-texte); border-radius: 10px; padding: 10px 8px;
  cursor: pointer; font-size: 15px; text-align: center; min-height: 46px; }
.mt-ajout:hover { border-color: var(--mt-accent); }
.mt-ajout-titre { font-family: 'Caveat Brush', cursive; font-size: 22px; color: var(--mt-accent); -webkit-text-stroke: 3px #fff; paint-order: stroke fill; }
.mt-ajout-impact { font-family: 'Luckiest Guy', Impact, sans-serif; color: var(--mt-jaune); -webkit-text-stroke: 2px #1D1747; paint-order: stroke fill; font-size: 17px; }
.mt-ajout-marqueur { font-family: 'Permanent Marker', cursive; }
.mt-ajout-etiquette { font-family: 'Caveat Brush', cursive; font-size: 20px; color: #1D1747; background: var(--mt-jaune); border: 3px solid #1D1747; box-shadow: 0 4px 0 #1D1747; }
.mt-ajout-bulle { font-family: 'Rubik', sans-serif; font-weight: 700; color: #1D1747; background: #fff; border-radius: 22px; border: 3px solid #1D1747; }
.mt-ajout-sous_titre { font-family: 'Rubik', sans-serif; font-weight: 800; text-shadow: 0 0 3px #1D1747, 0 0 3px #1D1747, 0 0 3px #1D1747; }
.mt-ajout-simple { font-family: 'Rubik', sans-serif; font-weight: 700; }
.mt-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.mt-image { position: relative; aspect-ratio: 1; border-radius: 8px; cursor: pointer; overflow: hidden;
  background: repeating-conic-gradient(#2c2b36 0 25%, #23222c 0 50%) 0 0 / 16px 16px; border: 1px solid var(--mt-bord); }
.mt-image:hover { border-color: var(--mt-accent); }
.mt-image img { width: 100%; height: 100%; object-fit: contain; }
.mt-image-suppr { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; display: none; }
.mt-image:hover .mt-image-suppr { display: block; }
.mt-depot { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.mt-depot-item { display: flex; gap: 10px; align-items: center; text-align: left; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 6px; cursor: pointer; color: inherit; font: inherit; }
.mt-depot-item img, .mt-depot-item > span:first-child { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }

/* Scène */
.mt-centre { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
.mt-scene-zone { min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; overflow: hidden; }
.mt-scene-cadre { position: relative; flex-shrink: 0; box-shadow: 0 10px 40px rgba(0,0,0,.5); border-radius: 6px; overflow: hidden; background: #000; }
.mt-scene { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; transform-origin: 0 0; overflow: hidden; background: #000; touch-action: none; user-select: none; }
/* z-index 0 : les rushs (z-index 1, 2…) restent SOUS les calques même sans zoom caméra (transform: none) */
.mt-cam { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; transform-origin: 0 0; z-index: 0; }
.mt-cam video { pointer-events: none; }
.mt-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.mt-noir { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.mt-calques { position: absolute; inset: 0; }
.mt-calques > div, .mt-calques > svg path[data-calque] { cursor: move; }
.mt-zones { position: absolute; inset: 0; pointer-events: none; }
.mt-zones div { position: absolute; background: rgba(255, 84, 54, .22); border: 3px dashed rgba(255, 255, 255, .55); box-sizing: border-box; }
.mt-zones span { position: absolute; color: #fff; font: 600 30px sans-serif; text-shadow: 0 2px 6px #000; }
.mt-ui { position: absolute; inset: 0; pointer-events: none; }
.mt-boite { position: absolute; border: var(--b, 2px) solid var(--mt-jaune); box-sizing: border-box; pointer-events: none; transform-origin: 50% 50%; }
.mt-boite-zoom { border-style: dashed; pointer-events: auto; cursor: move; background: rgba(255, 201, 51, .06); }
.mt-boite-zoom span { position: absolute; left: 8px; top: 6px; color: var(--mt-jaune); font-weight: 700; text-shadow: 0 1px 4px #000; }
.mt-p { position: absolute; border-radius: 50%; background: #fff; border-style: solid; border-color: #1D1747; box-sizing: border-box; pointer-events: auto; cursor: pointer; box-shadow: 0 0 0 2px rgba(255, 201, 51, .9); }
.mt-p-rot { background: var(--mt-jaune); cursor: grab; }
.mt-p-courbe { background: var(--mt-lilas); }
.mt-guide { position: absolute; background: var(--mt-lilas); pointer-events: none; }

.mt-transport { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 10px; border-top: 1px solid var(--mt-bord); flex-wrap: wrap; }
.mt-play { background: var(--mt-texte); color: var(--mt-fond); border-radius: 50%; width: 40px; height: 40px; font-size: 16px; margin: 0 4px; }
.mt-play:hover { background: #fff; }
.mt-temps { font-variant-numeric: tabular-nums; margin: 0 12px; min-width: 130px; text-align: center; color: var(--mt-texte-2); }

/* Timeline */
.mt-timeline { border-top: 1px solid var(--mt-bord); background: var(--mt-panneau); display: flex; flex-direction: column; height: clamp(230px, 33vh, 340px); }
/* Poignée de hauteur (tirer vers le haut pour voir plus de pistes) */
.mt-tl-poignee { height: 10px; margin-top: -1px; cursor: ns-resize; touch-action: none; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mt-tl-poignee i { width: 46px; height: 4px; border-radius: 2px; background: var(--mt-bord); }
.mt-tl-poignee:hover i { background: var(--mt-texte-2); }
.mt-tl.mt-pan, .mt-tl.mt-pan * { cursor: grabbing !important; }
.mt-tl-outils { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--mt-bord); flex-wrap: wrap; }
.mt-tl-outils input[type=range] { width: 140px; accent-color: var(--mt-accent); }
.mt-tl-scroll { flex: 1; overflow: auto; position: relative; }
/* margin-left : le curseur à 0:00 reste loin du bord, facile à attraper */
.mt-tl { position: relative; min-height: 100%; padding-bottom: 10px; margin-left: 16px; user-select: none; touch-action: none; }
/* z-index 5 : au-dessus des blocs et de leurs losanges quand on fait défiler les pistes */
.mt-regle { position: sticky; top: 0; height: 24px; background: var(--mt-panneau); border-bottom: 1px solid var(--mt-bord); z-index: 5; cursor: pointer; }
.mt-regle span { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--mt-bord); font-size: 10.5px; color: var(--mt-texte-2); padding: 5px 0 0 4px; font-variant-numeric: tabular-nums; }
.mt-pistes { padding-top: 4px; }
.mt-piste { position: relative; border-bottom: 1px dashed rgba(255,255,255,.05); }
.mt-bloc { position: absolute; top: 3px; bottom: 3px; border-radius: 7px; background: #3b3654; border: 1px solid #5a5380; color: #fff; font-size: 12px;
  display: flex; align-items: center; overflow: hidden; cursor: grab; box-sizing: border-box; }
.mt-bloc span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; pointer-events: none; }
.mt-bloc-texte { background: #6b3a8a; border-color: #8d55b3; }
.mt-bloc-fleche, .mt-bloc-cercle { background: #1d6b62; border-color: #2EC4A6; }
.mt-bloc-image { background: #8a5a1f; border-color: #FFC933; }
.mt-bloc-pastille { background: #8a3a2a; border-color: #FF5436; }
.mt-bloc-zoom { background: #283d70; border-color: #6d8ee0; }
.mt-bloc-secousse, .mt-bloc-flou, .mt-bloc-rythme { background: #213a5a; border-color: #7fb2ff; border-style: dashed; }
.mt-bloc.sel, .mt-clip.sel { outline: 2px solid #fff; outline-offset: 0; z-index: 2; }
.mt-bord { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; z-index: 1; }
.mt-bord.g { left: 0; }
.mt-bord.d { right: 0; }
.mt-bloc.sel .mt-bord, .mt-clip.sel .mt-bord { background: rgba(255,255,255,.85); }
.mt-bloc.sel .mt-bord.g, .mt-clip.sel .mt-bord.g { border-radius: 6px 0 0 6px; }
.mt-bloc.sel .mt-bord.d, .mt-clip.sel .mt-bord.d { border-radius: 0 6px 6px 0; }
.mt-piste-video { position: relative; margin-top: 4px; border-top: 1px solid var(--mt-bord); padding-top: 4px; }
.mt-vide { position: absolute; left: 12px; top: 26px; color: var(--mt-texte-2); font-size: 13px; }
.mt-clip { position: absolute; top: 4px; height: 66px; border-radius: 8px; background: #2b2a35; border: 1px solid #4b4960; overflow: hidden; cursor: grab; box-sizing: border-box; }
.mt-clip.deplace { opacity: .8; z-index: 5; box-shadow: 0 6px 18px rgba(0,0,0,.6); }
.mt-vign { position: absolute; left: 0; top: 0; height: 50px; right: 0; overflow: hidden; pointer-events: none; }
.mt-vign i { position: absolute; top: 0; height: 50px; background-repeat: no-repeat; }
.mt-onde { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background-color: #1c3d38; background-repeat: no-repeat; opacity: .9; pointer-events: none; filter: sepia(1) hue-rotate(110deg) saturate(3); }
.mt-clip-nom { position: absolute; left: 6px; top: 4px; font-size: 11px; background: rgba(0,0,0,.6); padding: 1px 6px; border-radius: 5px; pointer-events: none; max-width: calc(100% - 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-trans { position: absolute; top: 24px; width: 22px; height: 22px; margin-left: -11px; border-radius: 6px; border: 1px solid var(--mt-bord); background: var(--mt-panneau-2);
  color: var(--mt-texte-2); font-size: 12px; z-index: 3; cursor: pointer; padding: 0; line-height: 1; }
.mt-trans.on { background: var(--mt-lilas); color: #1D1747; border-color: #fff; }
.mt-fin { position: absolute; top: 24px; bottom: 0; width: 0; border-left: 2px dashed rgba(255,255,255,.25); pointer-events: none; }
.mt-tete { position: absolute; top: 0; bottom: 0; left: 0; width: 0; z-index: 6; pointer-events: none; }
.mt-tete::before { content: ''; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--mt-accent); }
.mt-tete i { position: absolute; left: -7px; top: 0; width: 14px; height: 14px; background: var(--mt-accent); border-radius: 3px 3px 50% 50%; }
.mt-video-finale { width: 100%; max-height: 70vh; background: #000; border-radius: 10px; }

/* Écrans étroits : scène + timeline en haut, panneaux en dessous (défilement) */
@media (max-width: 1100px) {
  .mt-corps { grid-template-columns: 240px minmax(0, 1fr) 280px; }
}
@media (max-width: 860px) {
  .mt-ed { display: flex; flex-direction: column; overflow-y: auto; }
  .mt-corps { display: contents; }
  /* Chaque bloc garde sa hauteur naturelle : sinon la colonne flex les écrase à la hauteur de l'écran
     et leur contenu déborde sur le bloc suivant (textes superposés sur tablette et téléphone) */
  .mt-ed > *, .mt-corps > * { flex-shrink: 0; }
  .mt-top { order: 1; flex-wrap: wrap; }
  .mt-bandeau { order: 2; }
  .mt-centre { order: 3; height: 56vh; flex-shrink: 0; }
  .mt-timeline { order: 4; height: 230px; flex-shrink: 0; }
  .mt-droite { order: 5; border-left: 0; border-top: 1px solid var(--mt-bord); overflow: visible; }
  .mt-gauche { order: 6; border-right: 0; border-top: 1px solid var(--mt-bord); overflow: visible; }
  .mt-titre { width: 14ch; }
  .mt-top .btn { padding: 8px 10px; font-size: 13px; }
}
/* Téléphone : outils de la timeline sur une seule ligne qui défile, pour laisser la place aux pistes */
@media (max-width: 600px) {
  .mt-timeline { height: 290px; }
  .mt-tl-outils { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .mt-tl-outils::-webkit-scrollbar { display: none; }
  .mt-tl-outils > * { flex-shrink: 0; white-space: nowrap; }
  .mt-tl-outils .grow { flex: 0 0 4px; }
  .mt-tl-outils input[type=range] { width: 110px; }
}

/* ---------- Repères pour Claude ---------- */
.mt-ed .mt-btn-repere { border-color: var(--mt-lilas); color: var(--mt-lilas); }
.mt-rep-rangee { position: sticky; top: 24px; height: 22px; background: var(--mt-fond); border-bottom: 1px solid var(--mt-bord); z-index: 5; }
.mt-rep { position: absolute; top: 2px; transform: translateX(-1px); min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
  background: var(--mt-lilas); color: #1D1747; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
  border-radius: 0 9px 9px 0; cursor: grab; z-index: 2; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.mt-rep.vide { background: transparent; color: var(--mt-lilas); border: 2px dashed var(--mt-lilas); line-height: 14px; }
.mt-rep.fait { background: #2EC4A6; }
.mt-rep.sel { outline: 2px solid #fff; outline-offset: 1px; }
.mt-rep-plage { position: absolute; top: 0; bottom: 0; background: rgba(200, 184, 255, .22); border-bottom: 3px solid var(--mt-lilas); pointer-events: none; }
.mt-rep-plage.sel { background: rgba(200, 184, 255, .38); }
.mt-rep-ligne { position: absolute; top: 46px; bottom: 0; width: 0; border-left: 1px dashed rgba(200, 184, 255, .55); pointer-events: none; z-index: 1; }
.mt-rep-ligne.sel { border-left: 2px solid var(--mt-lilas); }
.mt-cible { position: absolute; border-radius: 50%; border-style: solid; border-color: var(--mt-lilas); box-sizing: border-box; pointer-events: auto; cursor: move;
  background: rgba(200, 184, 255, .25); box-shadow: 0 0 0 9999px rgba(0,0,0,0), 0 0 12px rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; }
.mt-cible b { color: #fff; text-shadow: 0 1px 4px #000; }
.mt-scene.mt-visee { cursor: crosshair; outline: 3px dashed var(--mt-lilas); outline-offset: -3px; }
.mt-rep-liste { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 10px; }
.mt-rep-liste button { display: grid; grid-template-columns: 24px 52px minmax(0, 1fr); gap: 6px; align-items: center; text-align: left; font: inherit; font-size: 13px;
  background: var(--mt-panneau-2); color: var(--mt-texte); border: 1px solid var(--mt-bord); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.mt-rep-liste button:hover { border-color: var(--mt-lilas); }
.mt-rep-liste b { background: var(--mt-lilas); color: #1D1747; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.mt-rep-liste .fait b { background: #2EC4A6; }
.mt-rep-liste span { color: var(--mt-texte-2); font-variant-numeric: tabular-nums; }
.mt-rep-liste em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-rep-reponse { margin: 12px 0 4px; padding: 8px 10px; border-radius: 8px; background: #2b2347; border: 1px solid #4a3d7a; font-size: 13px; }

/* Arrêts sur image : bloc hachuré dans le clip (durée = bord droit) */
.mt-gel { position: absolute; top: 0; bottom: 0; box-sizing: border-box; cursor: pointer; z-index: 1; font-style: normal;
  background: repeating-linear-gradient(135deg, rgba(255,201,51,.55) 0 6px, rgba(29,23,71,.55) 6px 12px); border: 1px solid #FFC933; border-radius: 4px; }
.mt-gel span { position: absolute; left: 4px; bottom: 3px; font-size: 10px; font-weight: 700; color: #1D1747; background: #FFC933; padding: 0 4px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.mt-gel.sel { outline: 2px solid #fff; z-index: 3; }
.mt-gel .mt-bord.d { position: absolute; right: -2px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; background: rgba(255,201,51,.9); border-radius: 0 4px 4px 0; }
.mt-btn-figer { margin-left: 6px; }

/* Rendus : machine choisie, estimations par machine */
.mt-estimations { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 10px; }
.mt-estimation { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid transparent; }
.mt-estimation.choisie { border-color: #2EC4A6; }
.mt-estimation em { grid-column: 1 / -1; font-style: normal; }
.mt-rendu-machine { display: block; width: 100%; }

/* Tout décaler : cadenas des calques, orphelins */
.mt-cadenas { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 400; cursor: pointer; opacity: .45; z-index: 2; }
.mt-cadenas:hover, .mt-cadenas.on { opacity: 1; }
.mt-bloc span { padding-right: 18px; }
.mt-btn-orph { background: #5a2a1a; color: #FFC933; border-color: #FF5436; }
.mt-orph { display: flex; gap: 6px; align-items: center; padding: 4px 0; }
.mt-orph span { flex: 1; }
.mt-vitesses .btn { min-width: 44px; }

/* Images clés : losanges du panneau et de la timeline, trajectoire, menu des courbes */
.mt-droite label:has(> .mt-cle-btn) { position: relative; padding-right: 22px; }
.mt-cle-btn { position: absolute; right: 0; top: 0; border: 0; background: none; color: #8a87a3; font-size: 15px; line-height: 1; padding: 2px; cursor: pointer; }
.mt-cle-btn.contour { color: #FFC933; }
.mt-cle-btn.plein { color: #FFC933; text-shadow: 0 0 6px rgba(255,201,51,.6); }
.mt-losange { position: absolute; top: 50%; width: 9px; height: 9px; margin: -5px 0 0 -5px; background: #FFC933; border: 1.5px solid #1D1747; transform: rotate(45deg); z-index: 3; cursor: ew-resize; }
.mt-losange.sel { background: #fff; box-shadow: 0 0 0 2px #FFC933; }
.mt-losange-clip { top: auto; bottom: 20px; }
.mt-traj { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.mt-menu-courbe { position: fixed; z-index: 1000; background: #23212e; border: 1px solid #4b4960; border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 210px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.mt-menu-courbe b { font-size: 11px; color: #8a87a3; padding: 2px 6px 4px; font-weight: 600; }
.mt-menu-courbe button { text-align: left; background: none; border: 0; color: #eee; padding: 5px 8px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.mt-menu-courbe button:hover, .mt-menu-courbe button.on { background: #3a3850; color: #FFC933; }

/* Bruitages : sons d'apparition / de disparition des éléments, banque de sons */
.mt-son-ligne { display: flex; gap: 6px; align-items: flex-end; }
.mt-son-ligne label { flex: 1; }
.mt-son { border: 1px solid var(--mt-bord); border-radius: 10px; padding: 6px 10px; margin: 6px 0; }
.mt-son.on { border-color: #4a3d7a; background: rgba(200, 184, 255, .06); }
.mt-son .mt-son-ligne select { flex: 1; min-width: 0; }
.mt-banque { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; max-height: 60vh; overflow-y: auto; }
.mt-banque-famille h4 { margin: 10px 0 4px; }
.mt-banque-son { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 2px 0; }
.mt-banque-son [data-jouer] { flex: 1; text-align: left; }

/* Bibliothèque intégrée : catégories et vignettes */
.mt-bibli-cats { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.mt-bibli-cats button { background: var(--mt-panneau-2); color: var(--mt-texte-2); border: 1px solid var(--mt-bord); border-radius: 14px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.mt-bibli-cats button.on { background: var(--mt-accent); border-color: var(--mt-accent); color: #fff; }
.mt-bibli .mt-image { background: repeating-conic-gradient(#3a4654 0 25%, #33404d 0 50%) 0 0 / 16px 16px; }
.mt-bibli .mt-image img { padding: 6px; box-sizing: border-box; }

/* Voix off : prompteur (jamais rendu), barre d'enregistrement, pistes audio de la timeline */
.mt-scene-zone { position: relative; }
.mt-prompteur { position: absolute; inset: 0; z-index: 5; background: rgba(10, 9, 16, .62); overflow: hidden; pointer-events: none; }
.mt-prompteur-texte { position: absolute; left: 8%; right: 8%; top: 38%; color: #fff; font-weight: 700; line-height: 1.35; white-space: pre-wrap;
  text-shadow: 0 2px 6px #000; will-change: transform; }
.mt-prompteur-ligne { position: absolute; left: 0; right: 0; top: 38%; height: 0; border-top: 2px dashed rgba(255, 201, 51, .7); }
.mt-rec { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 6; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px;
  background: rgba(20, 18, 28, .92); border: 1px solid #6b3a33; border-radius: 12px; padding: 6px 10px; max-width: calc(100% - 20px); }
.mt-rec-temps { color: #ff6a55; font-weight: 800; font-variant-numeric: tabular-nums; }
.mt-rec-vit { display: inline-flex; align-items: center; gap: 4px; color: var(--mt-texte-2); font-size: 12px; }
.mt-rec-vit b { min-width: 26px; text-align: center; color: var(--mt-texte); }
.mt-rec-dit { flex-basis: 100%; text-align: center; font-style: italic; max-height: 2.6em; overflow: hidden; }
.mt-ed.mt-enregistre .mt-timeline, .mt-ed.mt-enregistre .mt-droite, .mt-ed.mt-enregistre .mt-gauche, .mt-ed.mt-enregistre .mt-transport, .mt-ed.mt-enregistre .mt-top { pointer-events: none; opacity: .55; }
.mt-ed .mt-btn-voix { border-color: #ff8a73; color: #ff8a73; }
.mt-piste-audio { position: relative; margin-top: 3px; }
.mt-audio { position: absolute; top: 2px; bottom: 2px; border-radius: 7px; border: 1px solid; box-sizing: border-box; overflow: hidden; cursor: grab; color: #fff; font-size: 12px; display: flex; align-items: center; }
.mt-audio-voix { background: #6b2c3e; border-color: #ff8a9e; }
.mt-audio-musique { background: #1f4d63; border-color: #6cc4ea; }
.mt-audio.manquant { background: repeating-linear-gradient(135deg, #4a2323 0 6px, #2b1818 6px 12px); }
.mt-audio.sel { outline: 2px solid #fff; z-index: 2; }
.mt-audio > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; pointer-events: none; position: relative; z-index: 1; text-shadow: 0 1px 2px #000; }
.mt-audio.sel .mt-bord { background: rgba(255,255,255,.85); }
.mt-mot { position: absolute; bottom: 0; font-size: 9.5px; font-style: normal; color: rgba(255,255,255,.75); white-space: nowrap; pointer-events: none; border-left: 1px solid rgba(255,255,255,.35); padding-left: 2px; line-height: 11px; }
.mt-transcription { display: flex; flex-direction: column; gap: 3px; max-height: 260px; overflow-y: auto; margin: 4px 0; }
.mt-transcription button { text-align: left; background: var(--mt-panneau-2); color: var(--mt-texte); border: 1px solid var(--mt-bord); border-radius: 7px; padding: 5px 8px; font: inherit; font-size: 13px; cursor: pointer; }
.mt-transcription button span { color: var(--mt-texte-2); font-variant-numeric: tabular-nums; margin-right: 8px; font-size: 12px; }
.mt-corr { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.mt-corr label { display: grid; grid-template-columns: 60px 1fr; gap: 8px; align-items: center; }

/* Modèles */
.mt-modeles { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.mt-modele { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--mt-panneau-2); border: 1px solid var(--mt-bord); }
.mt-modele span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mt-modele em { font-style: normal; }
/* Préréglages d'animation */
.mt-presets .btn { font-size: 12px; padding: 4px 8px; }
.mt-bloc.multi { outline: 2px dashed var(--mt-lilas); outline-offset: 0; z-index: 2; }
.mt-bloc.multi.sel { outline: 2px solid #fff; }
/* Couverture */
.mt-couv { position: absolute; top: 1px; transform: translateX(-50%); font-size: 13px; cursor: pointer; z-index: 3; filter: drop-shadow(0 1px 2px #000); }
.mt-couv-img { display: block; width: 120px; border-radius: 8px; margin: 6px 0; border: 1px solid var(--mt-bord); }

/* ---------- Analyses des médias (transcription, dérushage, suivi, amélioration, détourage) ---------- */
.mt-badges { display: flex; gap: 4px; font-size: 13px; margin-top: 2px; }
.mt-analyse { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 6px; margin-top: 4px; }
.mt-analyse .progress { grid-column: 1 / -1; }
.mt-analyse.erreur .small { color: #ff8a73; }
.mt-analyse.termine .progress span { background: #2EC4A6; }
.modal .mt-analyse .progress { background: var(--bord); height: 6px; border-radius: 3px; overflow: hidden; }
.modal .mt-analyse .progress span { display: block; height: 100%; background: var(--terracotta); }
.modal .mt-analyse .mt-btn-ic { background: none; border: 0; cursor: pointer; }
/* Outils d'un rush (modale) */
.mt-outils { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mt-outils .btn { text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.mt-outils .btn small { font-weight: 400; opacity: .7; font-size: 12px; }
/* Dérushage (modale) */
.mt-derush-video { width: 100%; max-height: 32vh; background: #000; border-radius: 10px; margin: 6px 0; }
.mt-derush-video[hidden] { display: none; }
.mt-derush-liste { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; margin: 8px 0; }
.modal label.mt-derush { display: grid; grid-template-columns: auto auto 1fr auto; grid-template-areas: "cb type temps ecoute" "cb texte texte ecoute"; gap: 2px 8px;
  align-items: center; margin: 0; padding: 7px 9px; border: 1.5px solid var(--bord); border-radius: 10px; font-weight: 400; opacity: .55; cursor: pointer; }
.modal label.mt-derush.on { opacity: 1; border-color: var(--terracotta); }
.mt-derush input { grid-area: cb; width: 18px; height: 18px; }
.mt-derush-type { grid-area: type; font-size: 12px; padding: 1px 7px; border-radius: 8px; background: #eee; color: #333; white-space: nowrap; }
.mt-derush .muted { grid-area: temps; }
.mt-derush em { grid-area: texte; font-style: normal; font-size: 13px; color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-derush .btn { grid-area: ecoute; }
.mt-derush-silence, .mt-derush-debut, .mt-derush-fin { background: #e6eefc; }
.mt-derush-hesitation { background: #fff1c4; }
.mt-derush-reprise { background: #ffd8cf; }
.mt-derush-repetition { background: #eadcff; }
/* Karaoké (modale : styles ; panneau : mots) */
.mt-k-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mt-k-style { display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center; min-height: 68px; border-radius: 12px; border: 3px solid transparent;
  background: #2b2a35; color: #fff; cursor: pointer; padding: 8px; text-align: center; }
.mt-k-style.on { border-color: var(--terracotta, #FF5436); }
.mt-k-style span { font-size: 19px; }
.mt-k-style small { font-size: 11px; opacity: .75; }
.mt-k-tiktok span { font-family: 'Rubik', sans-serif; font-weight: 900; text-transform: uppercase; text-shadow: 0 0 3px #1D1747, 0 0 3px #1D1747; color: #FFC933; }
.mt-k-hormozi span { font-family: 'Luckiest Guy', Impact, sans-serif; color: #2EC4A6; -webkit-text-stroke: 1.5px #1D1747; paint-order: stroke fill; }
.mt-k-surligne span { font-family: 'Rubik', sans-serif; font-weight: 800; background: #FF5436; border-radius: 6px; padding: 0 6px; }
.mt-k-bulle { background: #fff; color: #1D1747; border-color: #1D1747; }
.mt-k-bulle.on { border-color: #FF5436; }
.mt-k-bulle span { font-family: 'Rubik', sans-serif; font-weight: 700; color: #FF5436; }
.mt-k-marqueur span { font-family: 'Permanent Marker', cursive; color: #FFC933; }
.mt-k-discret span { font-family: 'Rubik', sans-serif; font-weight: 700; opacity: .9; }
.mt-ajout-karaoke { font-family: 'Rubik', sans-serif; font-weight: 900; text-transform: uppercase; color: var(--mt-jaune); text-shadow: 0 0 3px #1D1747, 0 0 3px #1D1747; }
.mt-k-mots { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.mt-k-mots button { background: var(--mt-panneau-2); color: var(--mt-texte); border: 1px solid var(--mt-bord); border-radius: 8px; padding: 3px 8px; font: inherit; font-size: 13px; cursor: pointer; }
.mt-k-mots button.cle { border-color: var(--mt-accent); color: var(--mt-accent); font-weight: 700; }
/* Rythme : temps de la musique sur la piste */
.mt-temps-m { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .35); pointer-events: none; }
.mt-temps-m.fort { width: 2px; background: rgba(255, 201, 51, .9); }
/* Suivi : cadre de l'objet à suivre */
.mt-visee-boite { border-style: dashed; border-color: var(--mt-jaune); background: rgba(255, 201, 51, .1); pointer-events: auto; cursor: move; }
.mt-visee-boite span { position: absolute; left: 6px; top: 4px; color: var(--mt-jaune); font-weight: 700; text-shadow: 0 1px 4px #000; white-space: nowrap; }
/* Cadre du format d'export (4:5, 1:1) */
.mt-format { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.mt-format-haut, .mt-format-bas { position: absolute; left: 0; width: 1080px; background: rgba(10, 9, 16, .62); }
.mt-format-haut { top: 0; border-bottom: 4px dashed rgba(255, 201, 51, .9); }
.mt-format-bas { border-top: 4px dashed rgba(255, 201, 51, .9); }
.mt-format span { position: absolute; left: 24px; color: #FFC933; font: 700 34px sans-serif; text-shadow: 0 2px 6px #000; }
/* Avant / après de l'étalonnage */
.mt-comparer { position: absolute; left: 540px; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: #fff; z-index: 6; pointer-events: none; box-shadow: 0 0 8px rgba(0,0,0,.6); }
.mt-comparer span { position: absolute; top: 40px; font: 700 36px sans-serif; color: #fff; text-shadow: 0 2px 6px #000; white-space: nowrap; }
.mt-comparer span:first-child { right: 24px; }
.mt-comparer span:last-child { left: 24px; }

/* ---------- Aperçu plein écran (tablette, téléphone) ---------- */
.mt-geste, .mt-plein-ui { display: none; }
.mt-ed.mt-plein { grid-template-rows: minmax(0, 1fr); }
.mt-ed.mt-plein .mt-top, .mt-ed.mt-plein .mt-bandeau, .mt-ed.mt-plein .mt-gauche, .mt-ed.mt-plein .mt-droite, .mt-ed.mt-plein .mt-timeline,
.mt-ed.mt-plein .mt-transport { display: none; }
.mt-ed.mt-plein .mt-corps { grid-row: 1; grid-template-columns: minmax(0, 1fr); background: #000; }
.mt-ed.mt-plein .mt-centre { grid-template-rows: minmax(0, 1fr); }
.mt-ed.mt-plein .mt-scene-zone { padding: 0; }
.mt-ed.mt-plein .mt-scene-cadre { border-radius: 0; box-shadow: none; }
.mt-ed.mt-plein .mt-geste { display: block; position: absolute; inset: 0; z-index: 7; touch-action: none; cursor: pointer; }
.mt-ed.mt-plein .mt-plein-ui { display: flex; align-items: center; gap: 10px; position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 8;
  background: rgba(10, 9, 16, .6); border-radius: 12px; padding: 6px 10px; color: #fff; font-variant-numeric: tabular-nums; pointer-events: auto; }
.mt-plein-barre { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); overflow: hidden; }
.mt-plein-barre i { display: block; height: 100%; width: 0; background: var(--mt-accent); }
@media (max-width: 860px) {
  .mt-ed.mt-plein { overflow: hidden; }
  .mt-ed.mt-plein .mt-centre { height: 100dvh; }
}

/* Reel rapide (lot 7) : assistant en 4 étapes, carte « Le Reel » d'une publication, file de rendus */
.rr-etapes { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 12px; font-size: 12.5px; }
.rr-etapes li { flex: 1; text-align: center; padding: 6px 4px; border-radius: 8px; background: var(--sable); color: var(--encre-2); font-weight: 700; }
.rr-etapes li.on { background: var(--terracotta); color: #fff; }
.rr-etapes li.fait { background: color-mix(in srgb, var(--terracotta) 22%, var(--carte)); color: var(--encre); }
.rr-corps { max-height: 60vh; overflow-y: auto; }
.rr-h { font-size: 14px; margin: 12px 0 6px; }
.rr-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.rr-tuile { position: relative; display: flex; flex-direction: column; padding: 0; border: 2px solid var(--bord); border-radius: 10px; overflow: hidden; background: var(--carte); cursor: pointer; font: inherit; color: inherit; }
.rr-tuile img, .rr-sans-img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 26px; background: var(--sable); }
.rr-tuile small { font-size: 11px; padding: 3px 4px; color: var(--encre-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-tuile.on { border-color: var(--terracotta); box-shadow: 0 0 0 2px color-mix(in srgb, var(--terracotta) 35%, transparent); }
.rr-tuile:disabled { opacity: .5; cursor: not-allowed; }
.rr-num { position: absolute; top: 4px; left: 4px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--terracotta); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.rr-recap { margin: 0 0 10px; padding-left: 22px; }
.rr-reel { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--bord); }
.rr-reel-img { width: 72px; flex-shrink: 0; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: var(--sable); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.rr-reel-img img { width: 100%; height: 100%; object-fit: cover; }
.rr-reel .title a { color: inherit; text-decoration: none; }
.rr-barre { height: 5px; background: var(--sable); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.rr-barre span { display: block; height: 100%; background: var(--terracotta); }
.an-bulle { display: grid; grid-template-columns: 1fr 84px 84px; gap: 6px; margin-bottom: 6px; }
