/* Le Studio de la Natasuite : les huit modes (Preset client, Studio libre, Pixel art, Sprites, Palosuite, Vidéo,
   Palo-ouinouin, Drama de fruits) dans la coquille commune (chantier 1, maquette de Claude Design).
   Mise en page : le titre et ses étiquettes de coût, les onglets soulignés des modes, puis deux colonnes qui se
   replient : les réglages à gauche (flex 1 1 360px), l'écran tramé à droite (flex 999 1 560px), l'historique dessous.

   Les pages gardent leurs identifiants et leurs classes d'avant (field, switch, dropzone, gallery…) : leurs scripts
   n'ont pas changé. Ce fichier les redessine en papier et encre, sous body.suite, à la place de style.css (que ces
   pages ne chargent plus). Les variables d'avant (--border, --panel-2, --muted…) sont redéfinies sur les jetons de la
   Natasuite : un style resté dans une page les lit sans le savoir. Aucune couleur en dur ici (jetons de suite.css). */

/* ============================== Correspondances ============================== */
body.suite {
  --bg: var(--papier);
  --panel: var(--feuille);
  --panel-2: var(--feuille);
  --panel-3: var(--trame-claire);
  --border: var(--filet-leger);
  --border-soft: var(--filet-leger);
  --text: var(--encre);
  --muted: var(--encre-2);
  --accent: var(--encre);
  --accent-2: var(--encre);
  --accent-grad: var(--encre);
  --accent-soft: var(--feuille);
  --teal: var(--vert);
  --danger: var(--brique);
  --on-accent: var(--papier);
  --info-bg: var(--feuille);
  --info-border: var(--filet-leger);
  --info-text: var(--encre);
  --err-bg: var(--feuille);
  --err-border: var(--brique);
  --err-text: var(--brique);
  --ok-bg: var(--feuille);
  --ok-border: var(--vert);
  --ok-text: var(--vert);
  --warn-text: var(--ocre);
  --skeleton-1: var(--trame-claire);
  --skeleton-2: var(--feuille);
  --radius: var(--rayon);
  --radius-sm: var(--rayon);
  --shadow: none;
  --ring: 0 0 0 0 transparent;
}

/* ============================== En-tête de page ============================== */
.studio-tete {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
}
.studio-tete__titres { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* Le coût de l'image et la dépense du jour, en petites étiquettes. */
.studio-tete__couts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
}
.studio-tete__etiquettes { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 16px; }
.etiquette-cout,
body.suite .cost-est,
body.suite .cost-total {
  display: inline-block;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--encre-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.etiquette-cout:empty { display: none; }
/* La première étiquette visible (le coût de ce qu'on va lancer) porte le cachet du Studio. */
.studio-tete__etiquettes > .etiquette-cout:first-child::before,
.studio-tete__etiquettes > .etiquette-cout:first-child:empty + .etiquette-cout::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  vertical-align: 0;
  background: var(--brique);
}
.etiquette-cout b, body.suite .cost-row b { color: var(--encre); font-weight: 600; }
.studio-tete__quota { text-align: right; font-size: 12px; }
.studio-tete__quota:empty, .reglages__quota:empty { display: none; }
.reglages__quota { font-size: 13px; }

/* Onglets des modes : soulignés (suite.css), plus grands que ceux d'une page, à la ligne au téléphone. */
.studio-onglets { gap: 0 26px; font-size: 15px; }
.studio-onglets > a { height: 42px; }

/* ============================== Les deux colonnes ============================== */
.studio-plan {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 32px 36px;
}
.reglages { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; }
.ecran-zone { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
/* Une vue sans colonne de réglages (bibliothèque des Sprites…) : toute la largeur. */
.studio-plan--plein > * { flex: 1 1 100%; }

/* ============================== Panneau de réglages ============================== */
.reglages__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--filet-leger);
}
.reglages > :first-child { padding-top: 0; border-top: 0; }
.reglages__section > .etiquette, .reglages__titre { margin: 0; }
.reglages__intro { font-size: 15px; line-height: 1.5; }
.reglages__pied {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}
.reglages__pied .meta { line-height: 1.45; }
/* Un titre de partie d'avant (h3.form-sec) : l'étiquette d'une section. */
body.suite .form-sec {
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--filet-leger);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--encre-2);
}
body.suite .fmt-h2 { font-size: 22px; margin: 0; }
body.suite .section-sub { font-style: italic; color: var(--encre-2); font-size: 15px; margin: 0; }
body.suite .muted { color: var(--encre-2); font-weight: 400; }
body.suite strong { font-weight: 600; }

