/* ProductStudio — thème « Salle obscure »
   L'interface est la salle : sombre, elle s'efface. La vidéo du client est
   l'écran, seule chose vraiment lumineuse. L'ambre du projecteur sert à
   l'action et à la sélection ; le velours rouge reste au décor (fauteuils,
   billets, popcorn), jamais sur un bouton d'action. Les clins d'œil cinéma
   n'apparaissent qu'à l'arrivée, pendant le montage et à la projection. */

:root {
  /* Fonds — la salle */
  --ptm-bg: #0C0C0E;          /* fond de page */
  --ptm-surface: #17171A;     /* cartes, panneaux, champs */
  --ptm-surface-2: #1F1F23;   /* puces, avatar, hover */
  --ptm-surface-3: #2A2A2F;   /* segment actif, piste de timeline */
  --ptm-foyer: #120F10;       /* bande « À l'affiche » sous les fauteuils */
  --ptm-line: #2A2A2F;        /* bordures 1px */
  --ptm-line-soft: #1F1F23;   /* séparateurs, bas de l'en-tête */

  /* Texte */
  --ptm-text: #F2F2F4;
  --ptm-text-2: #D9D9DE;      /* texte de scène */
  --ptm-muted: #9A9AA2;       /* secondaire (7:1 sur --ptm-bg) */

  /* Lumière du projecteur — accent d'action */
  --ptm-amber: #F2B544;
  --ptm-amber-hover: #FFD07A;
  --ptm-on-amber: #0C0C0E;

  /* Écran — bouton final (« Écrire le script », « Lancer le montage », « Télécharger ») */
  --ptm-screen: #F2F2F4;

  /* Velours — décor uniquement */
  --ptm-velvet: #B3262E;
  --ptm-velvet-ink: #FFD9DB;
  --ptm-seat-1: #3A0C10;
  --ptm-seat-2: #4C1016;
  --ptm-seat-3: #62151C;
  --ptm-rec: #E5484D;

  /* Popcorn */
  --ptm-pop-1: #FFF1D0;
  --ptm-pop-2: #FFF6E2;
  --ptm-pop-3: #FBE3AE;
  --ptm-butter: #F2C46B;
  --ptm-bucket-cream: #F4E9D3;
  --ptm-bucket-rim: #E9DCC2;

  /* Valeurs reprises telles quelles des maquettes (mockups/*.html) */
  --ptm-foyer-line: #2A1517;  /* bord haut de la bande « À l'affiche » */
  --ptm-seat-1-edge: #5A1A20; /* liseré du dossier, par rangée */
  --ptm-seat-2-edge: #702028;
  --ptm-seat-3-edge: #8A2A33;
  --ptm-row-line: #222226;    /* séparateur des réglages repliés */
  --ptm-swatch-ring: #3A3A40; /* contour d'une pastille de couleur sombre */
  --ptm-step-todo: #4A4A52;   /* cercle d'une étape à venir */
  --ptm-ticket-plain: #1C1A1B; /* billet neutre (SRT), vignette en attente */

  /* Typo */
  --ptm-font-display: 'Schibsted Grotesk', 'Arial Narrow', sans-serif;
  --ptm-font-body: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --ptm-font-mono: 'Geist Mono', ui-monospace, monospace;
  --ptm-font-logo: 'Cinzel', 'Schibsted Grotesk', serif; /* le logo seul */

  /* Rayons */
  --ptm-r-sm: 6px;
  --ptm-r-md: 10px;
  --ptm-r-lg: 12px;
  --ptm-r-xl: 16px;
  --ptm-r-field: 18px;

  /* Lumières */
  --ptm-glow-amber: 0 0 0 2px var(--ptm-amber), 0 30px 60px -30px rgba(242, 181, 68, 0.45);
  --ptm-projector: radial-gradient(ellipse 50% 60% at 50% 0%, rgba(255, 236, 200, 0.10), rgba(255, 236, 200, 0) 70%);

  --ptm-header-h: 64px;
  --ptm-target: 44px;
  --ptm-page-x: 80px;

  color-scheme: dark;
}

@media (max-width: 1024px) {
  :root { --ptm-page-x: 40px; }
}

@media (max-width: 768px) {
  :root { --ptm-page-x: 16px; }
}

/* ------------------------------------------------------------ base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--ptm-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ptm-bg);
  color: var(--ptm-text);
  font-family: var(--ptm-font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Langue de l'interface : la page reste masquée le temps de la traduire
   (public/i18n.js), et s'affiche de toute façon au bout d'une seconde. */
html:not([data-i18n-ready]) body {
  opacity: 0;
  animation: i18n-reveal 0s 1s forwards;
}

@keyframes i18n-reveal {
  to { opacity: 1; }
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--ptm-font-display);
  text-wrap: balance;
}

h1 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 19px;
  font-weight: 700;
}

p {
  margin: 0;
}

a {
  color: var(--ptm-amber);
}

a:hover {
  color: var(--ptm-amber-hover);
}

input,
textarea,
select,
button {
  font: inherit;
  color: inherit;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--ptm-amber);
  outline-offset: 2px;
}

::selection {
  background: rgba(242, 181, 68, 0.35);
}

.mono {
  font-family: var(--ptm-font-mono);
}

.muted {
  color: var(--ptm-muted);
}

