/* =====================================================================
   STYLE.CSS — Apparence de l'outil
   Les couleurs et tailles principales sont regroupées ici (:root),
   pour pouvoir les changer à un seul endroit.
   ===================================================================== */

:root {
  --fond: #f4f2ee;
  --papier: #ffffff;
  --encre: #1c1b19;
  --encre-douce: #6b675f;
  --ligne: #dedad2;
  --ligne-forte: #c4bfb4;
  --accent: #c2410c;          /* orange « claquette » */
  --accent-doux: #fde7d9;
  --surligne: #fff1a8;        /* passages déjà découpés */
  --surligne-actif: #ffc94d;  /* passage du plan survolé */
  --sequence: #2a2925;
  --danger: #b42318;
  --rayon: 6px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --police-scenario: "Courier Prime", "Courier New", Courier, monospace;

  /* Largeurs des colonnes (mode complet) */
  --l-num: 92px;
  --l-extrait: 190px;
  --l-texte: 220px;
  --l-photo: 225px;           /* photo en 16:9 → 127 px de haut */
  --l-menu: 160px;
  --l-duree: 80px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--police);
  font-size: 14px;
  color: var(--encre);
  background: var(--fond);
  display: flex;
  flex-direction: column;
}
button { font: inherit; color: inherit; }

