/* montage.tdlm.tv (C) : l'accueil et l'atelier de montage (maquette v3.1 validée par Victor le 21/11 : Final Cut d'abord,
   navigateur en haut à gauche, visionneurs en haut à droite, inspecteur à la demande, timeline magnétique en bas, rôles
   en couleur). Les jetons et composants d'app.css (.btn, .segmented, .menu, .modal, .empty), le reste en mt-. Aucun
   style en ligne (CSP) : les places calculées passent par le CSSOM. Pas de police du modèle (Degular ne sort jamais au
   web) : les éléments du modèle sont en aperçu simplifié. */

:root { --r-video: rgba(58, 110, 220, 0.30); --r-video-fort: #3a6edc; --r-titre: rgba(150, 92, 220, 0.40); --r-titre-fort: #8f5bd6;
  --r-musique: rgba(52, 170, 90, 0.34); --r-musique-fort: #2f9e57; --r-son: rgba(40, 170, 180, 0.36); --plage: #f5c400; --skim: #ff375f; --tete: #ff3b30; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --r-video: rgba(90, 140, 240, 0.42); --r-titre: rgba(170, 120, 240, 0.45); --r-musique: rgba(60, 190, 100, 0.40); --r-son: rgba(50, 190, 200, 0.42); } }
:root[data-theme="dark"] { --r-video: rgba(90, 140, 240, 0.42); --r-titre: rgba(170, 120, 240, 0.45); --r-musique: rgba(60, 190, 100, 0.40); --r-son: rgba(50, 190, 200, 0.42); }

body { background: var(--bg); }
#app { overflow-y: auto; }
#app > .mt-top { flex: none; }
#app > .mt-page { flex: 1 0 auto; width: 100%; }
.mt-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; min-height: 56px;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.mt-top .spacer, .mt-atelier .spacer { flex: 1; }
.mt-me { width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--avatar-bg); color: var(--avatar-text);
  font: 700 12px/1 var(--font); display: grid; place-items: center; flex: none; }
.mt-me:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-page { max-width: 960px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 18px; }
.mt-vide { margin-top: 12vh; }

