/* dashboard.css — parcours d'activation : premier écran, attente du traitement, logique de la liste.
   Uniquement des tokens de styles.css (thème clair par défaut, studio/classique suivent). Pas d'ombre lourde,
   pas de couleur hors palette. Les animations se limitent à un pouls lent, neutralisé par le bloc
   `prefers-reduced-motion` de styles.css. */

.dash-lede { font-size: 16px; max-width: 62ch; margin: 0 0 24px }
.dash-fine { font-size: 13px; margin: 8px 0 0 }
.dash-or { font-size: 13px; margin: 16px 0 0 }

/* bandeau sobre : quota atteint, jamais rouge, jamais modal */
.dash-note {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin: 0 0 24px; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
}
.dash-note p { margin: 0 }

/* ---------- premier écran : trois façons de commencer ---------- */
.start { margin: 0 0 8px }
.start h2, .dash-preview h2 { margin-bottom: 14px }
.start-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; align-items: stretch }
.start-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.start-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 15px }
.start-card p { font-size: 13px; margin: 0 }
.start-num {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none;
  border-radius: 50%; background: var(--accent-2-bg); color: var(--accent-2-text);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
/* la dropzone tient dans une carte : moins de vide, même affordance */
.start-card .dropzone { padding: 22px 14px; border-radius: var(--radius-sm); margin-top: auto }
.start-card .dropzone p { margin: 0 }
.start-card .dropzone p + p { margin-top: 4px; font-size: 12px }
.start-card .dash-url { margin-top: auto; flex-wrap: wrap }
.start-card .dash-url .input { flex: 1 1 100% }
.start-card .dash-url .btn { flex: 1 1 auto }
.start-card .btn { margin-top: auto; align-self: flex-start }

/* ---------- aperçu : ce que l'IA a réellement trouvé dans la vidéo d'exemple ---------- */
.dash-preview-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start }
.dash-preview-grid > * { min-width: 0 }
.dash-preview-thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16/9; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev);
}
.dash-preview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block }
.clip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px }
.clip-row {
  display: flex; min-width: 0; align-items: baseline; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.clip-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.clip-len { font-size: 12px; white-space: nowrap }
/* note sur 100 : paire ambre claire de styles.css (6,1:1 sur le thème clair), pas l'orange vif */
.score {
  flex: none; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--accent-2-text); background: var(--accent-2-bg);
}
.dash-preview .wait-next { margin-top: 12px }
.dash-preview-all { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 500 }

/* ---------- l'attente ---------- */
.wait {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin: 0 0 28px;
}
.wait h2 { margin-bottom: 6px }
.wait-head { margin: 0; font-size: 14px }
.wait-name { font-weight: 500 }
.wait-live { margin: 2px 0 0; font-size: 14px; font-weight: 500; color: var(--accent) }
.wait-eta { font-weight: 400; color: var(--muted) }
.wait-queue { margin: 2px 0 0; font-size: 13px }

.wait-steps { list-style: none; margin: 18px 0 0; padding: 0 }
.wait-steps li {
  position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 12px;
  padding: 0 0 16px; color: var(--muted);
}
.wait-steps li:last-child { padding-bottom: 0 }
.wait-steps b { display: block; font-weight: 600; font-size: 14px }
.wait-steps span:not(.wait-dot) { font-size: 13px }
.wait-dot {
  width: 12px; height: 12px; margin-top: 4px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface);
}
/* trait de liaison entre deux étapes */
.wait-steps li:not(:last-child)::before {
  content: ""; position: absolute; left: 5px; top: 20px; bottom: 4px; width: 2px; background: var(--border);
}
.wait-steps li.done { color: var(--muted) }
.wait-steps li.done .wait-dot { border-color: var(--success); background: var(--success) }
.wait-steps li.done::before { background: color-mix(in srgb, var(--success) 45%, transparent) }
.wait-steps li.now { color: var(--text) }
.wait-steps li.now .wait-dot { border-color: var(--accent-fill); background: var(--accent-fill); animation: wait-pulse 2.4s ease-in-out infinite }
.wait-steps li.now b { color: var(--accent) }
@keyframes wait-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }

/* « C'est parti ! » : le traitement continue sans la page (dashboard et page vidéo) */
.wait-mail {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 14px 0 0; padding: 12px 14px;
  border-radius: var(--radius); background: var(--accent-2-bg); color: var(--text); font-size: 14px; line-height: 1.5
}
.wait-mail p { margin: 0; flex: 1 1 280px; min-width: 0 }
.wait-mail-to { overflow-wrap: anywhere }

.wait-do { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border) }
.wait-do h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 14px }
.wait-do h3 + p { font-size: 13px; margin: 0 0 10px }
.wait-do h3 ~ h3 { margin-top: 18px }
.wait-saved { font-size: 12px; font-weight: 500; color: var(--success-text) }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px }
.chips .chip { padding: 6px 12px; font-size: 13px }
/* sélection : aplat contrasté (même motif que .seg button.on) — le liseré ambre de .choice.selected
   ne passe pas AA à 13 px sur fond clair */
.chips .chip.selected { background: var(--contrast-bg); color: var(--contrast-fg); border-color: var(--contrast-bg) }
.sub-swatch {
  width: 30px; height: 30px; padding: 0; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface); cursor: pointer; transition: border-color .15s;
}
.sub-swatch span { width: 18px; height: 18px; border-radius: 50%; background: var(--sw); border: 1px solid var(--border) }
.sub-swatch:not(:disabled):hover { border-color: var(--muted) }
.sub-swatch.selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-fill) 28%, transparent) }
.sub-swatch:disabled, .chips .chip:disabled { opacity: .5; cursor: not-allowed }

.wait-next { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted) }
.wait-next li { margin-bottom: 4px }

/* ---------- la liste ---------- */
.video-card { display: flex; flex-direction: column }
.video-card > a { flex: 1 }
.video-body h3.title { font-family: var(--font); font-size: 14px; font-weight: 500; margin: 0 0 2px }
.video-body .video-meta { margin: 0 }
.vc-step { margin-top: 6px !important; color: var(--accent) !important }
/* carte sans vignette (en cours, échec) : pas de grand vide 16:9 */
.video-card .thumb:not(:has(img)) { aspect-ratio: 5/2 }
/* pastille d'état, lisible sur la vignette comme sur le fond gris */
.st-pill {
  position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.st-pill.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent) }
/* un échec propose une sortie, il ne crie pas */
.video-card.is-failed { border-color: color-mix(in srgb, var(--danger) 30%, transparent) }
.vc-fail { padding: 0 14px 14px; display: grid; gap: 8px; justify-items: start }
.vc-fail p { margin: 0; font-size: 12px }

@media (max-width: 860px) {
  .start-grid { grid-template-columns: 1fr 1fr }
  .start-card:first-child { grid-column: 1 / -1 }
  .dash-preview-grid { grid-template-columns: 1fr }
  .dash-preview-thumb { max-width: 420px }
}
@media (max-width: 620px) {
  .start-grid { grid-template-columns: 1fr }
  .start-card:first-child { grid-column: auto }
  .dash-url { flex-wrap: wrap }
  .dash-url .input { flex: 1 1 100% }
  .dash-url .btn { width: 100% }
  .wait { padding: 16px }
  .dash-note { flex-direction: column; align-items: flex-start }
}

/* onboarding : les 3 questions sont des <h2> (niveau juste sous le <h1>, pas de saut de titre),
   gardés à la taille d'un intertitre. */
.onb h2 { font-size: 16px; font-weight: 600; margin: 28px 0 12px; letter-spacing: 0 }
.onb h2 .onb-opt { font-size: 13px; font-weight: 400 } /* « facultatif » à côté de la question d'attribution */
/* les 3 grilles de l'onboarding sont en 4 colonnes (style inline du composant) : à 390 px, les libellés
   débordaient. 2 colonnes sous 620 px — `!important` car la valeur vient d'un attribut style. */
@media (max-width: 620px) { .onb .choice-grid { grid-template-columns: repeat(2, 1fr) !important } }
/* à 390 px, « passer pour l'instant » se coupait en trois lignes à côté du bouton */
@media (max-width: 620px) { .onb-actions { flex-direction: column; align-items: flex-start; gap: 14px } }