.small {
  font-size: 13px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: var(--ptm-r-md);
  background: var(--ptm-amber);
  color: var(--ptm-on-amber);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* Surtitres : PROCHAINEMENT…, AVANT-PREMIÈRE, À L'AFFICHE, TES BILLETS */
.overline {
  display: block;
  margin: 0;
  font-family: var(--ptm-font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ptm-amber);
}

.overline.is-muted {
  letter-spacing: 0.12em;
  color: var(--ptm-muted);
}

/* ------------------------------------------------------------ champs */

input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  min-height: var(--ptm-target);
  padding: 10px 14px;
  background: var(--ptm-bg);
  border: 1px solid var(--ptm-line);
  border-radius: var(--ptm-r-md);
  outline: none;
  color: var(--ptm-text);
  font-size: 15px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239A9AA2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

select option,
select optgroup {
  background: var(--ptm-surface);
  color: var(--ptm-text);
}

input::placeholder,
textarea::placeholder {
  color: var(--ptm-muted);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--ptm-amber);
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--ptm-amber);
  cursor: pointer;
}

input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 4px;
  background: var(--ptm-bg);
  border: 1px solid var(--ptm-line);
  border-radius: var(--ptm-r-md);
  cursor: pointer;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.field-hint {
  margin: 8px 0 0;
  color: var(--ptm-muted);
  font-size: 13px;
  line-height: 1.5;
}

.error {
  margin: 10px 0 0;
  color: var(--ptm-amber-hover);
  font-size: 14px;
}

/* ------------------------------------------------------------ boutons */

/* Par défaut : bouton secondaire, transparent avec un liseré. */
button,
.btn {
  min-height: var(--ptm-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--ptm-line);
  border-radius: var(--ptm-r-md);
  color: var(--ptm-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button:hover:not(:disabled),
.btn:hover {
  background: var(--ptm-surface-2);
  color: var(--ptm-text);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* « Continuer », « Moteur, action », « Appliquer » : la lumière du projecteur. */
.btn-amber {
  height: 52px;
  padding: 0 22px;
  background: var(--ptm-amber);
  border: 0;
  border-radius: var(--ptm-r-lg);
  color: var(--ptm-on-amber);
  font-size: 16px;
  font-weight: 600;
}

.btn-amber:hover:not(:disabled) {
  background: var(--ptm-amber-hover);
  color: var(--ptm-on-amber);
}

/* Action finale : l'écran (« Écrire le script », « Lancer le montage », « Télécharger »). */
.btn-screen {
  height: 52px;
  padding: 0 26px;
  background: var(--ptm-screen);
  border: 0;
  border-radius: var(--ptm-r-lg);
  color: var(--ptm-bg);
  font-size: 16px;
  font-weight: 600;
}

.btn-screen:hover:not(:disabled) {
  background: var(--ptm-screen);
  color: var(--ptm-bg);
  box-shadow: 0 0 0 3px rgba(242, 242, 244, 0.18);
}

/* Lien d'action dans le texte. */
.link,
button.link {
  min-height: var(--ptm-target);
  padding: 0;
  background: none;
  border: 0;
  color: var(--ptm-amber);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

button.link:hover:not(:disabled),
.link:hover {
  background: none;
  color: var(--ptm-amber-hover);
}

/* Petite pastille : suggestions, réglages rapides. */
.pill {
  position: relative;
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  background: var(--ptm-surface-2);
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 400;
}

.pill:hover:not(:disabled) {
  background: var(--ptm-surface-3);
}

.pill[aria-pressed="true"],
.pill[aria-checked="true"],
.pill.selected {
  background: var(--ptm-amber);
  color: var(--ptm-on-amber);
}

/* Cible de 44 px autour d'un petit contrôle. */
.pill::after,
.hit::after {
  content: "";
  position: absolute;
  inset: -6px -2px;
}

/* Bouton icône rond (lecture, son, micro) : 44 px. */
.icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
}

/* ------------------------------------------------------------ en-tête */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  flex: none;
  background: var(--ptm-bg);
  border-bottom: 1px solid var(--ptm-line-soft);
}

.topbar-inner {
  max-width: 1440px;
  height: calc(var(--ptm-header-h) - 1px);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-side {
  width: 260px;
  display: flex;
  align-items: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--ptm-target);
  color: var(--ptm-text);
  text-decoration: none;
}

.logo:hover {
  color: var(--ptm-text);
}

/* Logo : un clap de cinéma et le nom en capitales romaines espacées,
   comme au générique d'un studio. */
.logo-mark {
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  color: var(--ptm-screen);
}

.logo-text {
  display: flex;
  gap: 0.42em;
  font-family: var(--ptm-font-logo);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stepper {
  height: var(--ptm-header-h);
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: stretch;
  gap: 28px;
  font-size: 14px;
  color: var(--ptm-muted);
}

.stepper li {
  display: flex;
  align-items: center;
}

.stepper li[aria-current="step"] {
  color: var(--ptm-text);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--ptm-amber);
}

.header-right {
  justify-content: flex-end;
  gap: 18px;
  font-size: 14px;
}

.videos-link {
  min-height: var(--ptm-target);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ptm-text);
  text-decoration: none;
}

.videos-link:hover {
  color: var(--ptm-amber-hover);
}

.count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ptm-amber);
  color: var(--ptm-on-amber);
  font-family: var(--ptm-font-mono);
  font-size: 11px;
  font-weight: 500;
}

.lang-switch {
  min-width: var(--ptm-target);
  padding: 0;
  border: 0;
  color: var(--ptm-muted);
  font-family: var(--ptm-font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.lang-switch:hover:not(:disabled) {
  background: none;
  color: var(--ptm-text);
}

/* Avatar 32 px, dans une cible de 44 px. */
.avatar {
  flex: none;
  width: var(--ptm-target);
  height: var(--ptm-target);
  margin: 0 -6px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ptm-text);
  text-decoration: none;
}

.avatar-disc {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ptm-surface-2);
  font-size: 12px;
  font-weight: 600;
}

.avatar:hover .avatar-disc {
  background: var(--ptm-surface-3);
}

/* ------------------------------------------------------------ page */

