:root {
  --fond: #f6f5f2; --carte: #ffffff; --texte: #1d1c1a; --doux: #6b6862; --ligne: #e4e1da;
  --accent: #e5533d; --accent-texte: #ffffff; --ok: #2f8f5b; --attente: #c98a12; --info: #3a6fd8;
  --rayon: 12px; --ombre: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #141412; --carte: #1e1d1b; --texte: #f1efe9; --doux: #a29e95; --ligne: #34322e;
    --accent: #ff6b52; --ok: #4cc283; --attente: #e7aa35; --info: #6e9bff; --ombre: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #141412; --carte: #1e1d1b; --texte: #f1efe9; --doux: #a29e95; --ligne: #34322e;
  --accent: #ff6b52; --ok: #4cc283; --attente: #e7aa35; --info: #6e9bff; --ombre: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fond); color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--info); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.page { max-width: 880px; margin: 0 auto; padding: 16px; }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); margin-bottom: 14px; }
.doux { color: var(--doux); }
.petit { font-size: .85rem; }
.ligne { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ligne.entre { justify-content: space-between; }
.pile > * + * { margin-top: 10px; }
button, .bouton {
  font: inherit; border: 1px solid var(--ligne); background: var(--carte); color: var(--texte);
  border-radius: 10px; padding: 10px 16px; cursor: pointer; min-height: 44px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
button:hover { border-color: var(--doux); }
button.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); font-weight: 600; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
button.lien { border: none; background: none; color: var(--info); padding: 4px 6px; min-height: 0; }
button:disabled { opacity: .5; cursor: default; }
input:not([type=file]):not([type=range]):not([type=checkbox]):not([type=radio]), textarea, select {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--ligne); border-radius: 10px;
  background: var(--fond); color: var(--texte);
}
textarea { min-height: 90px; resize: vertical; }
textarea.script { min-height: 320px; font-size: 1.05rem; line-height: 1.6; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
.pastille { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--ligne); color: var(--texte); white-space: nowrap; }
.pastille.client { background: var(--accent); color: var(--accent-texte); }
.pastille.admin { background: var(--attente); color: #fff; }
.pastille.fini { background: var(--ok); color: #fff; }
.liste-shorts { list-style: none; margin: 0; padding: 0; }
.liste-shorts li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--ligne); cursor: pointer; }
.liste-shorts li > div { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.liste-shorts li > .pastille { flex-shrink: 0; }
.liste-shorts li:last-child { border-bottom: none; }
@media (max-width: 600px) {
  .liste-shorts li { flex-direction: column; align-items: flex-start; gap: 4px; }
}
.liste-shorts li:hover { background: var(--fond); }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--ligne); margin-bottom: 14px; overflow-x: auto; }
.onglets button { border: none; border-radius: 0; background: none; border-bottom: 2px solid transparent; padding: 10px 12px; white-space: nowrap; }
.onglets button.actif { border-bottom-color: var(--accent); font-weight: 600; }
.retour { border-left: 3px solid var(--info); padding: 6px 10px; background: var(--fond); border-radius: 6px; }
.retour.resolu { opacity: .55; border-left-color: var(--ok); }
.retour .t { font-variant-numeric: tabular-nums; font-weight: 600; cursor: pointer; color: var(--info); }
video { width: 100%; max-height: 70vh; background: #000; border-radius: 10px; }
audio { width: 100%; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--texte); color: var(--fond); padding: 10px 18px; border-radius: 10px; z-index: 50; max-width: calc(100% - 32px); }
.toast.erreur { background: var(--accent); color: #fff; }
.vide { text-align: center; padding: 30px 10px; color: var(--doux); }
.barre { height: 6px; background: var(--ligne); border-radius: 3px; overflow: hidden; }
.barre > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.cache { display: none !important; }

/* prompteur */
.prompteur { position: relative; height: 55vh; overflow: hidden; background: #111; color: #f5f5f5; border-radius: 12px; }
.prompteur .defile { position: absolute; left: 0; right: 0; padding: 21vh 20px 50vh; font-size: clamp(1.4rem, 5vw, 2.1rem); line-height: 1.55; font-weight: 600; white-space: pre-wrap; will-change: transform; }
.prompteur::before { content: ""; position: absolute; left: 0; right: 0; top: 38%; height: 3.2em; border-top: 1px solid rgba(255,255,255,.25); border-bottom: 1px solid rgba(255,255,255,.25); pointer-events: none; z-index: 1; }
.prompteur .compte { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 5rem; font-weight: 800; z-index: 2; background: rgba(0,0,0,.4); }
.rec { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #e53935; animation: clignote 1s infinite; }
@keyframes clignote { 50% { opacity: .2; } }
@media (max-width: 600px) {
  .page { padding: 12px 16px; }
  .ligne > button { flex: 1 1 auto; justify-content: center; }
}

/* ---------------------------------------------------------------- onboarding étape par étape */
.ob-entete { position: sticky; top: 0; z-index: 5; background: var(--fond); padding: 8px 0 12px; }
.ob-xp { height: 6px; background: var(--ligne); border-radius: 3px; overflow: hidden; margin: 8px 0 4px; }
.ob-xp > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s ease; }
.ob-carte { display: flex; align-items: center; margin-top: 10px; overflow-x: auto; padding: 4px 2px; }
.ob-trait { flex: 1 0 8px; height: 2px; background: var(--ligne); }
.ob-point { flex: 0 0 auto; width: 30px; height: 30px; min-height: 0; padding: 0; justify-content: center; border-radius: 50%; font-size: .8rem; font-weight: 600; background: var(--carte); }
.ob-point.fait { background: var(--ok); border-color: var(--ok); color: #fff; }
.ob-point.actuel { border: 2px solid var(--accent); }
.ob-point:disabled { opacity: .35; }
.ob-etape { padding: 22px 18px; }
.ob-badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--ligne); color: var(--texte); margin-bottom: 12px; }
.ob-badge.bonus { background: transparent; border: 1px solid var(--ligne); color: var(--doux); }
.ob-titre { font-size: 1.4rem; margin-bottom: .3em; }
.ob-question { font-size: 1.1rem; font-weight: 600; margin: 0 0 .3em; }
.ob-etape textarea#ob-texte { min-height: 140px; margin-top: 8px; }
.ob-grand { padding: 12px 22px; }
.ob-plan { padding-left: 1.3em; margin: 14px 0; }
.ob-plan li { margin-bottom: 6px; }
.ob-micro { margin-top: 10px; }
.ob-vocal { display: flex; align-items: center; gap: 8px; }
.ob-vocal audio { flex: 1; min-width: 0; height: 40px; }
.ob-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.ob-tuile { flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 12px; min-height: 92px; }
.ob-tuile.remplie { border-color: var(--ok); }
.ob-tuile.choisie { border-color: var(--accent); }
.ob-compte { color: var(--ok); font-weight: 600; font-size: .85rem; margin-top: auto; }
.ob-panneau { margin-top: 14px; padding: 14px; border: 1px solid var(--ligne); border-radius: 10px; background: var(--fond); }
.ob-panneau textarea { background: var(--carte); }
.ob-recap { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--ligne); border-radius: 10px; cursor: pointer; }
.ob-recap > span { flex: 0 0 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; background: var(--ligne); }
.ob-recap.ok > span { background: var(--ok); color: #fff; }
.ob-recap.manque > span { background: var(--accent); color: #fff; }
.ob-recap > div { min-width: 0; overflow-wrap: anywhere; }
.ob-victoire { text-align: center; padding: 36px 20px; margin-top: 30px; }
.ob-fichier { padding: 6px 0; border-bottom: 1px solid var(--ligne); } .ob-fichier > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.page.auth { max-width: 420px; padding-top: 10vh; }
.marque { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; color: var(--accent); }