/* Champs */
body.suite .field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
body.suite .reglages__section > .field + .field { margin-top: 2px; }
body.suite .field-label,
.champ-libelle {
  display: block;
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--encre-2);
}
body.suite .grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
/* Les aides sous les champs : des légendes. */
body.suite .hint {
  display: block;
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.45;
  color: var(--encre-2);
}
body.suite .hint:empty { display: none; }

body.suite select,
body.suite input:not([type]),
body.suite input[type='text'],
body.suite input[type='number'],
body.suite input[type='password'],
body.suite input[type='search'],
body.suite input[type='url'],
body.suite input[type='email'],
body.suite textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background-color: var(--feuille);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 14px;
  box-shadow: none;
}
body.suite textarea {
  padding: 10px 12px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
}
body.suite input[type='number'] { font-variant-numeric: tabular-nums; }
/* Le menu : une pointe pleine, dessinée en deux demi-carrés (pas de dégradé visible ni d'image en dur). */
body.suite select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  cursor: pointer;
  text-overflow: ellipsis;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--encre) 50%),
    linear-gradient(135deg, var(--encre) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
body.suite select[multiple] { background-image: none; padding: 6px; }
body.suite select:focus-visible,
body.suite input:focus-visible,
body.suite textarea:focus-visible { outline: 2px solid var(--encre); outline-offset: 1px; }
body.suite select:disabled,
body.suite input:disabled,
body.suite textarea:disabled { border-style: dashed; border-color: var(--filet-leger); color: var(--encre-2); cursor: default; }
body.suite option:disabled { color: var(--encre-2); }

/* Format personnalisé : largeur × hauteur sous le menu Format (auth.js). */
body.suite .format-perso { display: flex; align-items: center; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
body.suite .format-perso input[type='number'] { width: 96px; flex: 0 0 auto; }
body.suite .format-perso-x { color: var(--encre-2); font-family: var(--sans); }
body.suite .format-perso-etat { font-family: var(--sans); font-size: 12.5px; color: var(--encre-2); }
body.suite .format-perso-etat.is-ko { color: var(--brique); }

/* Puces et segments posés par studio-coquille.js sur les menus marqués data-puces / data-segments : le menu reste la
   valeur que lit le script de la page, les boutons le pilotent. */
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puces .puce { min-height: 34px; height: auto; padding: 4px 12px; color: var(--encre); }
.puces .puce[aria-pressed='true'] { color: var(--papier); }
.puces .puce:disabled,
.segments__bouton:disabled { border-style: dashed; border-color: var(--filet-leger); color: var(--encre-2); cursor: default; }
.puces .puce[aria-pressed='true']:disabled { background: transparent; color: var(--encre-2); }
.segments {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  overflow: hidden;
  width: 100%;
}
.segments__bouton {
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  font-weight: 600;
  border: 0;
  border-left: 1px solid var(--encre);
  background: transparent;
  color: var(--encre);
  font-family: var(--sans);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.segments__bouton:first-child { border-left: 0; }
/* Un seul choix possible : un segment seul, à sa taille. */
.segments:has(> .segments__bouton:only-child) { width: fit-content; min-width: 96px; }
.segments__bouton[aria-pressed='true'] { background: var(--encre); color: var(--papier); font-weight: 600; }
.segments__bouton:disabled { border-style: solid; border-left-color: var(--encre); text-decoration: line-through; }
.segments__bouton:focus-visible, .puces .puce:focus-visible { outline-offset: -4px; }
/* Le prix d'une définition, sous les segments. */
.segments-note { font-style: italic; font-size: 13px; color: var(--encre-2); }
.segments-note:empty { display: none; }

/* Contrôles segmentés d'avant (.seg / .seg-btn.is-on : modes du Pixel art, durée de la vidéo…). */
body.suite .seg {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 1px 1px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  max-width: 100%;
}
/* Chaque segment a son cadre, chevauché d'un pixel par le voisin : la rangée passe à la ligne sans filet manquant. */
body.suite .seg-btn {
  flex: 1 1 0;
  min-height: 40px;
  margin: 0 -1px -1px 0;
  padding: 0 14px;
  border: 1px solid var(--encre);
  border-radius: 0;
  background: transparent;
  color: var(--encre);
  font-family: var(--sans);
  font-size: 13.5px;
  cursor: pointer;
}
body.suite .seg-btn:focus-visible { position: relative; z-index: 1; }
body.suite .seg-btn:hover { background: var(--feuille); color: var(--encre); }
body.suite .seg-btn.is-on,
body.suite .seg-btn[aria-checked='true'],
body.suite .seg-btn[aria-pressed='true'] { background: var(--encre); color: var(--papier); font-weight: 600; }
body.suite .seg-btn:disabled { color: var(--encre-2); text-decoration: line-through; cursor: default; }

/* Cases : l'interrupteur d'avant (label.switch > input + .switch-track + .switch-label) devient la case carrée de la
   Natasuite. La vraie case est visible et prend le clavier ; la piste ne sert plus. */
body.suite .switch {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 40px;
  margin: 0;
  padding: 10px 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
}
body.suite .switch input,
body.suite .case input {
  position: static;
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  padding: 0;
  border: 1px solid var(--encre);
  border-radius: var(--rayon-case);
  background: transparent;
  display: grid;
  place-content: center;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}
body.suite .switch input::before {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2.5px solid var(--papier);
  border-bottom: 2.5px solid var(--papier);
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}
body.suite .switch input:checked,
body.suite .case input:checked { background: var(--encre); }
body.suite .switch input:checked::before,
body.suite .case input:checked::before { opacity: 1; }
body.suite .switch input:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }
body.suite .switch input:disabled { border-style: dashed; border-color: var(--filet-leger); cursor: default; }
body.suite .switch input:disabled:checked { background: var(--filet-leger); }
body.suite .switch input:disabled ~ .switch-label { color: var(--encre-2); }
body.suite .switch-track { display: none; }
body.suite .switch-stack { gap: 0; }
body.suite .switch-stack .switch { margin: 0; }
body.suite .switch + .hint, body.suite .switch-stack > .hint { margin-top: 2px; }

/* Zone de dépôt : pointillés à l'encre sur la trame large. */
body.suite .dropzone {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 84px;
  padding: 12px;
  border: 1px dashed var(--encre);
  border-radius: var(--rayon);
  background-color: var(--feuille);
  background-image: repeating-conic-gradient(var(--trame-claire) 0 25%, transparent 0 50%);
  background-size: 4px 4px;
  color: var(--encre-2);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}
/* La flèche vers le haut, au trait, tant qu'aucun aperçu n'occupe la zone. */
body.suite .dropzone:not(:has(img:not([hidden])))::before {
  content: '';
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: var(--encre);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V5M7 10l5-5 5 5M4 19h16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V5M7 10l5-5 5 5M4 19h16'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.suite .dropzone:hover { border-style: solid; }
body.suite .dropzone.drag { border-style: solid; outline: 1px solid var(--encre); outline-offset: -4px; }
/* Le contour du clavier seulement (un clic, ou le focus rendu par un script, ne l'allume pas). */
body.suite .dropzone:has(input:focus-visible) { outline: 2px solid var(--encre); outline-offset: 2px; }
body.suite .dropzone img { max-width: 100%; max-height: 190px; border: 1px solid var(--filet-leger); display: block; }
body.suite .ref-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--papier);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
}

/* Vignettes des photos jointes. */
body.suite .photo-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
body.suite .photo-row:empty { display: none; }
body.suite .thumb { position: relative; width: 84px; height: 84px; }
body.suite .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 1px solid var(--encre);
  border-radius: 0;
  background-color: var(--feuille);
}
body.suite .thumb.is-off img { opacity: 0.4; filter: grayscale(1); border-style: dashed; }
body.suite .thumb-del,
body.suite .gthumb-del {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--papier);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
body.suite .thumb-del:hover, body.suite .gthumb-del:hover { color: var(--brique); border-color: var(--brique); }
body.suite .thumb-del .icone, body.suite .gthumb-del .icone { width: 14px; height: 14px; }
body.suite .photo-aside {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--filet-leger);
  border-left: 3px solid var(--encre-2);
  border-radius: var(--rayon);
  background: var(--feuille);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--encre);
}