.page {
  position: relative;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.page > div {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* Écran d'une étape : 1440 px au plus, centré. */
.page > div > .screen {
  flex: 1 0 auto;
  min-height: calc(100vh - var(--ptm-header-h));
}

.screen {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px var(--ptm-page-x) 40px;
}

.footer {
  flex: none;
  padding: 18px 40px;
  border-top: 1px solid var(--ptm-line-soft);
  color: var(--ptm-muted);
  font-size: 12px;
  text-align: center;
}

.footer-legal {
  margin-top: 6px;
}

.footer a {
  color: inherit;
}

/* ------------------------------------------------------------ panneaux */

.panel {
  padding: 18px;
  background: var(--ptm-surface);
  border-radius: var(--ptm-r-xl);
}

/* Réglages repliés en lignes (Script, Angle) : chaque ligne ouvre un panneau. */
.settings-rows {
  display: flex;
  flex-direction: column;
  background: var(--ptm-surface);
  border-radius: var(--ptm-r-xl);
  overflow: hidden;
}

.settings-row {
  width: 100%;
  height: 52px;
  min-height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ptm-row-line);
  border-radius: 0;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row-value {
  margin-left: auto;
  display: flex;
  gap: 4px;
  color: var(--ptm-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-row-chevron {
  flex: none;
}

.swatch {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--ptm-swatch-ring);
}

/* Panneau latéral (réglages ouverts) : <dialog> natif, à droite. */
.sheet {
  width: min(460px, 100vw);
  max-width: 100vw;
  height: 100%;
  max-height: 100%;
  margin: 0 0 0 auto;
  padding: 0;
  background: var(--ptm-surface);
  border: 0;
  border-left: 1px solid var(--ptm-line);
  color: var(--ptm-text);
}

.sheet[open] {
  display: flex;
  flex-direction: column;
}

.sheet::backdrop {
  background: rgba(12, 12, 14, 0.6);
}

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  height: var(--ptm-header-h);
  padding: 0 10px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ptm-surface);
  border-bottom: 1px solid var(--ptm-row-line);
}

.sheet-head h2 {
  font-size: 19px;
}

.sheet-close {
  border: 0;
}

.sheet-close:focus-visible {
  outline-offset: -4px;
}

.sheet-body {
  flex: 1 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sheet-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-section > .field-label {
  margin: 0;
}

.check-row {
  min-height: var(--ptm-target);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  cursor: pointer;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ------------------------------------------------------------ affiche (choix d'angle) */

.poster {
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
}

.poster-visual {
  position: relative;
  height: 240px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  border-radius: 14px;
  overflow: hidden;
  opacity: 0.85;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.poster:hover .poster-visual {
  opacity: 1;
}

.poster.is-selected .poster-visual {
  opacity: 1;
  box-shadow: var(--ptm-glow-amber);
}

.poster-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 8px;
  border-radius: var(--ptm-r-sm);
  background: var(--ptm-amber);
  color: var(--ptm-on-amber);
  font-size: 12px;
  font-weight: 600;
}

.poster-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.poster-meta input {
  margin: 2px 0 0;
}

.poster-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.poster-title {
  font-family: var(--ptm-font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.poster-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ptm-muted);
}

/* ------------------------------------------------------------ billet (téléchargement) */

.ticket {
  position: relative;
  line-height: normal;
  height: 92px;
  display: flex;
  align-items: stretch;
  padding: 0;
  background: var(--ptm-velvet);
  border: 0;
  border-radius: var(--ptm-r-md);
  color: #FFFFFF;
  text-align: left;
  text-decoration: none;
  overflow: hidden;
}

.ticket:hover,
.ticket:focus-visible {
  color: #FFFFFF;
  filter: brightness(1.08);
}

.ticket-main {
  flex-grow: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.ticket-over {
  font-family: var(--ptm-font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ptm-velvet-ink);
}

.ticket-title {
  font-family: var(--ptm-font-display);
  font-size: 19px;
  font-weight: 700;
}

.ticket-cut {
  width: 0;
  margin: 10px 0;
  border-left: 2px dashed rgba(255, 255, 255, 0.4);
}

.ticket-icon {
  flex: none;
  width: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Les deux encoches, au niveau du pointillé. */
.ticket-notch {
  position: absolute;
  right: 74px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--ptm-bg);
}

.ticket-notch-top {
  top: -9px;
}

.ticket-notch-bottom {
  bottom: -9px;
}

/* Variante neutre : sous-titres SRT. */
.ticket-plain {
  height: 72px;
  background: var(--ptm-ticket-plain);
  border: 1px solid var(--ptm-line);
  color: var(--ptm-text);
}

.ticket-plain:hover,
.ticket-plain:focus-visible {
  color: var(--ptm-text);
  filter: none;
  background: var(--ptm-surface-2);
}

.ticket-plain .ticket-main {
  padding: 12px 20px;
  gap: 2px;
}

.ticket-plain .ticket-over {
  color: var(--ptm-muted);
}

.ticket-plain .ticket-title {
  font-family: var(--ptm-font-body);
  font-size: 15px;
  font-weight: 600;
}

/* ------------------------------------------------------------ barre « pellicule » */

.filmstrip {
  position: relative;
  height: 36px;
  background: var(--ptm-surface);
  border-radius: var(--ptm-r-sm);
  overflow: hidden;
}

.filmstrip-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--ptm-amber);
  transition: width 0.6s ease;
}

.filmstrip-holes {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background-image: repeating-linear-gradient(90deg, var(--ptm-bg) 0 10px, transparent 10px 28px);
  animation: ptm-strip 0.6s linear infinite;
}

.filmstrip-holes-top {
  top: 4px;
}

.filmstrip-holes-bottom {
  bottom: 4px;
}

/* ------------------------------------------------------------ statuts des vidéos */

.status-ready,
.status-next {
  color: var(--ptm-muted);
}

.status-editing {
  color: var(--ptm-amber);
}

/* ------------------------------------------------------------ animations */

@keyframes ptm-popA { 0%{transform:translate(0,0) scale(.3) rotate(0);opacity:0} 12%{opacity:1} 55%{transform:translate(-46px,-110px) scale(1) rotate(150deg);opacity:1} 100%{transform:translate(-70px,-40px) scale(1) rotate(260deg);opacity:0} }
@keyframes ptm-popB { 0%{transform:translate(0,0) scale(.3) rotate(0);opacity:0} 12%{opacity:1} 55%{transform:translate(18px,-140px) scale(1) rotate(-140deg);opacity:1} 100%{transform:translate(30px,-60px) scale(1) rotate(-240deg);opacity:0} }
@keyframes ptm-popC { 0%{transform:translate(0,0) scale(.3) rotate(0);opacity:0} 12%{opacity:1} 55%{transform:translate(58px,-100px) scale(1) rotate(120deg);opacity:1} 100%{transform:translate(86px,-30px) scale(1) rotate(220deg);opacity:0} }
@keyframes ptm-strip { to { background-position: 28px 0; } }
@keyframes ptm-blink { 50% { opacity: .35; } }

/* Toutes les animations sont coupées si l'utilisateur réduit les mouvements. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------ en-tête : tablette et mobile */

@media (max-width: 1024px) {
  .topbar-inner {
    padding: 0 24px;
  }

  .topbar-side {
    width: auto;
  }

  .stepper {
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .topbar-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .logo-text {
    display: none;
  }

  .stepper {
    gap: 14px;
    font-size: 13px;
  }

  .header-right {
    gap: 6px;
  }

  .videos-link-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .videos-link::before {
    content: "";
    width: 20px;
    height: 20px;
    background: currentColor;
    -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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M10 9.5v5l4-2.5z'/%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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M10 9.5v5l4-2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}

@media (max-width: 420px) {
  .stepper li:not([aria-current="step"]) {
    display: none;
  }
}

/* ============================================================ 1. Source (accueil) */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Faisceau du projecteur, en haut de la salle. */
.hero-beam {
  position: absolute;
  left: 50%;
  top: -40px;
  width: 1100px;
  max-width: 100%;
  height: 560px;
  transform: translateX(-50%);
  background: var(--ptm-projector);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  line-height: normal;
  padding: 84px var(--ptm-page-x) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}

.hero h1 {
  font-size: 76px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.hero-lead {
  font-size: 18px;
  color: var(--ptm-muted);
}

.source-form {
  position: relative;
  width: 820px;
  max-width: 100%;
  margin-top: 14px;
  /* Passage à l'étape 2 : le champ reste visible sous l'en-tête fixe. */
  scroll-margin-top: 88px;
}

.source-field {
  height: 72px;
  padding: 0 10px 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ptm-surface);
  border: 1px solid var(--ptm-line);
  border-radius: var(--ptm-r-field);
}

.source-field:focus-within {
  border-color: var(--ptm-surface-3);
}

.source-field input[type="text"] {
  flex-grow: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 20px;
}

.source-field input[type="text"]:focus-visible {
  outline: none;
}

.mic-btn {
  color: var(--ptm-muted);
}

.mic-btn.recording {
  color: var(--ptm-rec);
}

.source-field .btn-amber {
  flex: none;
}

/* Étape 2, les réglages du film : sous le champ, dans le flux de la page. */
.source-menu {
  margin-top: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: var(--ptm-surface);
  border: 1px solid var(--ptm-line);
  border-radius: var(--ptm-r-xl);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  text-align: left;
}

.source-menu-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.source-menu-head h2:focus {
  outline: none;
}

.source-menu-section {
  display: flex;
  flex-direction: column;
}

.source-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.source-menu-sublabel {
  margin-top: 16px;
}

.source-menu-foot {
  display: flex;
  justify-content: flex-end;
}


.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  min-height: var(--ptm-target);
  padding: 8px 14px;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--ptm-bg);
  border-color: var(--ptm-line);
  text-align: left;
}

.choice strong {
  font-size: 14px;
  font-weight: 600;
}

.choice small {
  color: var(--ptm-muted);
  font-size: 12px;
  font-weight: 400;
}

.choice[aria-pressed="true"] {
  border-color: var(--ptm-amber);
  box-shadow: inset 0 0 0 1px var(--ptm-amber);
}

.format-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.format-opt {
  min-height: var(--ptm-target);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  cursor: pointer;
}

.format-opt input:disabled {
  cursor: default;
}

.format-name {
  width: 36px;
  font-family: var(--ptm-font-mono);
  font-size: 13px;
}

.format-hint {
  color: var(--ptm-muted);
}

.hero-inner .dictation-status,
.hero-inner .error {
  margin: 12px 0 0;
}

.captcha {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.captcha altcha-widget {
  --altcha-max-width: 100%;
  --altcha-border-radius: 12px;
  --altcha-color-base: var(--ptm-surface);
  --altcha-color-border: var(--ptm-line);
  --altcha-color-text: var(--ptm-text);
}

/* Trois rangées de fauteuils, vues de dos : seulement le centre. */
.seats {
  position: relative;
  z-index: 1;
  align-self: center;
  width: 1100px;
  max-width: 100%;
  height: auto;
  margin-top: 40px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
}

/* Le foyer : bande « À l'affiche » sous les fauteuils. */
.foyer {
  flex-grow: 1;
  padding: 28px 40px 48px;
  background: var(--ptm-foyer);
  border-top: 1px solid var(--ptm-foyer-line);
}

.foyer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.foyer-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.foyer-head .overline,
.foyer-extra .overline {
  font-weight: 500;
}

.foyer-head .link {
  min-height: 0;
}

.foyer-empty {
  font-size: 14px;
}

.shelf {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.shelf.is-expanded {
  flex-wrap: wrap;
}

.shelf-card {
  width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shelf-thumb {
  position: relative;
  height: 200px;
  padding: 18px;
  display: flex;
  align-items: flex-end;
  border-radius: var(--ptm-r-md);
  overflow: hidden;
  text-decoration: none;
}

.shelf-thumb.is-waiting {
  background: var(--ptm-ticket-plain);
  color: var(--ptm-muted);
}

.shelf-thumb:hover {
  color: inherit;
}

.shelf-hook {
  position: relative;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--ptm-font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.05;
}

.shelf-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shelf-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--ptm-amber);
}

.shelf-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.shelf-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ptm-text);
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-title:hover {
  color: var(--ptm-amber-hover);
}

.shelf-meta > span {
  flex: none;
}

.videos-clear {
  align-self: flex-start;
  min-height: 0;
  color: var(--ptm-muted);
}

.foyer-extra {
  margin-top: 48px;
}

.foyer-extra video {
  width: 100%;
  max-width: 720px;
  border-radius: var(--ptm-r-md);
}

.how-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.how-steps li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.how-steps span {
  color: var(--ptm-muted);
  line-height: 1.5;
}

@media (max-width: 1024px) {
  .hero h1 {
    font-size: 64px;
  }

  .how-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .hero-inner {
    padding-top: 56px;
    gap: 18px;
  }

  .hero h1 {
    font-size: 48px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .source-field {
    height: auto;
    padding: 10px 10px 10px 18px;
    flex-wrap: wrap;
  }

  .source-field input[type="text"] {
    flex-basis: calc(100% - 56px);
    min-height: 52px;
    font-size: 18px;
  }

  .source-field .btn-amber {
    flex-grow: 1;
  }

  .source-menu {
    padding: 18px;
  }

  .source-menu-foot .btn-amber {
    flex-grow: 1;
  }

  .source-menu-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .foyer {
    padding: 24px 16px 40px;
  }

  .shelf {
    flex-direction: column;
    overflow: visible;
  }

  .shelf-card {
    width: 100%;
  }

  .shelf-thumb {
    height: auto;
    aspect-ratio: 2 / 1;
  }

  .how-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .seats {
    display: none;
  }

  .foyer {
    margin-top: 40px;
  }
}

/* ============================================================ panneaux : identité et écrans */

.kit-colors {
  display: flex;
  gap: 20px;
}

.kit-color {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.kit-color.is-empty input {
  opacity: 0.5;
}

.kit-logo {
  min-height: 72px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ptm-bg);
  border: 1px dashed var(--ptm-line);
  border-radius: var(--ptm-r-md);
}

.kit-logo img {
  max-height: 56px;
  width: auto;
}

/* Bouton d'envoi de fichier : le <label> d'un <input type="file"> masqué. */
.file-btn {
  position: relative;
  align-self: flex-start;
}

.file-btn:focus-within {
  outline: 2px solid var(--ptm-amber);
  outline-offset: 2px;
}

.resource-ideas {
  margin: 0;
  padding-left: 18px;
  color: var(--ptm-muted);
  font-size: 13px;
  line-height: 1.7;
}

.media-tour-note {
  color: var(--ptm-amber);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.media-grid:empty {
  display: none;
}

.media-tile {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.media-tile img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border-radius: var(--ptm-r-md);
  background: var(--ptm-bg);
}

.media-tile figcaption {
  color: var(--ptm-muted);
  font-size: 12px;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.media-actions button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

/* ============================================================ 2. Angle */

.screen-angle {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.angle-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.angle-head-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.angle-head h1 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

.angle-sub {
  font-size: 16px;
  color: var(--ptm-muted);
}

.angle-sub .link {
  min-height: 0;
  font-size: 16px;
}

.angle-head-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 20px;
}

.quiet-link {
  color: var(--ptm-muted);
  text-decoration: none;
}

.quiet-link:hover {
  color: var(--ptm-text);
}

.facts-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.facts-title {
  font-family: var(--ptm-font-display);
  font-size: 19px;
  font-weight: 700;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.facts-wide {
  grid-column: 1 / -1;
}

.facts-chips {
  margin-top: 10px;
}

.facts-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.facts-stats .field-label {
  margin: 0 6px 0 0;
}

.stat-item {
  padding: 4px 10px;
  border-radius: var(--ptm-r-sm);
  background: var(--ptm-surface-2);
  font-family: var(--ptm-font-mono);
  font-size: 13px;
}

.facts-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.facts-actions .btn-amber {
  height: 44px;
  font-size: 14px;
}

.posters-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.posters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.posters[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.poster-hook {
  font-family: var(--ptm-font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.02;
}

.poster-visual.is-screen {
  padding: 26px 26px 0 60px;
  flex-direction: row;
  align-items: flex-end;
}

.poster-screen {
  width: 100%;
  height: 175px;
  border-radius: 10px 10px 0 0;
  background: #FFFFFF;
  overflow: hidden;
}

.poster-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.poster-stat {
  font-family: var(--ptm-font-display);
  font-size: 72px;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.poster-stat-context {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  opacity: 0.85;
}

/* Réglages repliés de l'écran Angle : sur une ligne. */
.settings-strip {
  flex-direction: row;
}

.settings-strip .settings-row {
  flex: 1 1 0;
  min-width: 0;
  border-bottom: 0;
  border-right: 1px solid var(--ptm-row-line);
}

.settings-strip .settings-row:last-child {
  border-right: 0;
}

.summary-bar {
  margin-top: auto;
  padding: 16px 16px 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--ptm-surface);
  border-radius: var(--ptm-r-xl);
}

.summary-text {
  font-size: 15px;
}

.screen-angle .error {
  margin: -20px 0 0;
}

@media (max-width: 1024px) {
  .posters {
    gap: 16px;
  }

  .poster-hook {
    font-size: 22px;
  }

  .poster-stat {
    font-size: 56px;
  }
}

@media (max-width: 768px) {
  .screen-angle {
    gap: 24px;
    padding-top: 28px;
  }

  .angle-head {
    flex-direction: column;
    align-items: stretch;
  }

  .angle-head h1 {
    font-size: 36px;
  }

  .angle-head-actions {
    justify-content: space-between;
  }

  .facts-grid,
  .posters {
    grid-template-columns: minmax(0, 1fr);
  }

  .poster-visual {
    height: 200px;
  }

  .settings-strip {
    flex-direction: column;
  }

  .settings-strip .settings-row {
    flex: none;
    border-right: 0;
    border-bottom: 1px solid var(--ptm-row-line);
  }

  .summary-bar {
    position: sticky;
    bottom: 12px;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }
}

/* ============================================================ 3. Script */

.screen-script {
  padding-top: 32px;
}

.script-grid {
  display: grid;
  grid-template-columns: minmax(0, 840px) minmax(300px, 1fr);
  gap: 40px;
  align-items: start;
}

.script-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.script-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.script-head h1 {
  white-space: nowrap;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.script-head-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.script-head-meta .link {
  min-height: 0;
  white-space: nowrap;
}

#script-subtitle {
  white-space: nowrap;
}

.format-switch {
  display: flex;
  gap: 4px;
}

.format-switch .pill {
  font-family: var(--ptm-font-mono);
  font-size: 12px;
}

/* Lecteur de l'aperçu : la seule chose lumineuse de l'écran. */
.player {
  position: relative;
  width: 100%;
  aspect-ratio: 840 / 472;
  border-radius: var(--ptm-r-xl);
  overflow: hidden;
  background: var(--ptm-surface);
  box-shadow: 0 40px 80px -40px rgba(242, 181, 68, 0.25);
}

.player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-tools {
  position: absolute;
  right: 20px;
  top: 20px;
  display: flex;
  gap: 8px;
}

.player-btn {
  width: 48px;
  height: 48px;
  background: rgba(12, 12, 14, 0.85);
  color: #FFFFFF;
}

.player-btn:hover:not(:disabled) {
  background: var(--ptm-bg);
  color: #FFFFFF;
}

.player-status {
  position: absolute;
  left: 20px;
  top: 20px;
  padding: 6px 10px;
  border-radius: var(--ptm-r-sm);
  background: rgba(12, 12, 14, 0.85);
  color: var(--ptm-text);
  font-size: 12px;
}

.player-status:empty {
  display: none;
}

/* Timeline : un segment par scène, proportionnel à sa durée. */
.timeline {
  height: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.timeline-seg {
  flex-basis: 0;
  flex-grow: 1;
  min-width: 0;
  height: 24px;
  min-height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  background: none;
  border: 0;
  border-radius: 0;
}

.timeline-seg:hover:not(:disabled) {
  background: none;
}

.timeline-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--ptm-surface-3);
}

.timeline-seg:hover .timeline-bar {
  background: #3A3A40;
}

.timeline-seg.is-active .timeline-bar {
  background: var(--ptm-amber);
}

/* Pellicule des scènes : cinq cartes, défilement au-delà. */
.scene-strip {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 40px) / 5);
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.scene-card {
  min-width: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--ptm-surface);
  border: 1.5px solid var(--ptm-surface);
  border-radius: var(--ptm-r-lg);
  cursor: pointer;
}

.scene-card.is-active {
  border-color: var(--ptm-amber);
}

.scene-card.recording {
  border-color: var(--ptm-rec);
}

.scene-card-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--ptm-font-mono);
  font-size: 12px;
  color: var(--ptm-muted);
}

.scene-card.is-active .scene-num {
  color: var(--ptm-amber);
}

.scene-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

.scene-card textarea {
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  resize: none;
  color: var(--ptm-text-2);
  font-size: 14px;
  line-height: 1.4;
}

.scene-card textarea:focus-visible {
  outline: none;
}

/* Prise de « Ma voix », sous le texte de la scène. */
.take {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.take button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.take-rec {
  border-color: var(--ptm-rec);
}

.take-status {
  flex-basis: 100%;
  color: var(--ptm-muted);
  font-size: 12px;
}

.take.ok .take-status {
  color: var(--ptm-text-2);
}

.take.stale .take-status {
  color: var(--ptm-amber);
}

.script-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 68px;
}

.ai-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.scope-switch {
  display: flex;
  gap: 4px;
}

.scope-switch .pill {
  height: 28px;
  min-height: 28px;
  font-size: 12px;
}

.ai-panel textarea {
  padding: 12px 14px;
  resize: none;
  font-size: 15px;
}

.ai-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-actions .link {
  font-size: 13px;
}

.ai-apply {
  height: 40px;
  margin-left: auto;
  padding: 0 18px;
  border-radius: var(--ptm-r-md);
  font-size: 14px;
}

.mic-inline {
  color: var(--ptm-muted);
  border: 1px solid var(--ptm-line);
}

.mic-inline.recording {
  color: var(--ptm-rec);
  border-color: var(--ptm-rec);
}

.prompt-status {
  font-size: 13px;
  color: var(--ptm-text-2);
}

.prompt-status.is-error {
  color: var(--ptm-amber-hover);
}

.prompt-changes {
  margin: 0;
  padding-left: 18px;
  color: var(--ptm-muted);
  font-size: 13px;
  line-height: 1.6;
}

.prompt-changes .rejected {
  color: var(--ptm-amber-hover);
}

.word-row {
  padding: 6px 4px 0;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ptm-muted);
}

.word-row .mono.over,
.narration-status {
  color: var(--ptm-amber);
}

.narration-status {
  margin-top: -8px;
  padding: 0 4px;
  font-size: 13px;
}

.approve {
  width: 100%;
  height: 56px;
  border-radius: 14px;
}

.script-aside .error {
  margin: 0;
}

/* Panneau « Voix et musique » */
.own-voice-summary.warn {
  color: var(--ptm-amber);
}

.music-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ptm-text-2);
}

.mp-pick {
  flex: 1;
  min-height: 36px;
  padding: 6px 12px;
  justify-content: flex-start;
  background: transparent;
  border-color: transparent;
  color: var(--ptm-text-2);
  font-size: 13px;
  font-weight: 400;
  text-align: left;
}

.mp-pick[aria-pressed="true"] {
  border-color: var(--ptm-amber);
  color: var(--ptm-text);
}

.mp-play {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  font-size: 12px;
}

.custom-music,
.custom-music-panel,
.custom-music-active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-music > button,
.custom-music-active > button {
  align-self: flex-start;
}

.custom-music audio {
  width: 100%;
}

.small-amber {
  height: 44px;
  font-size: 14px;
}

@media (max-width: 1180px) {
  .script-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
  }
}

@media (max-width: 900px) {
  .script-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .script-aside {
    padding-top: 0;
  }
}

@media (max-width: 768px) {
  .screen-script {
    padding-top: 24px;
  }

  .script-head {
    flex-direction: column;
    gap: 6px;
  }

  .script-head h1 {
    font-size: 32px;
  }

  .script-head-meta {
    flex-wrap: wrap;
  }

  .player-tools {
    right: 12px;
    top: 12px;
  }

  .player-btn {
    width: 44px;
    height: 44px;
  }

  /* La pellicule devient une liste verticale. */
  .scene-strip {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .scene-card textarea {
    min-height: 80px;
  }
}

/* ============================================================ 3 bis. Montage en cours */

.screen-montage {
  padding: 56px var(--ptm-page-x) 48px;
  line-height: normal;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

/* Écriture du script : durée inconnue, la bande défile sans pourcentage. */
.writing-fill {
  width: 32%;
  animation: ptm-writing 1.8s ease-in-out infinite alternate;
}

@keyframes ptm-writing {
  from { left: 0; }
  to { left: 68%; }
}

@media (prefers-reduced-motion: reduce) {
  .writing-fill {
    animation: none;
    width: 100%;
    opacity: 0.35;
  }
}

.popcorn {
  flex: none;
  width: 260px;
  height: 320px;
}

/* Trois grains qui sautent en boucle, décalés de 0,7 s. */
.pop {
  transform-box: fill-box;
  transform-origin: center;
}

.pop-a {
  animation: ptm-popA 2.2s ease-out infinite;
}

.pop-b {
  animation: ptm-popB 2.2s ease-out 0.7s infinite;
}

.pop-c {
  animation: ptm-popC 2.2s ease-out 1.4s infinite;
}

.montage-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.rec-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ptm-font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ptm-amber);
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ptm-rec);
  animation: ptm-blink 1.2s steps(1) infinite;
}

