/* REDive — feuille partagée par le studio, l’accueil, l’admin et l’UI kit.
   1 Base · 2 Composants partagés · 3 Barre supérieure · 4 Studio
   (bibliothèque, scène, pellicule, inspecteur, barre d’action) ·
   5 Fenêtres · 6 Vidéo d’accueil · 7 Responsive · 8 Mouvement réduit.
   Les valeurs viennent de tokens.css : ne pas réintroduire de couleurs en dur
   pour un composant partagé. */

/* ------------------------------------------------------------ 1 · base */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: var(--font-ui);
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
  transition:
    background var(--motion-fast),
    color var(--motion-fast),
    border-color var(--motion-fast);
  white-space: nowrap;
}
button:disabled {
  /* 0,4 donnait 2,44 de contraste sur le bouton Exporter grisé : on le devinait
     à peine. 0,6 reste visiblement inactif et se lit. */
  opacity: 0.6;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
a {
  color: var(--mint);
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.2px;
}
p {
  margin: 0;
}
input[type="checkbox"] {
  accent-color: var(--mint);
  width: 16px;
  height: 16px;
  vertical-align: middle;
}
input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: var(--mint);
  cursor: ew-resize;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -60px;
  z-index: 30;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--mint);
  color: var(--color-ocean-950);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--motion-fast);
}
.skip-link:focus {
  top: var(--space-4);
}

/* ------------------------------------------- 2 · composants partagés */
.primary {
  background: var(--mint);
  color: var(--color-ocean-950);
  padding: 12px 20px;
  min-height: 44px;
  border-radius: var(--radius-control);
  font-weight: 600;
  font-size: 14px;
}
.primary:hover:not(:disabled) {
  background: #cde9e3;
}
.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--color-control-border);
  padding: 9px 14px;
  min-height: 40px;
  border-radius: var(--radius-control);
  font-size: 14px;
}
.secondary:hover:not(:disabled) {
  border-color: var(--mint);
  color: var(--mint);
}
.quiet,
.icon-button {
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  min-height: 36px;
  border-radius: var(--radius-control);
  font-size: 14px;
}
.quiet:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  color: var(--ink);
  background: #ffffff0f;
}
.icon-button {
  font-size: 18px;
  padding: 4px 9px;
}
.text-button {
  background: none;
  color: var(--mint);
  padding: 10px 0;
  font-size: 14px;
}
.text-button:hover {
  text-decoration: underline;
}
.danger-button {
  background: #3a2020;
  color: #ffd9d6;
  border: 1px solid #ff6b6155;
  padding: 7px 12px;
  min-height: 36px;
  border-radius: var(--radius-control);
  font-size: 12px;
}
.danger-button:hover {
  background: #4a2725;
}
.mode-switch {
  display: flex;
  background: #080f1566;
  border: 1px solid #ffffff0a;
  border-radius: var(--radius-control);
  padding: 4px;
  gap: 2px;
}
.mode-switch button {
  flex: 1;
  padding: 8px 4px;
  min-height: 36px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}
.mode-switch button.active {
  background: #24433e;
  color: var(--mint);
  box-shadow: inset 0 -2px 0 var(--mint);
}
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--mint);
  margin: 0;
}
.subtle {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.section-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: var(--space-6) 0 var(--space-3);
}
.controls > .section-label:first-child {
  margin-top: 0;
}
.error-note {
  color: var(--color-error);
}
.brand-emphasis {
  color: var(--color-coral);
}
.meter {
  height: 4px;
  background: #ffffff0a;
  border-radius: 4px;
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  background: var(--mint);
  transition: width 0.5s;
}
.meter.indeterminate > span {
  width: 30% !important;
  animation: travel 1.8s ease-in-out infinite;
}
@keyframes travel {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(340%);
  }
}
.encoding {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: var(--space-2);
  border: 1.5px solid #b9ded640;
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: spin 1.4s linear infinite;
  vertical-align: -1px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: #254339;
  color: var(--ink);
  border: 1px solid #b9ded644;
  border-radius: 10px;
  padding: 14px 20px;
  max-width: min(520px, 90vw);
  font-size: 14px;
  line-height: 1.5;
  z-index: 20;
  box-shadow: 0 10px 40px #0006;
}