/* La fiche du modèle choisi (Studio libre) : une ligne, déplier pour la note. */
body.suite .model-info {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-style: italic;
  font-size: 13px;
  line-height: 1.45;
  color: var(--encre-2);
}
body.suite .mi-resume {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  width: 100%;
  min-height: 34px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--encre);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
body.suite .mi-resume b { font-weight: 600; }
body.suite .mi-caret { display: inline-block; width: 12px; color: var(--encre-2); }
body.suite .mi-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
body.suite .mi-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border: 1px solid var(--filet-leger);
  border-radius: var(--rayon);
  background: var(--papier);
  font-size: 12px;
  color: var(--encre-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
body.suite .mi-caret::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(-45deg);
}
body.suite .mi-resume[aria-expanded='true'] .mi-caret::before { transform: translateY(-3px) rotate(45deg); }
body.suite .mi-detail { padding: 6px 0 0; }
body.suite .mi-legende { margin: 0; }
body.suite .mi-plus {
  padding: 0;
  border: 0;
  background: none;
  font-style: normal;
  cursor: pointer;
}
body.suite .model-info p { margin: 0 0 6px; }
body.suite .model-info .mi-note { color: var(--encre-2); }

/* Sections repliables (details.fiche-sec, réglages avancés) : un filet léger, l'étiquette et un chevron au trait. */
body.suite .fiche-sec {
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--filet-leger);
}
body.suite .fiche-sec > *:not(summary) { margin-top: 12px; }
body.suite .fiche-sec[open] { padding-bottom: 20px; }
body.suite .sec-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-height: 48px;
  padding: 6px 0;
  list-style: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--encre-2);
}
body.suite .sec-head::-webkit-details-marker { display: none; }
body.suite .sec-head::before {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  margin-right: 2px;
  flex-shrink: 0;
}
body.suite details[open] > .sec-head::before { transform: rotate(45deg); margin-top: -4px; }
body.suite .sec-head:hover { color: var(--encre); }
body.suite .sec-recap {
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--encre-2);
}
body.suite .reglages-avances { margin: 0; }