.montage-text h1 {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.montage-lead {
  max-width: 560px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ptm-muted);
}

.montage-progress,
.progress-block {
  width: 760px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

.render-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
  font-size: 14px;
}

.render-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ptm-text);
}

.render-step.is-active {
  font-weight: 600;
}

.render-step.is-todo {
  color: var(--ptm-muted);
}

.render-step-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.render-step.is-active .render-step-dot {
  background: var(--ptm-amber);
  animation: ptm-blink 1s steps(1) infinite;
}

.render-step.is-todo .render-step-dot {
  border: 1.5px solid var(--ptm-step-todo);
}

/* Lecture du site, avant les angles : sobre, sans décor. */
.screen-progress {
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-inner {
  width: 760px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.progress-inner h1 {
  font-size: 48px;
}

.progress-lead {
  max-width: 560px;
  font-size: 16px;
}

@media (max-width: 768px) {
  .screen-montage {
    padding-top: 32px;
    gap: 24px;
  }

  .popcorn {
    width: 180px;
    height: 222px;
  }

  .montage-text h1 {
    font-size: 40px;
  }

  .render-steps {
    flex-direction: column;
    align-items: flex-start;
  }

  .progress-inner h1 {
    font-size: 36px;
  }
}

/* ============================================================ 4. Film */

.screen-film {
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.film-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.film-head-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.film-head h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

.film-head > .muted {
  font-size: 14px;
}

.film-grid {
  display: grid;
  grid-template-columns: minmax(0, 880px) minmax(300px, 1fr);
  gap: 32px;
  align-items: start;
}

.film-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Le lecteur : l'écran, avec un halo de la couleur du client. */
.video-wrap {
  --brand: #17171A;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--ptm-r-lg);
  overflow: hidden;
  background: var(--brand);
  box-shadow: 0 60px 120px -50px color-mix(in srgb, var(--brand) 70%, transparent);
}

.video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-wrap:fullscreen {
  border-radius: 0;
}

.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6));
  color: #FFFFFF;
}