/* ---------- Barre du haut ---------- */
.barre {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 14px;
  background: var(--sequence); color: #f4f2ee;
  flex-wrap: wrap;
}
.barre-gauche, .barre-droite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo { color: var(--accent); font-size: 20px; }
.titre-film { font-weight: 800; font-size: 20px; letter-spacing: .12em; margin-right: 10px; }
/* Champs numéro avec légende au-dessus */
.meta-num { display: flex; flex-direction: column; gap: 1px; }
.meta-num span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #9a958b; }
.meta-num input {
  width: 64px; font: inherit; font-weight: 700; font-size: 15px; color: inherit;
  background: #34322d; border: 1px solid #4d4a43; border-radius: 4px; padding: 2px 6px;
}
.meta-num input:focus { outline: none; border-color: var(--accent); }
.meta-nom input { width: 180px; font-weight: 600; font-size: 14px; }
.total { font-variant-numeric: tabular-nums; color: #cfcac0; padding: 0 6px; }
.etat { font-size: 12px; color: #9a958b; min-width: 90px; }

.btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: #3a3833; border: 1px solid #4d4a43; color: #f4f2ee;
  padding: 5px 10px; border-radius: var(--rayon); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #46433d; }
.btn.principal { background: var(--accent); border-color: var(--accent); }
.groupe-btn { display: inline-flex; }
.groupe-btn .btn { border-radius: 0; }
.groupe-btn .btn:first-child { border-radius: var(--rayon) 0 0 var(--rayon); }
.groupe-btn .btn:last-child { border-radius: 0 var(--rayon) var(--rayon) 0; border-left: none; }
.groupe-btn .btn.actif { background: var(--accent); border-color: var(--accent); }

.menu-deroulant { position: relative; }
.popover {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  background: var(--papier); color: var(--encre);
  border: 1px solid var(--ligne-forte); border-radius: var(--rayon);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 6px; min-width: 230px;
  display: flex; flex-direction: column;
}
.popover[hidden] { display: none; }
.popover button { text-align: left; background: none; border: none; padding: 7px 10px; border-radius: 4px; cursor: pointer; }
.popover button:hover { background: var(--fond); }
.popover hr { border: none; border-top: 1px solid var(--ligne); margin: 4px 0; }
.popover label { display: flex; gap: 8px; align-items: center; padding: 5px 8px; cursor: pointer; }
.popover .danger { color: var(--danger); }

/* ---------- Disposition générale ---------- */
.espace { flex: 1; display: flex; min-height: 0; }

/* ---------- Panneau scénario ---------- */
.panneau-scenario {
  width: 360px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--papier); border-right: 1px solid var(--ligne);
  position: relative;
  resize: horizontal; overflow: hidden; min-width: 240px; max-width: 60vw;
}
.panneau-entete {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px; border-bottom: 1px solid var(--ligne);
}
.aide { color: var(--encre-douce); font-size: 12px; }
.scenario-texte {
  flex: 1; overflow-y: auto;
  padding: 16px 18px 80px;
  font-family: var(--police-scenario); font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; word-wrap: break-word;
}
.scenario-texte .titre-seq { font-weight: 700; }
.scenario-texte mark {
  background: var(--surligne); color: inherit; cursor: pointer;
  border-bottom: 2px solid #e7c94a;
}
.scenario-texte mark.multiple { background: #ffe57a; }
.scenario-texte mark.actif { background: var(--surligne-actif); }
.scenario-vide { color: var(--encre-douce); font-family: var(--police); white-space: normal; }

.btn-flottant {
  position: absolute; z-index: 20;
  background: var(--accent); color: #fff; border: none;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(194,65,12,.35); font-weight: 600;
}

/* ---------- Tableau ---------- */
.zone-tableau { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.defilement { flex: 1; overflow: auto; }

.tableau { border-collapse: separate; border-spacing: 0; background: var(--papier); min-width: 100%; }
.tableau th, .tableau td {
  border-right: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne);
  vertical-align: top; padding: 6px; text-align: left;
}
.tableau thead th {
  position: sticky; top: 0; z-index: 6;
  background: #ebe8e1; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; color: var(--encre-douce);
  white-space: nowrap;
}

/* Colonnes figées à gauche pendant le défilement horizontal */
.tableau .col-num { position: sticky; left: 0; z-index: 4; background: var(--papier); width: var(--l-num); min-width: var(--l-num); }
.tableau .col-extrait { position: sticky; left: var(--l-num); z-index: 4; background: var(--papier); width: var(--l-extrait); min-width: var(--l-extrait); box-shadow: 2px 0 0 var(--ligne-forte); }
.tableau thead .col-num, .tableau thead .col-extrait { z-index: 8; background: #ebe8e1; }

.col-texte { width: var(--l-texte); min-width: var(--l-texte); }
.col-photo { width: var(--l-photo); min-width: var(--l-photo); }
.col-menu { width: var(--l-menu); min-width: var(--l-menu); }
.col-duree { width: var(--l-duree); min-width: var(--l-duree); }

/* Ligne de séquence */
.ligne-seq td {
  background: var(--sequence); color: #f4f2ee; padding: 8px 10px;
  position: sticky; left: 0;
}
.seq-contenu { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; position: sticky; left: 10px; width: max-content; max-width: calc(100vw - 420px); }
.seq-titre { font-weight: 700; font-family: var(--police-scenario); }
.seq-info { color: #b9b4aa; font-size: 12px; font-variant-numeric: tabular-nums; }
.seq-implantation { display: flex; align-items: center; gap: 8px; }
.seq-implantation img { height: 44px; border-radius: 4px; cursor: zoom-in; border: 1px solid #55524b; }
.seq-implantation .btn { padding: 3px 8px; font-size: 12px; }

/* Ligne de plan */
.ligne-plan.survol td { background: #fffaf0; }
.ligne-plan.survol .col-num, .ligne-plan.survol .col-extrait { background: #fffaf0; }
.ligne-plan.glisse { opacity: .4; }
.ligne-plan.cible-dessus td { box-shadow: inset 0 3px 0 var(--accent); }
.ligne-plan.cible-dessous td { box-shadow: inset 0 -3px 0 var(--accent); }
.ligne-plan.orphelin .extrait { color: var(--danger); }
.ligne-plan.flash td { animation: flash 1.2s ease; }
@keyframes flash { from { background: var(--accent-doux); } }

.num { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.actions-plan { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.icone {
  background: none; border: 1px solid transparent; border-radius: 4px;
  width: 24px; height: 24px; padding: 0; cursor: pointer; color: var(--encre-douce);
  display: inline-flex; align-items: center; justify-content: center;
}
.icone:hover { background: var(--fond); border-color: var(--ligne); color: var(--encre); }
.icone:disabled { opacity: .3; cursor: default; background: none; border-color: transparent; }
.icone.poignee { cursor: grab; }
.icone.supprimer:hover { color: var(--danger); }

.extrait {
  font-family: var(--police-scenario); font-size: 12px; line-height: 1.45;
  color: var(--encre-douce); cursor: pointer; white-space: pre-wrap;
  max-height: 140px; overflow: auto;
}
.extrait:hover { color: var(--encre); }

textarea.champ, input.champ, select.champ {
  width: 100%; font: inherit; font-size: 13px;
  border: 1px solid var(--ligne); border-radius: 4px; padding: 5px 6px;
  background: #fcfbf9; color: var(--encre);
}
textarea.champ { resize: vertical; min-height: 64px; line-height: 1.4; overflow: hidden; }
textarea.champ:focus, input.champ:focus, select.champ:focus { outline: 2px solid var(--accent-doux); border-color: var(--accent); background: #fff; }
select.champ.non-rempli { color: var(--encre-douce); }
.autre { margin-top: 4px; }
.autre[hidden] { display: none; }

/* Photo */
/* Photo du plan : cadre fixe en 16:9, comme l'image du film.
   L'image est posée en position absolue dans le cadre : elle ne peut donc
   jamais agrandir le cadre (correctif pour Safari, qui laissait l'image
   étirer le cadre et donnait un effet de zoom).
   object-fit: contain → on voit toujours toute l'image recadrée ; une photo
   non recadrée (ajoutée avant l'outil ✂) apparaît avec des bandes. */
.photo-zone {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9; overflow: hidden;
  border: 1.5px dashed var(--ligne-forte); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--encre-douce); font-size: 12px; text-align: center; cursor: pointer; padding: 4px;
}
/* Navigateurs anciens sans aspect-ratio : hauteur = 56,25 % de la largeur */
@supports not (aspect-ratio: 16 / 9) {
  .photo-zone { height: 0; padding: 56.25% 0 0; }
  .photo-zone .indication { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
}
.photo-zone:hover, .photo-zone.survol-fichier { border-color: var(--accent); color: var(--accent); background: var(--accent-doux); }
.photo-zone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.photo-zone.avec-image { border-style: solid; border-color: var(--ligne); padding: 0; background: #000; }
.photo-outils { position: absolute; top: 3px; right: 3px; display: none; gap: 2px; }
.photo-zone.avec-image:hover .photo-outils { display: flex; }
.photo-outils .icone { background: rgba(255,255,255,.9); }

.duree-total { font-size: 11px; color: var(--encre-douce); margin-top: 3px; }

.vide { padding: 40px; text-align: center; color: var(--encre-douce); }

/* ---------- Vue compacte ---------- */
body.vue-compacte {
  --l-num: 80px; --l-extrait: 150px; --l-texte: 170px; --l-photo: 126px; --l-menu: 130px; --l-duree: 64px;
  font-size: 12.5px;
}
body.vue-compacte .tableau th, body.vue-compacte .tableau td { padding: 3px 4px; }
body.vue-compacte textarea.champ { height: 3.2em; min-height: 0; overflow: auto; font-size: 12px; resize: none; }
body.vue-compacte textarea.champ:focus { height: 7em; }
body.vue-compacte .extrait { max-height: 58px; font-size: 11px; }
body.vue-compacte .photo-zone { min-height: 0; }
body.vue-compacte .photo-zone .indication { font-size: 0; }
body.vue-compacte .photo-zone .indication::before { content: "📷 +"; font-size: 13px; }
body.vue-compacte .actions-plan { gap: 1px; }
body.vue-compacte select.champ, body.vue-compacte input.champ { font-size: 12px; padding: 2px 4px; }
body.vue-compacte .num { font-size: 13px; }
body.vue-compacte .icone { width: 20px; height: 20px; font-size: 11px; }

/* Vue compacte : seulement n°, description, photo, son, accessoires, durée */
body.vue-compacte #tableau [data-col="extrait"],
body.vue-compacte #tableau [data-col="valeur"],
body.vue-compacte #tableau [data-col="composition"],
body.vue-compacte #tableau [data-col="angle"],
body.vue-compacte #tableau [data-col="hauteur"],
body.vue-compacte #tableau [data-col="mouvement"] { display: none; }
body.vue-compacte .tableau .col-num { box-shadow: 2px 0 0 var(--ligne-forte); }

/* ---------- Scénario masqué ---------- */
body.scenario-masque .panneau-scenario { display: none; }
body.scenario-masque .seq-contenu { max-width: calc(100vw - 40px); }

/* ---------- Vue storyboard ---------- */
.storyboard { padding: 14px 16px 24px; }
.storyboard[hidden] { display: none; }
.sb-seq {
  display: flex; align-items: baseline; gap: 14px;
  background: var(--sequence); color: #f4f2ee; padding: 8px 12px; border-radius: var(--rayon);
  margin: 18px 0 12px;
}
.sb-seq:first-child { margin-top: 0; }
.sb-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.carte {
  background: var(--papier); border: 1px solid var(--ligne); border-radius: 8px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
  break-inside: avoid;
}
.carte.flash { animation: flash 1.2s ease; }
.carte.orphelin { border-color: var(--danger); }
.carte-entete { display: flex; justify-content: space-between; align-items: baseline; }
.carte-entete .num { font-size: 20px; }
.carte-duree { color: var(--encre-douce); font-variant-numeric: tabular-nums; }
.carte .photo-zone { min-height: 0; }
.carte textarea.champ { min-height: 80px; font-size: 14px; resize: vertical; overflow: auto; }

/* ---------- Durée totale (pied de page) ---------- */
.pied-total {
  position: sticky; bottom: 0; left: 0; z-index: 9;
  display: flex; align-items: baseline; gap: 12px; justify-content: flex-end;
  padding: 8px 16px; background: var(--papier); border-top: 2px solid var(--sequence);
  font-variant-numeric: tabular-nums;
}
.pied-total strong { font-size: 20px; }
.pied-detail { color: var(--encre-douce); font-size: 12px; }

/* ---------- Fenêtres ---------- */
.dialogue {
  border: none; border-radius: 10px; padding: 0; width: min(760px, 94vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.dialogue form { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.dialogue h2 { margin: 0; }
.dialogue textarea { width: 100%; font-family: var(--police-scenario); font-size: 13px; padding: 10px; border: 1px solid var(--ligne-forte); border-radius: var(--rayon); }
.dialogue-actions { display: flex; gap: 8px; align-items: center; }
.dialogue .btn { background: var(--fond); color: var(--encre); border-color: var(--ligne-forte); }
.dialogue .btn.principal { background: var(--accent); color: #fff; border-color: var(--accent); }
.espaceur { flex: 1; }
.dialogue::backdrop { background: rgba(20,19,17,.55); }

.visionneuse {
  position: fixed; inset: 0; z-index: 100; background: rgba(15,14,12,.92);
  display: flex; align-items: center; justify-content: center; padding: 30px;
}
.visionneuse[hidden] { display: none; }
.visionneuse img { max-width: 100%; max-height: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.visionneuse .btn { position: absolute; top: 16px; right: 16px; }

/* ---------- Petits écrans ---------- */
@media (max-width: 800px) {
  .espace { flex-direction: column; }
  .panneau-scenario { width: 100%; max-width: none; height: 38vh; resize: vertical; border-right: none; border-bottom: 1px solid var(--ligne); }
  .seq-contenu { max-width: calc(100vw - 30px); }
}

/* ---------- Impression / PDF ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; display: block; font-size: 10px; }
  .barre-droite, .panneau-scenario, .actions-plan, .photo-outils, #vide { display: none !important; }
  .barre { background: #fff; color: #000; border-bottom: 2px solid #000; padding: 0 0 6px; }
  .meta-num input { color: #000; background: none; border: none; }
  .meta-num span { color: #444; }
  .sb-seq { background: #e5e5e5; color: #000; }
  .sb-grille { grid-template-columns: repeat(3, 1fr); }
  .pied-total { position: static; }
  .espace, .zone-tableau, .defilement { display: block; overflow: visible; }
  .tableau { width: 100%; }
  .tableau thead th, .col-num, .col-extrait { position: static !important; box-shadow: none !important; }
  .ligne-seq td { position: static; background: #e5e5e5; color: #000; }
  .seq-contenu { position: static; max-width: none; }
  .ligne-plan { break-inside: avoid; }
  textarea.champ, input.champ, select.champ { border: none; background: none; padding: 0; appearance: none; -webkit-appearance: none; resize: none; max-height: none !important; overflow: visible !important; }
  .photo-zone { border: none; background: none !important; }
  .photo-zone:not(.avec-image) { aspect-ratio: auto; }
  .photo-zone .indication { display: none; }
  .extrait { max-height: none; overflow: visible; }
  select.champ.non-rempli { color: transparent; }
  select.champ.choix-autre { display: none; }           /* on imprime seulement le texte « Autre » */
  .champ::placeholder { color: transparent; }
  .seq-implantation .btn { display: none; }
  .seq-implantation img { height: 90px; }
}

/* =====================================================================
   Choix des tableaux, scénario partiel, plans d'implantation multiples
   ===================================================================== */

/* Boutons « 1 2 3 4 » dans la barre du haut */
.choix-tableaux { display: flex; gap: 4px; }
.puce {
  min-width: 30px; height: 27px; padding: 0 8px;
  background: #34322d; border: 1px solid #4d4a43; border-radius: 4px;
  color: #cfcac0; font-weight: 700; cursor: pointer;
}
.puce:hover { border-color: #8a857b; }
.puce.actif { background: var(--accent); border-color: var(--accent); color: #fff; }

/* En-tête du panneau scénario */
.panneau-ligne { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.groupe-btn.petit .btn {
  font-size: 12px; padding: 3px 8px;
  background: var(--fond); color: var(--encre); border-color: var(--ligne-forte);
}
.groupe-btn.petit .btn.actif { background: var(--sequence); color: #fff; border-color: var(--sequence); }

/* Tableaux non choisis, affichés en lecture seule (« Tout le scénario ») */
.scenario-texte .hors-choix { color: #a8a397; }
.scenario-texte .hors-choix mark { background: #eee9dc; border-bottom-color: #d8d2c3; }
.btn-flottant.inactif { background: #8a857b; box-shadow: none; cursor: not-allowed; }

/* ---------- Séparateurs de décor ---------- */
.ligne-decor td { background: #efe6d6; border-bottom: 2px solid var(--accent); padding: 6px 10px; }
.decor-contenu { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; left: 10px; width: max-content; max-width: calc(100vw - 420px); }
body.scenario-masque .decor-contenu { max-width: calc(100vw - 40px); }
.decor-icone { color: var(--accent); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.decor-nom {
  font: inherit; font-weight: 700; font-size: 14px; width: 220px;
  border: 1px solid var(--ligne-forte); border-radius: 4px; padding: 3px 7px; background: #fffdf8; color: var(--encre);
}
.decor-nom:focus { outline: 2px solid var(--accent-doux); border-color: var(--accent); }
.ligne-decor .seq-info, .impl-infos { color: var(--encre-douce); font-size: 12px; font-variant-numeric: tabular-nums; }
.decor-impl { display: flex; align-items: center; gap: 6px; }
.decor-impl img { height: 48px; border-radius: 4px; border: 1px solid var(--ligne-forte); cursor: zoom-in; background: #fff; }
.ligne-decor .btn, .impl-bloc .btn { background: #fffdf8; color: var(--encre); border-color: var(--ligne-forte); font-size: 12px; padding: 3px 8px; }
.btn.discret { background: none !important; border-color: transparent !important; color: var(--encre-douce) !important; }
.btn.discret:hover { color: var(--danger) !important; }

/* Storyboard : sous-titres de décor et champ son */
.sb-decor {
  display: flex; align-items: baseline; gap: 10px; margin: 14px 0 10px;
  padding: 4px 10px; border-left: 4px solid var(--accent); background: #efe6d6; border-radius: 0 4px 4px 0;
}
.carte-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--encre-douce); margin-bottom: -4px; }
.carte textarea.champ[placeholder^="Dialogues"] { min-height: 52px; }

/* ---------- Vue Implantation ---------- */
.impl-bloc {
  display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 18px;
  background: var(--papier); border: 1px solid var(--ligne); border-radius: 8px;
  padding: 14px; margin-bottom: 14px; break-inside: avoid;
}
.impl-gauche { display: flex; flex-direction: column; gap: 10px; }
.impl-gauche.survol-fichier { outline: 2px dashed var(--accent); outline-offset: 4px; }
.impl-titre { display: flex; align-items: center; gap: 8px; }
.impl-titre .decor-nom { width: 100%; }
.decor-impl.grand { flex-direction: column; align-items: stretch; }
.decor-impl.grand img { height: auto; width: 100%; max-height: 380px; object-fit: contain; }
.decor-impl.grand .btn { align-self: flex-start; }
.btn.zone-ajout { align-self: stretch !important; justify-content: center; min-height: 160px; border-style: dashed !important; color: var(--encre-douce) !important; }
.impl-infos { display: flex; justify-content: space-between; align-items: center; }
.sans-decor { opacity: .75; }
.impl-texte-scenario {
  font-family: var(--police-scenario); font-size: 13.5px; line-height: 1.65; white-space: pre-wrap;
  border-left: 1px solid var(--ligne); padding-left: 18px;
}
.impl-texte-scenario mark { background: var(--surligne); color: inherit; }
.impl-num {
  font-family: var(--police); font-size: 10px; font-weight: 700; color: #fff; background: var(--accent);
  border-radius: 3px; padding: 0 4px; margin-right: 3px; vertical-align: super;
}
.impl-aide { color: var(--encre-douce); font-size: 13px; margin: 4px 0 12px; }
@media (max-width: 900px) { .impl-bloc { grid-template-columns: 1fr; } }

@media print {
  .choix-tableaux .puce:not(.actif) { display: none; }
  .puce.actif { background: none; color: #000; border: 1px solid #000; }
  .ligne-decor td { background: #f1f1f1; }
  .decor-contenu { position: static; max-width: none; }
  .decor-nom { border: none; background: none; padding: 0; }
  .ligne-decor .btn, .impl-bloc .btn, .btn.discret { display: none !important; }
  .impl-bloc { grid-template-columns: 45% 1fr; }
}

/* =====================================================================
   Fenêtre de recadrage 16:9
   ===================================================================== */
.rc-dialogue { width: min(1060px, 96vw); }
.rc-corps { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.rc-corps h2 { margin: 0; }
.rc-scene { position: relative; align-self: center; line-height: 0; user-select: none; touch-action: none; background: #111; overflow: hidden; }
.rc-img { display: block; max-width: min(1000px, 90vw); max-height: 62vh; }
.rc-cadre {
  position: absolute; cursor: move; touch-action: none;
  outline: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .6);
}
/* Grille des tiers, utile pour composer */
.rc-grille {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(33.33% - .5px), rgba(255,255,255,.5) calc(33.33% - .5px), rgba(255,255,255,.5) calc(33.33% + .5px), transparent calc(33.33% + .5px),
      transparent calc(66.66% - .5px), rgba(255,255,255,.5) calc(66.66% - .5px), rgba(255,255,255,.5) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
    linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(255,255,255,.5) calc(33.33% - .5px), rgba(255,255,255,.5) calc(33.33% + .5px), transparent calc(33.33% + .5px),
      transparent calc(66.66% - .5px), rgba(255,255,255,.5) calc(66.66% - .5px), rgba(255,255,255,.5) calc(66.66% + .5px), transparent calc(66.66% + .5px));
}
.rc-poignee { position: absolute; width: 18px; height: 18px; background: #fff; border: 2px solid var(--accent); border-radius: 3px; }
/* Poignées à l'intérieur du cadre (la scène masque ce qui dépasse) */
.rc-poignee.nw { left: -2px; top: -2px; cursor: nwse-resize; }
.rc-poignee.ne { right: -2px; top: -2px; cursor: nesw-resize; }
.rc-poignee.sw { left: -2px; bottom: -2px; cursor: nesw-resize; }
.rc-poignee.se { right: -2px; bottom: -2px; cursor: nwse-resize; }

/* =====================================================================
   Version en ligne : écran de connexion, compte, mode lecture
   ===================================================================== */
.connexion {
  position: fixed; inset: 0; z-index: 200; background: var(--sequence);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.connexion-boite {
  background: var(--papier); border-radius: 10px; padding: 28px; width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.connexion-titre { font-weight: 800; font-size: 20px; letter-spacing: .06em; }
.connexion-boite p { margin: 0; color: var(--encre-douce); }
.connexion-boite input {
  font: inherit; font-size: 16px; padding: 10px 12px;
  border: 1px solid var(--ligne-forte); border-radius: var(--rayon);
}
.connexion-boite input:focus { outline: 2px solid var(--accent-doux); border-color: var(--accent); }
.connexion-boite .btn { justify-content: center; padding: 10px; font-size: 15px; }
.connexion-info { color: var(--danger) !important; min-height: 1.2em; font-size: 13px; }
.compte { color: #cfcac0; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.compte .btn { font-size: 12px; padding: 3px 8px; }
.bandeau-lecture { background: #fde68a; color: #422006; text-align: center; padding: 6px; font-weight: 600; font-size: 13px; }
@media print { .compte, .bandeau-lecture { display: none; } }