/* ============================== Boutons d'avant ============================== */
body.suite .btn-primary,
body.suite .btn-secondary,
body.suite .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: transparent;
  color: var(--encre);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}
body.suite .btn-primary {
  border-color: var(--brique);
  background: var(--brique);
  color: var(--sur-couleur);
  font-weight: 600;
}
body.suite .btn-primary:hover { background: var(--brique); color: var(--sur-couleur); opacity: 0.9; transform: none; box-shadow: none; }
body.suite .btn-secondary:hover { background: var(--feuille); color: var(--encre); }
body.suite .btn-ghost { border-color: var(--filet-leger); color: var(--encre-2); }
body.suite .btn-ghost:hover { color: var(--encre); border-color: var(--encre); background: transparent; }
body.suite .btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
body.suite .btn-block { width: 100%; }
body.suite .btn-primary:disabled,
body.suite .btn-secondary:disabled,
body.suite .btn-ghost:disabled,
body.suite .btn-primary[aria-disabled='true'] {
  border-style: dashed;
  border-color: var(--filet-leger);
  background: transparent;
  color: var(--encre-2);
  opacity: 1;
  cursor: default;
}
body.suite a.btn-secondary[href=''], body.suite a.btn-secondary:not([href]) { cursor: default; }

/* Le coût d'un appel d'IA, écrit après le libellé du bouton qui le lance (Couts.lier, auth.js). */
body.suite [data-cout]::after {
  content: '· ' attr(data-cout);
  margin-left: 0;
  font-weight: 400;
  opacity: 0.9;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* L'action principale : la brique, pleine largeur, le raccourci à droite. */
.studio-generer {
  width: 100%;
  height: auto;
  min-height: 50px;
  justify-content: flex-start;
  padding: 0 18px;
  font-size: 15px;
}
.studio-generer[data-raccourci]::before {
  content: attr(data-raccourci);
  order: 2;
  margin-left: auto;
  padding-left: 12px;
  font-weight: 400;
  font-size: 13px;
  opacity: 0.85;
  letter-spacing: 0.04em;
}

/* Au doigt, pas de clavier : le raccourci ne se montre pas. */
@media (hover: none) and (pointer: coarse) {
  .studio-generer[data-raccourci]::before { content: none; }
}

/* ============================== Écran ============================== */
/* Le bandeau de statut : une ligne au-dessus de l'écran, sans spinner (une trame qui dit l'attente). */
body.suite .status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--filet-leger);
  border-radius: var(--rayon);
  background: var(--feuille);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--encre);
}
body.suite .status-top { margin: 0; }
body.suite .status.err { border-color: var(--brique); color: var(--brique); background: var(--feuille); }
body.suite .status.ok { border-color: var(--vert); color: var(--vert); }
body.suite .status.loading { background: var(--feuille); border-color: var(--filet-leger); color: var(--encre); }
body.suite .status.loading::before {
  content: '';
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 1px solid var(--encre);
  border-radius: 0;
  background-color: var(--feuille);
  background-image: repeating-conic-gradient(var(--trame) 0 25%, transparent 0 50%);
  background-size: 3px 3px;
  animation: none;
}