/* ------------------------------------------- 3 · barre supérieure */
.topbar {
  height: 72px;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(110deg, #13252ba8, #101b2399);
  backdrop-filter: blur(20px);
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.brand img {
  display: block;
}
.top-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.credits {
  padding: 8px 12px;
  min-height: 36px;
  border-radius: var(--radius-control);
  background: #ffffff05;
  color: var(--ink);
  border: 1px solid #ffffff10;
  font-size: 12px;
}
.coin {
  color: var(--mint);
  margin-right: 4px;
}
.credit-unit {
  color: var(--muted);
}
.lang {
  min-height: 36px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-control);
  /* #ffffff10 mesurait 1,16 de contraste : le sélecteur n'avait pas de contour. */
  border: 1px solid #ffffff55;
  background: #ffffff05;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.lang:hover {
  color: var(--ink);
}

/* ------------------------------------------------------- 4 · studio */
.workspace {
  display: grid;
  grid-template-columns: 288px minmax(360px, 1fr) 304px;
  /* Hauteur fixe : tout le studio tient dans l'écran, et ce sont les colonnes
     latérales qui défilent, pas la page. Sans cela un flex enfant refuse de
     rétrécir sous son contenu (min-height: auto) et pousse toute la rangée. */
  height: calc(100dvh - 148px);
  min-height: 520px;
}
.library,
.inspector {
  padding: var(--space-6) var(--space-4);
  background: #0f1a21;
}
.library {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  min-height: 0;
}
.inspector {
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 24px;
}
.panel-title h2 {
  font-size: 14px;
}
.count {
  color: var(--muted);
  font-size: 12px;
  padding: 2px 8px;
  background: #ffffff0d;
  border-radius: 20px;
}

/* bibliothèque : une seule liste, de l’import au téléchargement */
.dropzone {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: #ffffff05;
  border: 1px dashed var(--color-control-border);
  border-radius: var(--radius-card);
  color: var(--ink);
  text-align: left;
  white-space: normal;
}
.dropzone:hover {
  border-color: var(--mint);
  background: #b9ded60d;
}
.dropzone-icon {
  font-size: 20px;
  color: var(--mint);
  line-height: 1;
}
.dropzone-text {
  font-size: 14px;
  font-weight: 550;
}
.dropzone-text small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.upload-state {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.upload-state progress {
  width: 100%;
  height: 4px;
  accent-color: var(--mint);
  margin-top: var(--space-2);
}
.library-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 calc(var(--space-2) * -1);
  padding: 0 var(--space-2);
}
.library-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  padding: var(--space-4) 0;
}
.asset-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 30px;
  grid-template-areas:
    "check select remove"
    ". download download"
    "confirm confirm confirm";
  align-items: center;
  gap: var(--space-2) var(--space-2);
  padding: var(--space-2);
  border: 1px solid transparent;
  border-radius: 10px;
  margin-bottom: var(--space-1);
}
.asset-row:hover {
  background: #ffffff05;
}
.asset-row.selected {
  background: #b9ded60f;
  border-color: #b9ded63d;
}
.asset-row.failed .asset-thumb {
  background: #3a2020;
}
.asset-check {
  grid-area: check;
}
.asset-select {
  grid-area: select;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-align: left;
  min-width: 0;
  background: none;
  color: var(--ink);
  padding: 0;
}
.asset-figure {
  position: relative;
  flex: 0 0 auto;
}
.asset-thumb {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: #17313c;
}
.thumb-badge {
  position: absolute;
  left: 3px;
  bottom: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #061016cc;
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.2px;
}
.asset-text {
  min-width: 0;
}
.asset-text strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 550;
}
.asset-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.asset-text .asset-error {
  color: var(--color-error);
}
.asset-text .asset-working {
  color: var(--mint);
}
.asset-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}
.asset-meta small {
  min-width: 0;
}
.asset-price {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.asset-price .coin {
  margin-right: 2px;
}
.asset-remove {
  grid-area: remove;
  background: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 6px;
  border-radius: 6px;
  opacity: 0;
}
.asset-row:hover .asset-remove,
.asset-remove:focus-visible {
  opacity: 1;
}
.asset-remove:hover {
  background: #ffffff0f;
  color: var(--ink);
}
.file-download {
  grid-area: download;
  font-size: 12px;
  font-weight: 600;
  text-underline-offset: 3px;
}
.asset-confirm {
  grid-area: confirm;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: 8px;
  background: #ffffff08;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.asset-confirm span {
  flex: 1 1 100%;
}
.asset-confirm button {
  flex: 1 1 auto;
}
.bulk-confirm {
  margin-top: calc(var(--space-2) * -1);
}
.danger-text {
  color: var(--color-error);
  padding: 4px 0;
  font-size: 12px;
}
.library-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--muted);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}
.select-all {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

/* scène */
.studio {
  padding: var(--space-6) var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  min-height: 0;
  background: radial-gradient(ellipse at 45% 30%, #14303d45, transparent 68%);
}
.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}
.stage-title {
  min-width: 0;
}
.stage-title h2 {
  font-size: 18px;
  font-weight: 550;
  /* Le nom est raccourci par le milieu en JS (nomCourt) ; ceci n'est qu'un
     filet. `overflow-wrap: anywhere` coupait « SportDiver_20260826_0 / 85401.jpg ». */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-meta {
  margin-top: var(--space-1);
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  position: relative;
}
.viewer {
  /* Le cadre suit exactement le format du média : ni bandes noires, ni débordement.
     --ratio est posé par app.js depuis les dimensions de la source. */
  --limit: min(52dvh, 100%);
  width: min(100%, calc(var(--limit) * var(--ratio, 1.3333)));
  margin: 0 auto;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #061016;
  box-shadow: 0 20px 60px #0004;
}
.comparison {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ratio, 1.3333);
  overflow: hidden;
}
.comparison > img,
.before-mask img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.before-mask {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
}
.image-tag {
  position: absolute;
  top: var(--space-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.3px;
  padding: 6px 10px;
  border-radius: 20px;
  background: #0b141bb3;
  backdrop-filter: blur(12px);
  z-index: 2;
}
.before-tag {
  left: var(--space-3);
  color: var(--muted);
}
.after-tag {
  right: var(--space-3);
  color: var(--mint);
}
.divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #d9fffacc;
  pointer-events: none;
  z-index: 3;
}
.divider span {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  background: var(--ink);
  color: #182c32;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 2px 12px #0006;
}
.comparison #split {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  opacity: 0;
  margin: 0;
  z-index: 4;
  cursor: ew-resize;
}
.comparison #split:focus-visible {
  opacity: 0.08;
  outline: none;
}
/* Le focus clavier se lit sur la poignée, pas par un voile sur l’image. */
.comparison:has(#split:focus-visible) .divider span {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
.preview-pending {
  position: absolute;
  left: 50%;
  bottom: var(--space-3);
  transform: translateX(-50%);
  z-index: 3;
  padding: 7px 12px;
  border-radius: 20px;
  background: #0b141be0;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}
.stage-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
}
.stage-pending .encoding {
  width: 20px;
  height: 20px;
  margin: 0;
}
.stage-pending.failed {
  color: var(--color-error);
  max-width: 44ch;
}
.stage-caption {
  font-size: 12px;
  line-height: 1.6;
  color: #7c95a2;
}

/* état vide : la seule chose à faire est d’ajouter des fichiers */
/* Studio vide : toute la zone de travail est la cible de dépôt. Le vide
   devient une invitation plutôt qu'un manque. */
.empty-stage {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-6);
  text-align: center;
  border: 2px dashed #8dcac52e;
  border-radius: var(--radius-card);
  background: radial-gradient(ellipse at 50% 40%, #12283255, #10192022 70%);
}
body.no-files .studio {
  padding-bottom: var(--space-6);
}
body.drag-over .empty-stage {
  border-color: var(--mint);
  background: radial-gradient(ellipse at 50% 40%, #1a3a3555, #10192022 70%);
}
.empty-icon {
  display: block;
  font-size: 30px;
  color: var(--mint);
  opacity: 0.8;
}
.empty-stage h2 {
  font-size: 22px;
  font-weight: 500;
  margin: var(--space-4) 0 var(--space-6);
}
.empty-stage h2 small {
  display: block;
  margin-top: var(--space-2);
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
/* Le glisser-déposer s'apprend sur l'écran d'accueil, qui l'explique en grand.
   Une fois des fichiers importés, le rappel sous le bouton ne sert plus. */
body:not(.no-files) .dropzone small {
  display: none;
}
.journey {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  list-style: none;
  padding: 0;
  margin: var(--space-8) 0 var(--space-6);
  color: var(--muted);
  font-size: 13px;
}
.journey li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
/* Seul le premier span de chaque étape est la pastille numérotée. */
.journey li > span:first-child {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #b9ded640;
  border-radius: 50%;
  color: var(--mint);
  font-size: 12px;
}
.empty-formats {
  display: block;
  font-size: 12px;
  line-height: 1.7;
  color: #6e8a98;
}

/* Barre de lecture du clip : elle appartient au média, pas à la bibliothèque.
   Une piste continue, un curseur, un temps — aucune apparence de liste. */
.clip-bar {
  position: relative;
  height: 54px;
  background: #07131a;
  border-top: 1px solid #ffffff14;
  display: flex;
  align-items: stretch;
}
.clip-timeline {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
}
.clip-track {
  display: flex;
  flex: 1;
  min-width: 0;
}
.clip-step {
  width: 34px;
  background: #07131a;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  border-right: 1px solid #ffffff14;
}
.clip-bar .clip-step + .clip-timeline + .clip-step {
  border-right: 0;
  border-left: 1px solid #ffffff14;
}
.clip-step:hover:not(:disabled) {
  color: var(--ink);
  background: #0d1f28;
}
.clip-track.recomputing {
  opacity: 0.45;
  transition: opacity var(--motion-standard);
}
.clip-cell {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  opacity: 0.5;
  border-right: 1px solid #07131a;
  transition: opacity var(--motion-fast);
}
.clip-cell:last-child {
  border-right: 0;
}
.clip-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.clip-cell.current {
  opacity: 1;
}
.clip-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5%;
  width: 2px;
  margin-left: -1px;
  background: var(--mint);
  box-shadow: 0 0 0 1px #07131a99;
  pointer-events: none;
  transition: left var(--motion-fast);
}
/* Sélecteur qualifié : input[type="range"] est plus spécifique qu’une classe seule. */
input[type="range"].clip-scrub {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.clip-scrub:focus-visible {
  opacity: 0.2;
  outline-offset: -3px;
}
.clip-time {
  display: grid;
  place-items: center;
  padding: 0 var(--space-3);
  background: #07131a;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  border-left: 1px solid #ffffff14;
}

/* inspecteur */
/* Un fait mesuré, sur une ligne : ni cadre, ni paragraphe. */
.analysis-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: calc(var(--space-2) * -1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.controls {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* Les réglages défilent sous le sélecteur de mode ; le bouton d'application
     reste visible en bas de la colonne. */
  margin: 0 calc(var(--space-2) * -1);
  padding: 0 var(--space-2);
}
.controls-empty {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
/* Magique porte le produit : c'est la carte, pas un onglet parmi trois.
   Avancé et Expert vivent sous « Ajuster moi-même ». Décision Jev. */
/* La carte entière est le bouton : on revient au mode en cliquant n'importe où,
   pas seulement sur la ligne du titre. Un seul bord gauche à l'intérieur :
   l'étoile marque le titre et ne décale pas le texte qui suit. */
.magic-hero {
  border-radius: var(--radius-card);
  background: linear-gradient(140deg, #21453e55, #142b3022);
  border: 1px solid #b9ded61f;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  width: 100%;
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.magic-hero:hover:not(:disabled):not(.active) {
  border-color: #b9ded63d;
  background: linear-gradient(140deg, #21453e77, #142b3033);
}
.magic-hero.active {
  border-color: #7fd4c133;
  box-shadow: inset 0 0 0 1px #7fd4c118;
  cursor: default;
}
.magic-hero:disabled {
  opacity: 0.5;
  cursor: default;
}
.magic-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.magic-mark {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1.2;
  color: var(--mint);
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.magic-hero.active .magic-mark {
  opacity: 1;
}
.magic-name {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.2px;
}
.magic-hero.active .magic-name {
  color: var(--mint);
}
.magic-promise {
  display: block;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.magic-hero .analysis-note {
  display: block;
  margin: var(--space-1) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid #ffffff0d;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
/* L'avis sur le rendu : une ligne sous la légende, jamais un obstacle. */
.verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--muted);
}
.verdict button {
  min-height: 30px;
  padding: 0 var(--space-3);
  font-size: 12px;
}
.verdict.answered {
  color: var(--mint);
}
.adjust-toggle {
  font-size: 13px;
  color: var(--muted);
}
.adjust-toggle:hover:not(:disabled) {
  color: var(--mint);
}
.adjust-toggle::after {
  content: " ›";
  display: inline-block;
  transition: transform 0.15s ease;
}
.adjust-toggle[aria-expanded="true"]::after {
  transform: rotate(90deg);
}
.adjust,
.adjust-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.adjust {
  flex: 1;
  gap: var(--space-2);
}
.adjust-body {
  flex: 1;
  gap: var(--space-4);
}
.profiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.profile {
  padding: var(--space-3);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #ffffff05;
  color: var(--ink);
  font-size: 13px;
}
.profile:hover {
  border-color: #b9ded655;
}
.profile.active {
  border-color: #b9ded680;
  background: #b9ded612;
}
.profile-swatch {
  display: block;
  height: 18px;
  width: 30px;
  border-radius: 5px;
  margin-bottom: var(--space-2);
  background: linear-gradient(125deg, #167a87, #b9ded6);
}
.profile-swatch.warm {
  background: linear-gradient(125deg, #356a79, #e4c491);
}
.profile-swatch.golden {
  background: linear-gradient(125deg, #685848, #eca16b);
}
.profile-swatch.deep {
  background: linear-gradient(125deg, #0d2547, #3a8091);
}
.slider-field {
  display: block;
  margin-bottom: var(--space-4);
}
.slider-heading {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 13px;
  margin-bottom: var(--space-2);
}
.slider-heading output {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.slider-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: #6e8a98;
}
.switch-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  cursor: pointer;
}
/* Un conseil sur ce que la correction réussit le mieux : demandé par Bruno,
   une fois dans la scène vide, une fois dans l'inspecteur qui la remplace. */
.tips {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: 10px;
  border: 1px solid #8dcac52e;
  background: #12283255;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  text-align: left;
}
.tips strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mint);
}
.tips-empty {
  max-width: 460px;
  margin: 0 auto var(--space-4);
}
.inspector-foot {
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
}
.inspector-foot .secondary {
  width: 100%;
}

/* barre d’action */
.bottom-bar {
  position: relative;
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  /* Même gouttière que la barre du haut et que les trois colonnes : la page a
     un seul bord vertical, pas deux. */
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  background: #101b22;
}
.bar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}
.bar-state {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 0 0 auto;
}
/* L'état ne se casse pas en deux lignes : c'est le bouton de signalement, plus
   long et moins urgent, qui cède la place et se tronque. */
.bar-state .system-status,
.bar-state .export-warn {
  white-space: nowrap;
}
.bar-left .report-open {
  /* Il rétrécissait jusqu'à 36 px et affichait « B… ». Il ne rétrécit plus :
     c'est le libellé qui change de longueur, voir .report-short plus bas. */
  flex: 0 0 auto;
  white-space: nowrap;
}
.export-warn {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
/* Fin d'export : c'est le moment le plus important du produit. La barre entière
   l'annonce et le reste jusqu'au téléchargement, plutôt qu'un bouton de plus
   dans une rangée de cinq. */
.bottom-bar.ready {
  background: linear-gradient(180deg, #16332e, #12262a);
  border-top-color: #7fd4c140;
}
.bottom-bar.ready .system-status {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.bottom-bar.ready .status-dot {
  height: 8px;
  width: 8px;
  box-shadow: 0 0 0 4px #7fd4c126;
}
.bottom-bar.ready .export-warn {
  color: #cfe9e2;
}
.export-actions a.call {
  font-size: 15px;
  font-weight: 600;
  padding: 0 var(--space-6);
  min-height: 46px;
}
.system-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
  font-size: 12px;
}
/* Toujours visible, jamais flottant : il ne recouvre ni la liste ni l'aperçu,
   et il reste loin du bouton Exporter. */
.report-open {
  font-size: 12px;
  min-height: 32px;
  padding: 0 var(--space-3);
}
.status-dot {
  height: 6px;
  width: 6px;
  flex: 0 0 auto;
  background: var(--mint);
  border-radius: 50%;
}
.export-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}
.export-actions a.primary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}
/* Progression de l’export : un filet sur l’arête de la barre, rien de flottant. */
.bar-meter {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #ffffff0f;
  overflow: hidden;
}
.bar-meter > span {
  display: block;
  height: 100%;
  background: var(--mint);
  transition: width 0.5s;
}
.bar-meter.indeterminate > span {
  width: 30% !important;
  animation: travel 1.8s ease-in-out infinite;
}
.system-status.failed {
  color: var(--color-error);
}
.system-status.failed .status-dot {
  background: var(--color-error);
}
/* Studio vide : une seule invitation, plein cadre. */
body.no-files .workspace {
  grid-template-columns: 1fr;
}
body.no-files .library,
body.no-files .inspector {
  display: none;
}

/* dépôt de fichiers : indice visible sur toute la fenêtre */
body.drag-over .workspace {
  outline: 2px dashed var(--mint);
  outline-offset: -8px;
}
body.drag-over .dropzone {
  border-color: var(--mint);
  background: #b9ded61a;
}

/* ---------------------------------------------------- 5 · fenêtres */
dialog {
  width: min(720px, 94vw);
  background: #13232c;
  color: var(--ink);
  border: 1px solid #ffffff1c;
  border-radius: var(--radius-card);
  padding: var(--space-8);
  box-shadow: 0 30px 100px #0009;
}
dialog::backdrop {
  background: #030b11bd;
  backdrop-filter: blur(8px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}
dialog h2 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.5px;
}
dialog p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  margin: var(--space-3) 0;
}
dialog details {
  border-top: 1px solid #ffffff18;
  padding: var(--space-3) 0;
}
dialog summary {
  cursor: pointer;
  font-size: 16px;
  line-height: 1.5;
}
.quote-total {
  font-size: 28px;
  margin: var(--space-6) 0;
  color: var(--mint);
}
.quote-breakdown {
  margin: var(--space-4) 0;
}
.quote-pricing {
  font-size: 13px;
  line-height: 1.6;
}
.pricing-line {
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink);
}
.pricing-line span {
  overflow-wrap: anywhere;
  min-width: 0;
  color: var(--muted);
}
.pricing-line strong {
  flex-shrink: 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

/* --------------------------------------------- 6 · vidéo d’accueil */
/* Utilisée par auth.html : preuve avant / après, sans slider ni son. */
.welcome-proof {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
}
.welcome-proof video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.welcome-proof::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 14, 20, 0.28);
  pointer-events: none;
}
.proof-play {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 3;
  padding: 7px 12px;
  min-height: 36px;
  border: 1px solid #ffffff50;
  border-radius: 6px;
  background: #08141ddd;
  color: #fff;
  font-size: 12px;
}
.welcome-benefit {
  max-width: 440px;
  margin: 0 0 var(--space-8);
}
.welcome-benefit .benefit-copy {
  color: #f2f7f6;
  font-size: 20px;
  line-height: 1.45;
  margin: 0 0 var(--space-3);
  text-shadow: 0 2px 12px #08141d;
}
.welcome-benefit .camera-support {
  font-size: 14px;
  line-height: 1.5;
  color: #e0eae7;
  margin: 0;
}
.welcome-benefit .camera-support strong {
  font-weight: 600;
  color: #fff;
}
.welcome-benefit .camera-support small {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  color: #cfddda;
}

/* --------------------------------------------------- 7 · responsive */
@media (min-width: 1500px) {
  .studio {
    padding: var(--space-8) 54px var(--space-6);
  }
  .workspace {
    grid-template-columns: 290px minmax(500px, 1fr) 320px;
  }
  .canvas-wrap,
  .stage-head,
  .stage-caption {
    max-width: 1060px;
    width: 100%;
    align-self: center;
  }
}
@media (max-width: 1180px) {
  /* La liste garde de quoi lire un nom de fichier : vignette plus petite,
     colonne un peu plus large, la scène cède les quelques pixels. */
  .workspace {
    grid-template-columns: 252px minmax(280px, 1fr) 264px;
  }
  .asset-thumb {
    width: 40px;
    height: 40px;
  }
  .studio {
    padding: var(--space-6) var(--space-4) var(--space-6);
  }
  .topbar {
    padding: 0 var(--space-4);
  }
  .credit-unit {
    display: none;
  }
  .journey {
    gap: var(--space-4);
    font-size: 12px;
  }
}
@media (max-width: 900px) {
  /* account.css réaffiche l’unité de crédits pour l’accueil : le studio la garde masquée. */
  .studio-page .credit-unit {
    display: none;
  }
  .topbar {
    height: auto;
    min-height: 64px;
    padding: var(--space-2) var(--space-3);
    flex-wrap: wrap;
  }
  .brand img {
    width: 124px;
    height: auto;
  }
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }
  .library,
  .inspector,
  .controls,
  .library-list {
    min-height: auto;
    overflow: visible;
  }
  /* L’aperçu passe en premier : la liste devient une pellicule sous la scène. */
  .studio {
    order: 1;
    padding: var(--space-4) var(--space-4) 0;
  }
  .library {
    order: 2;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: var(--space-4);
  }
  .inspector {
    order: 3;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .library-list {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    margin: 0;
    padding: 0 0 var(--space-2);
  }
  .library-list:empty {
    display: none;
  }
  .asset-row {
    flex: 0 0 auto;
    width: 264px;
    margin: 0;
    border-color: var(--line);
  }
  .asset-remove {
    opacity: 1;
  }
  .canvas-wrap {
    min-height: 220px;
  }
  .viewer {
    --limit: 42dvh;
  }
  .clip-bar {
    height: 46px;
  }
  .empty-stage {
    padding: var(--space-6) var(--space-4);
  }
  .empty-stage h2 {
    font-size: 19px;
  }
  .journey {
    margin: var(--space-6) 0 var(--space-3);
  }
  .bottom-bar {
    position: sticky;
    bottom: 0;
    z-index: 8;
    min-height: 68px;
    padding: var(--space-2) var(--space-3);
  }
  .system-status {
    max-width: 40%;
    line-height: 1.4;
  }
  .export-actions {
    gap: var(--space-1);
  }
  .toast {
    bottom: 88px;
  }
  dialog {
    padding: var(--space-6);
  }
}
@media (max-width: 720px) {
  /* La barre du bas reste sur deux lignes : l’état, puis les actions,
     chaque action gardant une cible tactile pleine hauteur. */
  .bottom-bar {
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3) var(--space-3);
  }
  .system-status {
    flex: 1 1 100%;
  }
  .export-actions {
    flex: 1 1 100%;
    gap: var(--space-2);
  }
  .export-actions > * {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
  .export-actions .primary,
  .export-actions a.primary {
    padding: 12px 10px;
    font-size: 13px;
  }
}
@media (max-width: 560px) {
  /* Le barème reste accessible depuis la confirmation d’export. */
  #pricing {
    display: none;
  }
}
@media (max-width: 520px) {
  .top-actions .quiet {
    padding: 8px 6px;
  }
  .brand img {
    width: 108px;
  }
  .clip-head {
    flex-direction: column;
    gap: var(--space-1);
    align-items: flex-start;
  }
  .clip-time {
    padding: 0 var(--space-2);
  }
}

/* ---------------------------------------------- 8 · mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .meter.indeterminate > span,
  .bar-meter.indeterminate > span {
    width: 100% !important;
    transform: none;
    opacity: 0.5;
  }
}

/* ------------------------------------------- 9 · signalements de la bêta */
/* Panneau non bloquant : pas de fond assombri, le studio reste lisible et
   utilisable derrière, y compris pendant un export. */
.report-panel {
  /* Ancré à son bouton, côté bêta : il recouvre la liste des fichiers, jamais
     l'aperçu ni les réglages que le testeur est en train de décrire. */
  position: fixed;
  left: var(--space-4);
  bottom: 88px;
  z-index: 30;
  width: min(380px, calc(100vw - var(--space-4) * 2));
  max-height: min(560px, calc(100dvh - 160px));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  /* L'échelle s'arrête à 4 puis saute à 6 : --space-5 n'existe pas et la
     déclaration entière était ignorée, donc le panneau n'avait aucune marge. */
  padding: var(--space-6);
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: #132029;
  box-shadow: 0 24px 60px #00000066;
}
.report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.report-head h2 {
  font-size: 17px;
  line-height: 1.35;
  margin: 0;
  padding-top: 2px;
}
/* Le ✕ porte son propre rembourrage : on le récupère pour que son trait
   s'aligne sur le bord du texte, pas 10 px plus à l'intérieur. */
.report-head .icon-button {
  margin: -6px -10px 0 0;
}
.report-lead {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: calc(var(--space-2) * -1) 0 0;
}
.report-panel form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.report-kind button {
  font-size: 12px;
}
.report-panel textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: var(--space-3);
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: #0b141a;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}
.report-panel textarea:focus-visible {
  border-color: #7fd4c155;
}
.report-context {
  font-size: 12px;
  color: var(--muted);
}
.report-context summary {
  cursor: pointer;
  padding: var(--space-2) 0;
}
.report-context dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px var(--space-3);
  margin: 0;
  padding: var(--space-2) 0 0;
}
.report-context dt {
  color: var(--muted);
  opacity: 0.8;
}
.report-context dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.report-error:empty {
  display: none;
}
.report-error {
  font-size: 12px;
  color: #ffb4ad;
  margin: 0;
}
@media (max-width: 900px) {
  .report-panel {
    left: var(--space-3);
    right: var(--space-3);
    bottom: var(--space-3);
    width: auto;
    max-height: calc(100dvh - 120px);
  }
}

/* Liens légaux au pied de l'aide : présents, jamais mis en avant. */
.modal-legal { display: flex; gap: var(--space-4); margin: var(--space-6) 0 0; }
.modal-legal a { color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------------------
   Revue du 20 septembre 2026 — ce que le parcours en navigateur a mesuré.
   ------------------------------------------------------------------------ */

/* Bouton de signalement : libellé long quand la barre a de la place, court
   sinon. Le court sert sous 1180 px et pendant un export (.bottom-bar.busy),
   les deux cas où le long finissait écrasé en « B… ». */
.report-short { display: none; }
.bottom-bar.busy .report-long { display: none; }
.bottom-bar.busy .report-short { display: inline; }
@media (max-width: 1180px) {
  .report-long { display: none; }
  .report-short { display: inline; }
}

/* Cibles tactiles : sur téléphone, tout ce qui se touche fait 44 px. Mesuré à
   375 px : cases 16×16, croix 30×30, « Retirer » 38×22, « Aide » 41×36. */
@media (max-width: 720px) {
  /* Plus spécifique que la règle de base `input[type="checkbox"]`, qui gagnait
     l'égalité et laissait la case à 16 px : mesuré 38×38 au lieu de 44. */
  input[type="checkbox"].asset-check {
    width: 22px;
    height: 22px;
    margin: 11px;
  }
  .asset-remove,
  .report-open,
  #help,
  #verdict button,
  .library-actions button,
  .bulk-confirm button,
  .asset-confirm button {
    min-height: 44px;
    min-width: 44px;
  }
}