.video-play {
  background: #FFFFFF;
  color: var(--ptm-bg);
}

.video-play:hover:not(:disabled) {
  background: var(--ptm-screen);
  color: var(--ptm-bg);
}

.video-time {
  font-size: 13px;
  white-space: nowrap;
}

.video-seek {
  flex-grow: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.video-seek:hover:not(:disabled) {
  background: none;
}

.video-seek-track {
  width: 100%;
  height: 4px;
  display: block;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.video-seek-fill {
  display: block;
  width: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--ptm-amber);
}

.video-ctrl {
  color: #FFFFFF;
}

.video-ctrl:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.film-formats {
  align-self: flex-start;
}

.film-qa {
  color: var(--ptm-muted);
  font-size: 13px;
  line-height: 1.5;
}

.film-qa.warn {
  color: var(--ptm-text-2);
}

.film-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tickets {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.unlock {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--ptm-surface);
  border-radius: var(--ptm-r-xl);
}

.unlock-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ptm-text-2);
}

.unlock-terms {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ptm-muted);
  cursor: pointer;
}

.unlock-terms input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--ptm-amber, currentColor);
}

.unlock-terms a {
  color: inherit;
}

.unlock .btn-screen {
  width: 100%;
}

.film-actions {
  margin-top: 6px;
  display: flex;
  gap: 10px;
}