body.suite .error-details {
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--brique);
  border-radius: var(--rayon);
  background: var(--feuille);
  font-family: var(--sans);
  font-size: 13px;
}
body.suite .error-details summary {
  display: flex;
  align-items: center;
  min-height: 40px;
  cursor: pointer;
  color: var(--brique);
  font-weight: 600;
}
body.suite .error-details pre {
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid var(--filet-leger);
  border-radius: var(--rayon);
  background: var(--papier);
  color: var(--encre);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
}
body.suite .error-details .btn-ghost, body.suite .error-details .btn-sm { margin-bottom: 10px; }

/* Le cadre : l'écran, 16/10, à l'encre, sur la trame. L'image s'y loge entière. */
.ecran {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ecran__cadre {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  width: 100%;
  padding: 24px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  overflow: hidden;
}
/* La trame large de la maquette, sous l'écran. */
.ecran__cadre.trame { background-image: repeating-conic-gradient(var(--trame-claire) 0 25%, transparent 0 50%); background-size: 4px 4px; }
.ecran__cadre > * { grid-area: 1 / 1; }
/* Le résultat couvre tout le cadre (padding compris) : hors de la grille, sa boîte est celle du cadre. */
.ecran__cadre > img,
.ecran__cadre > video,
.ecran__cadre > .ecran__ligne,
.ecran__cadre > .ecran__etat { grid-area: auto; }
.ecran__cadre img,
.ecran__cadre video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ecran__cadre img:not([src]), .ecran__cadre img[src=''] { display: none; }
/* Une vidéo laisse ses commandes au-dessus des deux lectures du bas. */
.ecran__cadre > video { top: 0; bottom: 44px; height: auto; }
/* L'encart au centre, tant que rien n'est généré : feuille et filet léger, le message en italique. */
body.suite .placeholder,
.ecran__vide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 0;
  max-width: min(100%, 420px);
  padding: 18px 26px;
  border: 1px solid var(--filet-leger);
  border-radius: 0;
  background: var(--feuille);
  text-align: center;
  color: var(--encre);
}
body.suite .placeholder p,
.ecran__vide p {
  margin: 0;
  font-style: italic;
  font-size: 18px;
  line-height: 1.35;
  color: var(--encre);
}
body.suite .placeholder .muted { font-size: 13px; }
body.suite .ph-icon { display: none; }
/* L'attente : le message change, la trame reste (jamais de spinner). */
body.suite .placeholder.is-loading { animation: none; background: var(--feuille); color: var(--encre); }
body.suite .placeholder.is-loading > * { display: none; }
body.suite .placeholder.is-loading::after {
  content: attr(data-attente);
  font-style: italic;
  font-size: 18px;
}
body.suite .placeholder.is-loading:not([data-attente])::after { content: 'Génération en cours…'; }
/* La ligne du bas : modèle · format · définition · coût. */
.ecran__ligne {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--encre-2);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ecran__ligne:empty { display: none; }
/* Les deux lectures du bas de l'écran, sur la feuille : à gauche « modèle · format · définition · coût », à droite
   l'état (« Prêt », « En cours », « Échec »). */