/* ---------- L'accueil : les projets, leurs montages ---------- */
.mt-h1 { font-size: 26px; margin: 8px 0 0; }
.mt-projets { display: flex; flex-direction: column; gap: 8px; }
.mt-montages { display: flex; flex-direction: column; gap: 4px; }
.mt-entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.mt-vide p { margin-top: 14px; }
.modal .mt-projets { gap: 0; }
.modal .mt-projet-t { border-bottom: 1px solid var(--line); }
.mt-projet { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mt-projet-t { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px;
  border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.mt-projet-t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mt-projet-t span { color: var(--text-2); font-size: 13px; white-space: nowrap; }
.mt-projet-t .mt-chev { width: 16px; height: 16px; color: var(--text-2); transition: transform 0.15s var(--ease); }
.mt-projet-t[aria-expanded="true"] .mt-chev { transform: rotate(90deg); }
.mt-projet-corps { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.mt-montage-l { align-self: stretch; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.mt-montage-l:hover { background: var(--bg-sunken); text-decoration: none; }
.mt-montage-l b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mt-montage-l span { color: var(--text-2); font-size: 12.5px; }
.mt-nouveau { display: flex; flex-direction: column; gap: 14px; }
.mt-ch { display: flex; flex-direction: column; gap: 6px; }
.mt-ch > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.mt-txt, .mt-select { height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; background: var(--bg); color: var(--text); font-size: 15px; min-width: 0; }
.mt-formats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mt-format { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer; text-align: left; color: var(--text); font-size: 14px; }
.mt-format.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mt-format i { flex: none; border: 2px solid currentColor; border-radius: 3px; }
.mt-format i.v { width: 14px; height: 24px; } .mt-format i.hz { width: 24px; height: 14px; }
.mt-format small { display: block; color: var(--text-2); font-size: 12px; }
.mt-choix-l { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-sunken); font-size: 14px; }
.mt-choix-l small { color: var(--text-2); font-size: 12px; margin-left: auto; }

/* ---------- L'atelier ---------- */
body.mt-atelier-on, body.mt-atelier-on #app { height: 100vh; height: 100dvh; overflow: hidden; }
.mt-racine { height: 100%; }
.mt-atelier { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto minmax(180px, 34vh); min-height: 0; }
.mt-atelier kbd { font: 600 10.5px/1 var(--mono); padding: 2px 4px; border-radius: 4px; background: var(--bg-sunken); color: var(--text-2); border: 1px solid var(--line); }
.mt-icobtn { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; font: 600 17px/1 var(--font); }
.mt-icobtn:hover { background: var(--bg-sunken); }
.mt-icobtn.on { color: var(--accent-text); background: var(--accent-soft); }
.mt-icobtn:focus-visible, .mt-edit:focus-visible, .mt-el:focus-visible, .mt-lire:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* La barre du haut de l'atelier. */
.mt-ab { display: flex; align-items: center; gap: 8px; min-height: 52px; min-width: 0;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.mt-retour { flex: none; min-height: 36px; }
.mt-ab-titre { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.mt-ab-titre b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mt-ab-titre span { color: var(--text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mt-modele { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--bg-sunken); font-size: 12.5px; white-space: nowrap; flex: none; }
.mt-modele i { width: 10px; height: 10px; border-radius: 3px; background: var(--r-titre-fort); }
.mt-etat { font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; min-width: 92px; text-align: right; }
.mt-etat.mal { color: var(--bad-text); }

/* Le haut : navigateur, visionneurs, inspecteur à la demande. */
.mt-ah { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 0; border-bottom: 1px solid var(--line); }
.mt-ah.pan-on { grid-template-columns: 340px minmax(0, 1fr) 320px; }
.mt-ah > .mt-pan { display: none; }
.mt-ah.pan-on > .mt-pan { display: flex; }
.mt-nav, .mt-pan { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--bg-elev); }
.mt-nav { border-right: 1px solid var(--line); }
.mt-pan { border-left: 1px solid var(--line); }
.mt-nav-tete { padding: 10px 12px 6px; }
.mt-onglets { width: 100%; }
.mt-onglets button { flex: 1 1 0; }
.mt-nav-corps { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 16px; }

/* Les rushs : un film par angle, la plage I–O en jaune, survoler prévisualise. */
.mt-rushs { display: flex; flex-direction: column; gap: 2px; }
.mt-rush { padding: 6px 4px 8px; border-radius: 8px; }
.mt-rush.choisi { background: var(--accent-soft); }
.mt-rush-l { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0 2px 5px; min-width: 0; }
.mt-rush-l b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mt-rush-l span { color: var(--text-2); font: 11.5px var(--mono); margin-left: auto; flex: none; }
.mt-film { position: relative; height: 46px; border-radius: 5px; overflow: hidden; background-color: #3a3a3c; background-size: 100% 100%; background-repeat: no-repeat; cursor: pointer; touch-action: none; }
.mt-plage { position: absolute; top: 0; bottom: 0; border: 2px solid var(--plage); border-radius: 4px; background: rgba(245, 196, 0, 0.18); pointer-events: none; }
.mt-skim { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--skim); pointer-events: none; }
.mt-tete-film { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); pointer-events: none; }

/* Le texte (dérushage façon Descript). */
.mt-texte-vue { display: flex; flex-direction: column; min-height: 100%; }
.mt-sel-ligne { position: sticky; top: -4px; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 8px 0; background: var(--bg-elev); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.mt-sel-ligne[hidden] { display: none; }
.mt-sel-txt { min-width: 0; flex: 1; color: var(--text); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-sel-ligne .mt-edit { padding: 0 7px; }
.mt-sel-d { color: var(--text-2); font: 12px var(--mono); }
.mt-texte { padding-top: 6px; }
.mt-para { margin: 0 0 12px; font-size: 14px; line-height: 1.65; color: var(--text-2); }
.mt-qui { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); line-height: 1.4; }
.mt-mot { cursor: pointer; border-radius: 3px; }
.mt-mot:hover { background: var(--bg-sunken); }
.mt-mot.dans { color: var(--text); }
.mt-mot.plage { background: rgba(245, 196, 0, 0.32); color: var(--text); }
.mt-mot.ici { box-shadow: inset 0 -2px 0 var(--skim); }

/* Titres : les éléments du modèle, à glisser. */
.mt-modele-l { display: flex; align-items: baseline; gap: 8px; margin: 6px 2px 2px; font-size: 13px; }
.mt-modele-l span { color: var(--text-2); font-size: 12px; margin-left: auto; }
.mt-groupe-t { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); margin: 12px 2px 6px; }
.mt-grille-t { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mt-el { display: flex; flex-direction: column; gap: 5px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: grab; min-width: 0; }
.mt-el.choisi { box-shadow: 0 0 0 2px var(--accent); }
.mt-el-apercu { position: relative; aspect-ratio: 9 / 12; border-radius: 6px; background: #3a3d44; overflow: hidden; container-type: inline-size; }
.mt-el-apercu.v169 { aspect-ratio: 16 / 10; }
.mt-el-apercu.fin { background: #0a0a0a; }
.mt-el-l { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.mt-el-nom { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mt-el-d { margin-left: auto; color: var(--text-2); font: 11px var(--mono); flex: none; }

/* Médias : les images et vidéos du projet, dossier par dossier (lecture seule), à glisser ou à choisir. */
.mt-medias-vue { display: flex; flex-direction: column; gap: 8px; }
.mt-fil { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; font-size: 12.5px; margin-top: 4px; }
.mt-fil-l { border: 0; background: none; color: var(--accent-text); padding: 4px 4px; border-radius: 6px; cursor: pointer; font: inherit; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-fil-l:last-child { color: var(--text); font-weight: 600; cursor: default; }
.mt-fil-s { color: var(--text-2); }
.mt-medias { display: flex; flex-direction: column; gap: 4px; }
.mt-dossier { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.mt-dossier:hover { background: var(--bg-sunken); }
.mt-dossier span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-grille-m { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.mt-media { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: grab; min-width: 0; }
.mt-media.attente { cursor: default; opacity: 0.55; }
.mt-media:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-m-vign { aspect-ratio: 16 / 10; border-radius: 6px; background-color: #2a2a2c; background-size: contain; background-repeat: no-repeat; background-position: center; }
.mt-m-vign.son { display: grid; place-items: center; background: var(--r-musique); color: var(--r-musique-fort); }
.mt-m-vign.son .ico { width: 28px; height: 28px; }
.mt-m-vign.alpha { background-color: #d1d1d6; } /* une image avec transparence : sur un fond clair plein (sans damier en dégradé : charte) */
.mt-media-nom { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-media-k { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.mt-choix-media { min-height: 320px; max-height: 60vh; overflow-y: auto; }
.mt-choix-media .mt-grille-m { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* Les visionneurs : sur du noir ; les rushs dans leur format, le montage dans le sien. */
.mt-visus { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-width: 0; min-height: 0; }
.mt-vis { position: relative; background: #0b0b0c; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; min-height: 0; min-width: 0; }
.mt-vis + .mt-vis { border-left: 1px solid #222; }
.mt-vis.actif { box-shadow: inset 0 2px 0 var(--plage); } /* le visionneur où vont espace, J K L, I et O : un trait sur toute sa largeur */
.mt-vis-tete { display: flex; align-items: center; gap: 8px; color: #c7c7cc; font-size: 12px; min-height: 26px; }
.mt-visu-choix { display: none; }
.mt-vis-nom { font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; color: #8e8e93; }
.mt-vis-tete b { color: #f5f5f7; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mt-vis .segmented { background: rgba(255, 255, 255, 0.1); }
.mt-vis .segmented button { color: #c7c7cc; padding: 3px 9px; font-size: 12px; }
.mt-vis .segmented button.active { background: rgba(255, 255, 255, 0.22); color: #fff; box-shadow: none; }
.mt-cadre { position: relative; isolation: isolate; overflow: hidden; border-radius: 4px; background: #000; container-type: inline-size; }
.mt-vis-src .mt-cadre { flex: 1 1 auto; min-height: 0; }
.mt-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.mt-vide-v { z-index: 100; position: absolute; inset: 0; display: grid; place-items: center; color: #8e8e93; font-size: 13px; text-align: center; padding: 10%; }
.mt-vide-v:empty, .mt-vide-v[hidden] { display: none; }
.mt-scene { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; }
.mt-sur { position: absolute; z-index: 5; pointer-events: none; overflow: visible; }
.mt-calques, .mt-habillage { position: absolute; inset: 0; }
.mt-couche { position: absolute; left: 0; right: 0; overflow: hidden; }
.mt-couche.bas { border-top: 2px solid var(--m-accent, #d90b10); }
.mt-video-prog { position: absolute; display: block; max-width: none; }
.mt-habillage { pointer-events: none; }
/* Une image posée (incrustation, affiche) : à sa place, choisie au clic ; choisie, son cadre et ses poignées. */
.mt-visuel { position: absolute; transform-origin: 50% 50%; cursor: pointer; touch-action: none; }
.mt-visuel-img { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.mt-visuel.sel { cursor: move; }
.mt-tr { position: absolute; transform-origin: 50% 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); pointer-events: none; box-sizing: border-box; }
.mt-tr[hidden] { display: none; }
.mt-tr-c, .mt-tr-rot { position: absolute; width: 12px; height: 12px; background: #fff; border: 1px solid rgba(0, 0, 0, 0.55); pointer-events: auto; }
.mt-tr-c.hg { left: -7px; top: -7px; cursor: nwse-resize; } .mt-tr-c.hd { right: -7px; top: -7px; cursor: nesw-resize; }
.mt-tr-c.bg { left: -7px; bottom: -7px; cursor: nesw-resize; } .mt-tr-c.bd { right: -7px; bottom: -7px; cursor: nwse-resize; }
.mt-tr-rot { left: 50%; top: -30px; margin-left: -6px; border-radius: 50%; cursor: grab; }
.mt-tr-rot::after { content: ""; position: absolute; left: 50%; top: 11px; width: 1px; height: 18px; background: #fff; }
/* Les sous-titres (ceux de l'app, styles .st-* d'app.css) au-dessus de tout, comme au rendu ; la mesure des titres, invisible. */
.mt-st { position: absolute; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.mt-mesure { visibility: hidden; z-index: -1; }
.mt-st-bascule { flex: none; height: 26px; padding: 0 10px; border: 0; border-radius: 13px; background: rgba(255, 255, 255, 0.1); color: #c7c7cc; font: 500 12px/1 var(--font); cursor: pointer; }
.mt-st-bascule.on { background: rgba(255, 255, 255, 0.24); color: #fff; }
.mt-st-bascule:disabled { opacity: 0.45; cursor: default; }
.mt-st-bascule:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-st-bloc { position: absolute; display: flex; align-items: center; padding: 0 5px; border-radius: 4px; background: #5c5c63; color: #fff; font-size: 10.5px; overflow: hidden; white-space: nowrap; cursor: pointer; box-sizing: border-box; }
.mt-st-bloc span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mt-st-bloc.alerte { box-shadow: inset 0 0 0 1.5px #f5a623; }
.mt-simplifie { z-index: 100; position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.55); color: #d1d1d6; font-size: 10.5px; }
.mt-lecteur { display: flex; align-items: center; gap: 10px; color: #f5f5f7; min-width: 0; }
.mt-lire { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.mt-barre-src { position: relative; flex: 1; height: 22px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); min-width: 0; cursor: pointer; touch-action: none; }
.mt-barre-src .mt-plage { border-radius: 3px; }
.mt-tete-src { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.mt-tc-l { font: 12px var(--mono); color: #c7c7cc; white-space: nowrap; }
.mt-io { display: flex; align-items: center; gap: 12px; min-height: 18px; font: 11.5px var(--mono); color: #c7c7cc; white-space: nowrap; overflow: hidden; }
.mt-io b { color: var(--plage); font-weight: 700; }
.mt-io-aide { font-family: var(--font); color: #8e8e93; }

/* Les éléments du modèle, en aperçu simplifié (habillage.js) : leur place est celle du modèle. */
.mt-m { position: absolute; display: flex; flex-direction: column; gap: 0.6cqw; font-family: var(--font); }
.mt-m.ancre-centre { transform: translate(-50%, -50%); align-items: center; }
.mt-m.ancre-bas-gauche { transform: translateY(-100%); align-items: flex-start; }
.mt-m.ancre-haut-gauche { align-items: flex-start; }
.mt-m.ancre-haut-droite { transform: translateX(-100%); align-items: flex-end; }
.mt-m-bloc { background: var(--m-fond); color: var(--m-blanc); font: italic 600 6.4cqw/1.12 var(--font); padding: 0.8cqw 2.4cqw 1.1cqw; border-radius: 1.2cqw; white-space: nowrap; }
.mt-m-bloc.acc { background: var(--m-blanc); color: var(--m-noir); }
.mt-m-l1 { display: flex; align-items: center; gap: 0.8cqw; }
.mt-m-boite { background: var(--m-accent); color: var(--m-blanc); font: italic 600 5.4cqw/1.15 var(--font); padding: 0.5cqw 2cqw 0.8cqw; border-radius: 1.2cqw; white-space: nowrap; }
.mt-m-lieu .mt-m-boite { font-size: 3.9cqw; }
.mt-m-chev { color: var(--m-accent); font: 700 8cqw/0.8 var(--font); text-shadow: 0 0 2px rgba(255, 255, 255, 0.6); }
.mt-m-lieu .mt-m-chev { font-size: 5.6cqw; }
.mt-m-sous { color: var(--m-blanc); font: italic 500 4cqw/1.2 var(--font); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); padding-left: 0.6cqw; }
.mt-m-logo { padding: 1cqw 2cqw; border-radius: 1cqw; background: var(--m-accent); color: var(--m-blanc); font: 700 3.6cqw/1.2 var(--font); }
.mt-m-carton_fin { inset: 0; left: 0 !important; top: 0 !important; transform: none; justify-content: center; align-items: center; background: #0a0a0a; padding: 0 12%; }
.mt-m-fin-txt { color: #fff; font: 600 5cqw/1.25 var(--font); text-align: center; }
.mt-m-ecran_partage { inset: 0; left: 0 !important; top: 0 !important; transform: none; gap: 0; }
.mt-m-moitie { flex: 1; background: rgba(255, 255, 255, 0.12); }
.mt-m-moitie + .mt-m-moitie { border-top: 2px solid var(--m-accent); }
.mt-m-image { padding: 6cqw 9cqw; border-radius: 2cqw; background: #fff; color: #444; font: 600 4cqw/1.2 var(--font); box-shadow: 0 1cqw 4cqw rgba(0, 0, 0, 0.45); }

/* L'inspecteur. */
.mt-pan-tete { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.mt-pan-tete b { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-role { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--bg-sunken); }
.mt-role.r-video { background: var(--r-video-fort); } .mt-role.r-titre { background: var(--r-titre-fort); } .mt-role.r-musique { background: var(--r-musique-fort); }
.mt-pan-corps { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; }
.mt-rg { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; min-height: 46px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mt-rg:last-child { border-bottom: 0; }
.mt-k { color: var(--text-2); font-size: 13px; }
.mt-obl { color: var(--bad-text); }
.mt-rg-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-rg-v.mono { font: 12.5px var(--mono); }
.mt-rg .mt-seg { grid-column: 2 / -1; width: 100%; }
.mt-seg button { flex: 1 1 0; min-width: 0; padding: 5px 4px; font-size: 12.5px; }
.mt-rg-champ { grid-template-columns: minmax(0, 1fr) auto; }
.mt-rg-champ .mt-k { grid-column: 1; }
.mt-rg-champ .mt-champ { grid-column: 1 / -1; grid-row: 2; }
.mt-rg-champ .mt-compte { grid-column: 2; grid-row: 1; }
.mt-champ { width: 100%; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; background: var(--bg); color: var(--text); font: 14px var(--font); resize: vertical; }
.mt-champ:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mt-compte { font: 11.5px var(--mono); color: var(--text-2); }
.mt-compte.trop { color: var(--warn-text); font-weight: 700; }
.mt-range { width: 100%; accent-color: var(--accent); margin: 0; }
.mt-rg-num { grid-template-columns: 96px minmax(0, 96px) auto; }
.mt-num { min-width: 0; text-align: right; padding: 4px 8px; font: 13px var(--mono); }
.mt-unite { color: var(--text-2); font-size: 12.5px; }
.mt-note-m { font-size: 12.5px; color: var(--text-2); margin: 10px 0 0; font-style: italic; }
.mt-interr { position: relative; width: 38px; height: 28px; flex: none; cursor: pointer; border: 0; background: none; padding: 0; }
.mt-interr::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 22px; margin-top: -11px; border-radius: 11px; background: var(--bg-sunken); border: 1px solid var(--line-strong); box-sizing: border-box; }
.mt-interr::after { content: ""; position: absolute; top: 50%; margin-top: -8px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.mt-interr.on::before { background: var(--accent); border-color: var(--accent); }
.mt-interr.on::after { left: 19px; background: var(--on-accent); }

/* La barre d'outils : connecter, insérer, ajouter ; couper ; le timecode au centre ; annuler et zoom. */
.mt-ob { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: 46px; min-width: 0;
  padding: 4px max(16px, env(safe-area-inset-right, 0px)) 4px max(16px, env(safe-area-inset-left, 0px)); background: var(--bg-elev); border-bottom: 1px solid var(--line); }
.mt-ob-g, .mt-ob-d { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mt-ob-d { justify-content: flex-end; }
.mt-edits { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--bg-sunken); flex: none; }
.mt-edit { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border: 0; border-radius: 7px; background: none; color: var(--text); cursor: pointer; font: 500 12.5px/1 var(--font); }
.mt-edit:hover { background: var(--bg-elev); }
.mt-edit kbd { background: transparent !important; }
.mt-tc-central { font: 600 17px/1 var(--mono); letter-spacing: 0.02em; color: var(--text); padding: 6px 12px; border-radius: 8px; background: var(--bg-sunken); white-space: nowrap; }
.mt-tc-central small { font-size: 12px; color: var(--text-2); font-weight: 500; }

/* La timeline magnétique. */
.mt-tl-zone { position: relative; min-height: 0; min-width: 0; background: var(--bg); display: flex; }
.mt-tl-defile { flex: 1; overflow: auto; position: relative; scrollbar-width: thin; }
.mt-tl { position: relative; min-height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.mt-regle { position: sticky; top: 0; z-index: 5; height: 24px; border-bottom: 1px solid var(--line); background: var(--bg-elev); cursor: pointer; }
.mt-gr { position: absolute; top: 0; height: 24px; padding: 6px 0 0 4px; font: 10.5px/1 var(--mono); color: var(--text-2); border-left: 1px solid var(--line); pointer-events: none; }
.mt-pistes { position: absolute; inset: 0; }
.mt-lane { position: absolute; left: 0; right: 0; border-radius: 0; background: transparent; }
.mt-lane.haut { box-shadow: inset 0 -1px 0 var(--line); }
.mt-lane-p { background: var(--bg-sunken); }
.mt-tl-vide { position: absolute; left: 8px; right: 8px; display: flex; align-items: center; justify-content: center; border: 1.5px dashed var(--line-strong); border-radius: 8px; color: var(--text-2); font-size: 13.5px; pointer-events: none; }
.mt-clip { position: absolute; border-radius: 5px; overflow: hidden; font-size: 11px; line-height: 1.2; color: var(--text); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14); cursor: pointer; }
.mt-clip .mt-nom { position: absolute; left: 4px; top: 3px; max-width: calc(100% - 8px); padding: 1px 4px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 10.5px; }
.mt-p { background: var(--r-video); }
.mt-p .mt-nom { background: rgba(28, 28, 30, 0.72); color: #fff; }
.mt-fs { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; overflow: hidden; pointer-events: none; }
.mt-fs i { flex: 1 0 0; min-width: 0; height: 100%; background-color: #3a3a3c; background-size: 1000% 100%; background-repeat: no-repeat; box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25); }
/* Le son d'un plan : sous son image, à ses bornes (J et L : sous l'image voisine) ; ⌥ + glisser le bout. */
.mt-son { position: absolute; border-radius: 0 0 5px 5px; background: var(--r-video); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); cursor: pointer; }
.mt-son::before { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 1px; background: rgba(20, 40, 90, 0.35); }
.mt-son.regle::before { background: var(--r-video-fort); height: 2px; }
.mt-son.sel { box-shadow: inset 0 0 0 2px var(--plage); }
.mt-son::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 10px; cursor: ew-resize; }
.mt-p .mt-fs.haut { bottom: 50%; } .mt-p .mt-fs.bas { top: 50%; }
.mt-p.g-partage::before { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 1px); height: 2px; background: var(--r-video-fort); z-index: 1; pointer-events: none; } /* le trait du 50/50 (sans dégradé : charte) */
.mt-k { color: var(--text); }
.mt-k .mt-nom { top: 50%; transform: translateY(-50%); }
.mt-k.r-titre { background: var(--r-titre); }
.mt-k.r-broll, .mt-k.r-illustration { background: var(--r-video); }
.mt-k.r-broll .mt-fs { opacity: 0.75; }
.mt-k.r-musique { background: var(--r-musique); }
/* Un son : sa ligne de volume (glisser), ses fondus en rampe et leurs poignées. */
.mt-vol { position: absolute; left: 0; right: 0; height: 9px; margin-top: -4px; cursor: ns-resize; z-index: 2; }
.mt-vol::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1.5px; background: var(--r-musique-fort); }
.mt-vol-cles { position: absolute; left: 0; top: 0; overflow: visible; z-index: 2; pointer-events: none; }
.mt-vol-l { fill: none; stroke: var(--r-musique-fort); stroke-width: 1.5; }
.mt-vol-prise { fill: none; stroke: transparent; stroke-width: 9; pointer-events: stroke; cursor: ns-resize; }
.mt-rampe { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.mt-rampe.g { left: 0; background: rgba(0, 0, 0, 0.22); clip-path: polygon(0 0, 100% 0, 0 100%); } /* fondu d'entrée : un triangle plein (charte) */
.mt-rampe.d { right: 0; background: rgba(0, 0, 0, 0.22); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.mt-fondu { position: absolute; top: 1px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--bg-elev); box-shadow: 0 0 0 1.5px var(--r-musique-fort); cursor: ew-resize; z-index: 3; }
.mt-fondu.d { margin-left: 0; margin-right: -4.5px; }
.mt-k.r-son { background: var(--r-son); }
.mt-clip.sel { box-shadow: inset 0 0 0 2px var(--plage); z-index: 3; }
.mt-poignee { position: absolute; top: 0; bottom: 0; width: 8px; background: var(--plage); z-index: 4; cursor: ew-resize; }
.mt-poignee::after { content: ""; position: absolute; top: 50%; left: 3px; width: 2px; height: 14px; margin-top: -7px; border-radius: 1px; background: #1c1c1e; }
.mt-poignee.g { left: 0; } .mt-poignee.d { right: 0; }
.mt-bulle { position: absolute; z-index: 7; transform: translateX(-50%); padding: 4px 8px; border-radius: 6px; background: var(--text); color: var(--bg); font: 600 11.5px/1.2 var(--mono); white-space: nowrap; pointer-events: none; }
.mt-repere-depot { position: absolute; z-index: 6; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; }
.mt-tl-tete { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--tete); z-index: 6; pointer-events: none; }
.mt-tl-tete::before { content: ""; position: sticky; top: 0; display: block; margin-left: -5px; width: 12px; height: 10px; background: var(--tete); clip-path: polygon(0 0, 100% 0, 50% 100%); }

/* Téléphone : pas d'atelier. */
.mt-tel-msg { display: none; }
@media (max-width: 699px) {
  .mt-atelier > :not(.mt-tel-msg) { display: none !important; }
  .mt-atelier { display: grid; place-items: center; grid-template-rows: minmax(0, 1fr); }
  .mt-tel-msg { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
  .mt-tel-msg .ico { width: 48px; height: 48px; color: var(--text-2); }
  .mt-tel-msg h1 { font-size: 22px; margin: 0; }
  .mt-tel-msg p { margin: 0; color: var(--text-2); }
}
/* Petites fenêtres et iPad : un visionneur à la fois (celui où l'on travaille), le navigateur plus étroit. */
@media (max-width: 1359px) {
  .mt-ah { grid-template-columns: 300px minmax(0, 1fr); }
  .mt-ah.pan-on { grid-template-columns: 300px minmax(0, 1fr) 300px; }
  .mt-visus { grid-template-columns: minmax(0, 1fr); }
  .mt-visus[data-un="src"] > .mt-vis-prog, .mt-visus[data-un="tl"] > .mt-vis-src { display: none; }
  .mt-vis .mt-visu-choix { display: inline-flex; }
  .mt-visus .mt-vis-nom { display: none; }
  .mt-vis.actif { box-shadow: none; }
}
@media (min-width: 1800px) {
  .mt-ah { grid-template-columns: 400px minmax(0, 1fr); }
  .mt-ah.pan-on { grid-template-columns: 400px minmax(0, 1fr) 340px; }
}
/* Au doigt (iPad) : 44 px partout. */
@media (hover: none), (pointer: coarse) {
  .mt-me, .mt-icobtn { width: 44px; height: 44px; }
  .mt-st-bascule { height: 44px; border-radius: 22px; padding: 0 14px; }
  .mt-retour { min-height: 44px; }
  .mt-edit { height: 44px; min-width: 44px; justify-content: center; }
  .mt-lire { width: 44px; height: 44px; }
  .mt-barre-src { height: 44px; }
  .mt-onglets button, .mt-vis .segmented button, .mt-seg button { min-height: 44px; }
  .mt-champ { min-height: 44px; font-size: 16px; }
  .mt-range { height: 44px; }
  .mt-dossier { min-height: 44px; }
  .mt-fil-l { min-height: 44px; min-width: 44px; }
  .mt-tr-c, .mt-tr-rot { width: 24px; height: 24px; }
  .mt-tr-c.hg { left: -13px; top: -13px; } .mt-tr-c.hd { right: -13px; top: -13px; } .mt-tr-c.bg { left: -13px; bottom: -13px; } .mt-tr-c.bd { right: -13px; bottom: -13px; }
  .mt-tr-rot { top: -40px; margin-left: -12px; }
  .mt-interr { width: 51px; height: 44px; }
  .mt-ob { min-height: 56px; }
  .mt-poignee { width: 14px; }
  .mt-fondu { width: 22px; height: 22px; margin-left: -11px; top: 2px; } .mt-fondu.d { margin-right: -11px; }
  .mt-vol { height: 20px; margin-top: -10px; } .mt-vol::before { top: 9px; }
  .mt-vol-prise { stroke-width: 20; }
  .mt-txt, .mt-select { height: 44px; font-size: 16px; }
  .mt-montage-l, .mt-projet-t { min-height: 44px; }
}