.film-actions button {
  flex-grow: 1;
  height: 48px;
  border-radius: var(--ptm-r-lg);
  font-size: 15px;
  font-weight: 400;
}

.film-actions button[aria-expanded="true"] {
  border-color: var(--ptm-amber);
}

.film-side > .link {
  align-self: flex-start;
  min-height: 0;
}

.expiry-notice {
  font-size: 13px;
  color: var(--ptm-muted);
}

/* Retoucher ce film : ouvert depuis « Retoucher ». */
.film-retouch {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.film-retouch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.ai-locked-note {
  margin: 0;
  color: var(--ptm-amber);
}

.prompt-history summary {
  min-height: var(--ptm-target);
  display: flex;
  align-items: center;
  color: var(--ptm-muted);
  font-size: 13px;
  cursor: pointer;
}

.prompt-history ol {
  margin: 0;
  padding-left: 18px;
  color: var(--ptm-muted);
  font-size: 13px;
}

.retouch-scenes-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.retouch-scenes-wrap > .field-hint {
  margin: 0;
}

.retouch-scenes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.retouch-scene {
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--ptm-surface);
  border-radius: var(--ptm-r-lg);
}

.retouch-scene .field-label {
  margin-bottom: 4px;
  font-family: var(--ptm-font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--ptm-muted);
}