.ecran__cadre .ecran__ligne,
.ecran__etat {
  position: absolute;
  bottom: 12px;
  z-index: 1;
  padding: 2px 6px;
  background: var(--feuille);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--encre-2);
}
.ecran__cadre .ecran__ligne {
  left: 14px;
  max-width: calc(100% - 100px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ecran__etat { right: 14px; white-space: nowrap; }
.ecran__etat[data-etat='en-cours'] { color: var(--encre); }
.ecran__etat[data-etat='echec'] { color: var(--brique); }

/* Le résultat d'avant (.result-frame), quand une page le garde hors du cadre. */
body.suite .result-frame {
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  overflow: hidden;
  background-color: var(--feuille);
  background-image: repeating-conic-gradient(var(--trame) 0 25%, transparent 0 50%);
  background-size: 3px 3px;
  box-shadow: none;
}
body.suite .result-frame img { display: block; width: 100%; animation: none; }

/* Actions sous l'écran. */
body.suite .result-actions,
.ecran__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
body.suite #output { display: flex; flex-direction: column; gap: 12px; }
body.suite #output[hidden] { display: none; }

/* Un bouton qui déplie un panneau (Prompt utilisé) : enfoncé tant que le panneau est ouvert. */
.btn[aria-expanded='true'] { background: var(--encre); color: var(--papier); }
.btn[aria-expanded='true']:hover { background: var(--encre); color: var(--papier); opacity: 0.9; }

/* Panneaux dépliés par une action (Prompt utilisé, Alt-text). */
.ecran__deplie,
body.suite .alt-box,
body.suite .prompt-box p {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--filet-leger);
  border-left: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--feuille);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--encre);
  overflow-wrap: anywhere;
}
.ecran__deplie { display: flex; flex-direction: column; gap: 8px; }
.ecran__deplie .meta, .ecran__deplie .hint { margin: 0; }
body.suite .alt-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
body.suite .alt-box p { margin: 0; color: var(--encre); font-size: 14.5px; }
body.suite .prompt-box { margin: 0; font-family: var(--sans); font-size: 13px; color: var(--encre-2); }
body.suite .prompt-box summary { display: flex; align-items: center; min-height: 40px; cursor: pointer; }
body.suite .prompt-box summary:hover { color: var(--encre); }
body.suite .prompt-box p { font-family: var(--serif); }

/* ============================== Historique ============================== */
.historique { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; border-top: 1px solid var(--filet); }
.historique[hidden] { display: none; }
/* Rien dans l'historique : pas de filet qui ne ferme rien. */
.historique:has(> .gallery-head[hidden]):has(> .gallery:empty) { display: none; }
/* La tête d'un historique (ou d'une série) : le titre en serif, son compte en .meta, les liens à droite. */
body.suite .gallery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--encre);
}
body.suite .gallery-head > span:first-child,
body.suite .gallery-head > h2:first-child { margin: 0 auto 0 0; font-size: 20px; font-weight: 400; line-height: 1.2; }
body.suite .gallery-head .meta { margin-left: 6px; }
/* « Voir tout » (Tools.boutonVoirTout) et « Vider » : des liens, pas des boutons. */
body.suite .js-voir-tout,
body.suite .gallery-clear,
body.suite .gallery-head .btn-ghost {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--encre-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
/* « Voir tout » en brique : il mène ailleurs. */
body.suite .js-voir-tout { color: var(--brique); }
body.suite .js-voir-tout:hover { color: var(--brique); opacity: 0.85; }
body.suite .gallery-clear:hover { color: var(--brique); }
/* Les vignettes, numérotées à rebours (le plus récent porte le plus grand numéro) : studio-coquille.js pose
   --depart = total + 1 et --pas = -1 sur la grille (data-total du script, sinon le nombre de vignettes) ; sans lui,
   elles se numérotent de 1 à n. */
body.suite .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(96px, 100%), 1fr));
  gap: 8px;
  counter-reset: vignette var(--depart, 0);
}
body.suite .gallery:empty { display: none; }
body.suite .gthumb { position: relative; counter-increment: vignette var(--pas, 1); }
body.suite .gthumb img,
body.suite .gthumb-video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background-color: var(--feuille);
  background-image: repeating-conic-gradient(var(--trame) 0 25%, transparent 0 50%);
  background-size: 3px 3px;
  cursor: pointer;
  animation: none;
  transition: none;
  transform: none;
}
body.suite .gthumb img:hover { transform: none; outline: 1px solid var(--encre); outline-offset: 2px; }
body.suite .gthumb img:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }
body.suite .gthumb-video { display: grid; place-items: center; font-family: var(--sans); font-size: 13px; color: var(--encre-2); }
body.suite .gthumb video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background-color: var(--feuille);
  background-image: repeating-conic-gradient(var(--trame) 0 25%, transparent 0 50%);
  background-size: 3px 3px;
  cursor: pointer;
}
/* Le numéro de la vignette, en bas à gauche. */
body.suite .gthumb::before {
  content: counter(vignette);
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 0 4px;
  background: var(--feuille);
  font-family: var(--sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--encre);
  pointer-events: none;
  z-index: 1;
}
body.suite .gthumb-del { opacity: 0; z-index: 2; }
body.suite .gthumb:hover .gthumb-del,
body.suite .gthumb:focus-within .gthumb-del { opacity: 1; }
@media (hover: none) { body.suite .gthumb-del { opacity: 1; } }
body.suite .gthumb-owner {
  position: absolute;
  right: 6px;
  bottom: 6px;
  max-width: calc(100% - 48px);
  padding: 0 4px;
  background: var(--feuille);
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--encre);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

/* Damier de transparence (Pixel art, Palosuite) : la trame large. */
body.suite .damier {
  background-color: var(--feuille);
  background-image: repeating-conic-gradient(var(--trame-claire) 0 25%, transparent 0 50%);
  background-size: 8px 8px;
  background-position: 0 0;
  border-radius: var(--rayon);
}

/* La bulle (.toast), la phrase d'un raccourci (.raccourci-texte) et le cadre d'une suite sœur : suite.css. */

/* ============================== Fiche d'une image d'archive (auth.js) ============================== */
body.suite .apercu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, var(--papier) 86%, transparent);
  backdrop-filter: none;
}
body.suite .apercu-boite {
  display: flex;
  flex-direction: column;
  width: min(1040px, 100%);
  max-height: 100%;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--feuille);
  box-shadow: none;
  overflow: hidden;
}
body.suite .apercu-tete {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--encre);
}
body.suite .apercu-tete h3 {
  flex: 1;
  margin: 0;
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.suite .apercu-corps {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  padding: 16px;
  overflow: auto;
}
body.suite .apercu-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background-color: var(--feuille);
  background-image: repeating-conic-gradient(var(--trame) 0 25%, transparent 0 50%);
  background-size: 3px 3px;
  background-position: 0 0;
}
body.suite .apercu-image img { max-width: 100%; max-height: 62vh; display: block; border-radius: 0; }
body.suite .apercu-infos { min-width: 0; font-family: var(--sans); }
body.suite .apercu-infos h4 {
  margin: 18px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--encre-2);
}
body.suite .apercu-liste { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 13px; }
body.suite .apercu-liste dt { color: var(--encre-2); }
body.suite .apercu-liste dd { margin: 0; word-break: break-word; }
body.suite .apercu-prompt {
  margin: 0 0 8px;
  padding: 10px 12px;
  max-height: 34vh;
  overflow: auto;
  border: 1px solid var(--filet-leger);
  border-radius: var(--rayon);
  background: var(--papier);
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
body.suite .apercu-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
body.suite .apercu-refs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 4px; }
body.suite .apercu-refs a { display: block; line-height: 0; border: 1px solid var(--encre); border-radius: 0; overflow: hidden; }
body.suite .apercu-refs img { width: 84px; height: 84px; object-fit: cover; display: block; }

/* ============================== Lot de prompts (Preset client) ============================== */
body.suite .lot-bloc textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
body.suite .lot-sections { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
body.suite .lot-sections > li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: baseline;
  padding: 8px 11px;
  border: 1px solid var(--filet-leger);
  border-radius: var(--rayon);
  background: var(--feuille);
  font-family: var(--sans);
  font-size: 13px;
}
body.suite .lot-sections > li.is-err { border-color: var(--brique); }
body.suite .lot-sections > li.is-ok { border-color: var(--vert); }
body.suite .lot-sections > li.is-run { border-color: var(--encre); }
body.suite .lot-slug { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
body.suite .lot-etat { color: var(--encre-2); }
body.suite .lot-sections > li.is-err .lot-etat { color: var(--brique); }
body.suite .lot-sections > li.is-ok .lot-etat { color: var(--vert); }
body.suite .lot-notes { grid-column: 1 / -1; margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
body.suite .lot-notes .is-err { color: var(--brique); }
body.suite .lot-notes .is-warn { color: var(--ocre); }
body.suite .lot-actions { margin: 0; }
body.suite .lot-actions .btn-primary { flex: 1; }
body.suite .lot-output { display: flex; flex-direction: column; gap: 12px; }
body.suite .lot-output[hidden] { display: none; }
body.suite .lot-head a { min-height: 36px; }
body.suite .lot-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
body.suite .lot-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--feuille);
}
body.suite .lot-card.is-err { border-color: var(--brique); }
body.suite .lot-card .lot-img,
body.suite .lot-card .lot-attente {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: grid;
  place-items: center;
  border: 1px solid var(--filet-leger);
  background-color: var(--feuille);
  background-image: repeating-conic-gradient(var(--trame) 0 25%, transparent 0 50%);
  background-size: 3px 3px;
  font-family: var(--sans);
  font-size: 12px;
  font-style: italic;
  color: var(--encre-2);
  cursor: pointer;
}
body.suite .lot-card.is-run .lot-attente { animation: none; }
body.suite .lot-card .lot-slug { font-size: 12px; word-break: break-all; }
body.suite .lot-card .lot-etat { font-family: var(--sans); font-size: 12px; line-height: 1.4; }
body.suite .lot-card.is-err .lot-etat { color: var(--brique); }
body.suite .lot-card .result-actions { gap: 6px; }
body.suite .lot-card .result-actions > * { min-height: 34px; height: auto; padding: 4px 10px; font-size: 12.5px; white-space: normal; flex-wrap: wrap; }