.retouch-scene p {
  font-size: 14px;
  color: var(--ptm-text-2);
}

/* Et maintenant ? */
.film-next {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.film-next .overline {
  font-weight: 500;
}

.next-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.next-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--ptm-surface);
  border-radius: var(--ptm-r-xl);
}

.next-card h3 {
  font-size: 17px;
}

.next-card > p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ptm-muted);
}

.next-card .link {
  margin-top: auto;
}

.next-progress {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.next-progress .progress-meta {
  font-size: 13px;
}

.next-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--ptm-surface-3);
}

.next-bar-fill {
  width: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--ptm-amber);
}

.posts-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.post-item {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--ptm-surface);
  border-radius: var(--ptm-r-xl);
}

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-text {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ptm-text-2);
}

.screen-error {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1180px) {
  .film-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
  }

  .next-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .film-grid,
  .film-retouch-grid,
  .posts-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .screen-film {
    padding-top: 24px;
  }

  .film-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .film-head h1 {
    font-size: 36px;
  }

  .video-controls {
    gap: 8px;
    padding: 0 10px;
  }

  .video-time {
    display: none;
  }

  .next-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================ Compte */

.account-view {
  padding: 48px var(--ptm-page-x) 56px;
}

.account-view > section {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#account-auth {
  padding: 32px;
}