/* ============================== Vidéo (fiche guidée) : pièces communes ============================== */
body.suite .recipe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 8px; }
body.suite .recipe-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--filet-leger);
  border-radius: var(--rayon);
  background: transparent;
  color: var(--encre);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transform: none;
}
body.suite .recipe-card:hover { border-color: var(--encre); transform: none; }
body.suite .recipe-card.is-active { border-color: var(--encre); background: var(--feuille); outline: 1px solid var(--encre); outline-offset: -3px; }
body.suite .rc-emoji { display: none; }
body.suite .rc-name { font-family: var(--sans); font-size: 14px; font-weight: 600; }
body.suite .rc-tag { font-size: 13px; font-style: italic; color: var(--encre-2); line-height: 1.35; }
body.suite .warnbox { display: flex; flex-direction: column; gap: 8px; margin: 0; }
body.suite .warnbox:empty { display: none; }
body.suite .warn-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--filet-leger);
  border-left: 3px solid var(--ocre);
  border-radius: var(--rayon);
  background: var(--feuille);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
}
body.suite .warn-item .btn-sm { flex: 0 0 auto; margin-left: auto; }
body.suite .prompt-preview {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--filet-leger);
  border-radius: var(--rayon);
  background: var(--feuille);
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
body.suite .spec-list { margin: 0; font-family: var(--sans); font-size: 13px; color: var(--encre-2); }
body.suite .seed-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.suite .seed-row input { flex: 1; min-width: 120px; }

/* Compteur de caractères et rangée d'actions d'un champ (Vidéo, Drama). */
body.suite .fmt-count { font-family: var(--sans); font-size: 13px; color: var(--encre-2); font-variant-numeric: tabular-nums; }
body.suite .fmt-count.over { color: var(--brique); font-weight: 600; }
body.suite .fmt-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Sous-vues d'un mode (Sprites, Palosuite) : des puces sous les onglets. */
body.suite .subtabs-wrap { margin: 0; padding: 0; max-width: none; }
body.suite .subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 0;
}
body.suite .subtab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  background: transparent;
  color: var(--encre);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}
body.suite .subtab:hover { background: var(--feuille); color: var(--encre); }
body.suite .subtab.active,
body.suite .subtab[aria-current='page'],
body.suite .subtab[aria-selected='true'] { background: var(--encre); color: var(--papier); font-weight: 600; }

/* La connexion (auth.js) garde son bouton à l'encre, même survolé. */
body.suite .auth-card .btn-primary:hover { border-color: var(--encre); background: var(--encre); color: var(--papier); }

/* ============================== Téléphone ============================== */
@media (max-width: 720px) {
  .studio-tete .titre-page { font-size: 34px; }
  .ecran__cadre { padding: 12px 12px 34px; }
  .ecran__cadre .ecran__ligne, .ecran__etat { bottom: 8px; }
  .ecran__cadre .ecran__ligne { left: 8px; max-width: calc(100% - 76px); }
  .ecran__etat { right: 8px; }
  body.suite .placeholder, .ecran__vide { padding: 12px 16px; }
  body.suite .placeholder p, .ecran__vide p { font-size: 16px; }
  body.suite .grid-2 { grid-template-columns: 1fr; }
  .studio-tete { align-items: flex-start; }
  .studio-tete__couts { align-items: flex-start; }
  .studio-tete__etiquettes { justify-content: flex-start; }
  .studio-tete__quota { text-align: left; }
  .studio-onglets { gap: 0 18px; }
  .studio-plan { gap: 26px; }
  body.suite .apercu { padding: 10px; }
  body.suite .apercu-corps { grid-template-columns: 1fr; }
  body.suite .apercu-image img { max-height: 38vh; }
  .segments { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .segments__bouton, body.suite .seg-btn, body.suite .subtab { transition: background-color 0.12s ease; }
}