.account-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-card h1 {
  font-size: 40px;
  overflow-wrap: anywhere;
}

.account-card h2 {
  font-size: 19px;
}

.account-card .field-label {
  margin: 8px 0 0;
}

.account-card .lead-left {
  color: var(--ptm-muted);
  font-size: 16px;
}

.account-card form,
#auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#auth-form .btn-amber,
#brand-save {
  align-self: flex-start;
  margin-top: 8px;
}

.retouch-count {
  margin: 4px 0 12px;
}

.retouch-pack {
  margin: 0 0 16px;
}

.sso-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 4px;
}

.sso-btn {
  width: 100%;
  background: var(--ptm-surface-2);
}

.sso-or {
  margin: 6px 0 0;
  color: var(--ptm-muted);
  font-size: 13px;
  text-align: center;
}

.auth-tabs {
  display: flex;
  gap: 6px;
}

.auth-tabs .pill[aria-selected="true"] {
  background: var(--ptm-amber);
  color: var(--ptm-on-amber);
}

.account-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
}

.brand-colors {
  display: flex;
  gap: 20px;
}

.color-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.brand-formats label {
  min-height: var(--ptm-target);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-preview {
  padding: 10px;
  background: var(--ptm-bg);
  border: 1px dashed var(--ptm-line);
  border-radius: var(--ptm-r-md);
}

.logo-preview img {
  max-height: 48px;
  width: auto;
}

.account-videos {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-video {
  min-height: var(--ptm-target);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ptm-text);
  font-size: 14px;
  text-decoration: none;
}

.account-video img {
  width: 96px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--ptm-r-sm);
}

.danger-zone summary {
  min-height: var(--ptm-target);
  display: flex;
  align-items: center;
  color: var(--ptm-muted);
  cursor: pointer;
}

.danger-zone[open] {
  gap: 8px;
}

.danger-button {
  align-self: flex-start;
}

@media (max-width: 768px) {
  .account-view {
    padding-top: 28px;
  }

  #account-auth {
    padding: 20px;
  }

  .account-card h1 {
    font-size: 30px;
  }

  .brand-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

#focus-detail {
  margin-top: 16px;
}
