@font-face { font-family: "Outfit"; src: url("polices/Outfit-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("polices/InstrumentSerif-Italic.ttf") format("truetype"); font-style: italic; font-display: swap; }

:root {
  --vert: #8DAA2E; --vert-clair: #EEF3DC; --vert-profond: #1E3A1A; --creme: #FAF6EC; --papier: #FFFFFF;
  --encre: #18200F; --gris: #66705F; --trait: #E6E1D2; --rouge: #B4362C; --rouge-clair: #FBE9E6; --ambre: #9A6B00; --ambre-clair: #FFF3D6;
  --ombre: 0 1px 2px rgba(24,32,15,.05), 0 6px 20px rgba(24,32,15,.06);
  --r: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--creme); color: var(--encre); font: 16px/1.5 "Outfit", system-ui, sans-serif; overflow-x: hidden; }
em, .serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; }
a { color: var(--vert-profond); }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.01em; font-weight: 650; }
h1 { font-size: clamp(26px, 4.5vw, 38px); }
h1 em { color: var(--vert); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--vert); outline-offset: 2px; border-radius: 8px; }

/* Barre et onglets */
.barre { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--vert-profond); color: var(--creme); }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex-shrink: 0; }
.pastille { display: grid; place-items: center; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--vert); }
.pastille img { height: 20px; display: block; }
.pastille.grande { height: 56px; padding: 0 16px; border-radius: 14px; }
.pastille.grande img { height: 32px; }
.marque .nom { font-size: 19px; font-weight: 650; }
.marque .nom em { color: var(--vert); font-size: 23px; }
.jauges { margin-left: auto; display: flex; gap: 18px; font-size: 13px; }
.jauge { display: grid; gap: 4px; min-width: 120px; }
.jauge b { font-weight: 600; }
.jauge .rail { height: 6px; border-radius: 6px; background: rgba(250,246,236,.18); overflow: hidden; }
.jauge .rail i { display: block; height: 100%; background: var(--vert); border-radius: 6px; transition: width .3s; }
.onglets { position: sticky; top: 54px; z-index: 19; display: flex; gap: 4px; padding: 8px 20px; background: var(--creme); border-bottom: 1px solid var(--trait); overflow-x: auto; scrollbar-width: none; }
.onglets a { flex-shrink: 0; text-decoration: none; padding: 9px 16px; border-radius: 999px; font-weight: 550; color: var(--gris); }
.onglets a.actif { background: var(--vert-profond); color: var(--creme); }

main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; outline: none; }
.chargement { color: var(--gris); }
.entete { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.entete .sous { color: var(--gris); font-size: 15px; width: 100%; }

/* Bouton écouter */
.ecouter { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--vert-profond); background: var(--papier); color: var(--vert-profond); border-radius: 999px; padding: 7px 14px 7px 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.ecouter svg { width: 18px; height: 18px; }
.ecouter.joue { background: var(--vert-profond); color: var(--creme); }

/* Boutons */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; background: var(--vert-profond); color: var(--creme); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; min-height: 46px; }
.bouton:hover { background: #2B4F25; }
.bouton.vert { background: var(--vert); color: var(--vert-profond); }
.bouton.clair { background: var(--papier); color: var(--vert-profond); border: 1.5px solid var(--trait); }
.bouton.petit { min-height: 36px; padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.bouton.large { width: 100%; }
.lien { background: none; border: 0; padding: 0; color: var(--gris); text-decoration: underline; cursor: pointer; font-size: 14px; }

/* Cartes */
.carte { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r); box-shadow: var(--ombre); padding: 20px; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grille > * { min-width: 0; }

/* À faire maintenant */
.maintenant { background: var(--vert-profond); color: var(--creme); border-radius: 20px; padding: 26px; display: grid; gap: 14px; grid-template-columns: 1fr auto; align-items: center; margin-bottom: 28px; }
.maintenant .etiq { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--vert); font-weight: 700; }
.maintenant h2 { font-size: 26px; margin-top: 4px; }
.maintenant p { color: #D9E4C4; margin-top: 6px; }
.maintenant .bouton { background: var(--vert); color: var(--vert-profond); font-size: 16px; padding: 14px 22px; }
.chemin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pas { display: flex; gap: 12px; align-items: flex-start; }
.pas .n { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--vert-clair); color: var(--vert-profond); display: grid; place-items: center; font-weight: 700; }
.pas b { display: block; }
.pas span { color: var(--gris); font-size: 14px; }

/* Personnages */
.perso-carte { padding: 0; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .15s; }
.perso-carte:hover { transform: translateY(-2px); }
.perso-carte .visuel { aspect-ratio: 4/5; background: #EFEADC; display: grid; place-items: center; color: var(--gris); font-size: 14px; position: relative; }
.perso-carte .visuel img { width: 100%; height: 100%; object-fit: cover; }
.perso-carte .visuel .vide svg { width: 34px; height: 34px; }
.perso-carte .visuel .vide { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 12px; }
.perso-carte .corps { padding: 14px 16px 16px; display: grid; gap: 6px; }
.perso-carte h3 { font-size: 20px; }
.perso-carte .role { color: var(--gris); font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--vert-clair); color: var(--vert-profond); }
.badge.attente { background: var(--ambre-clair); color: var(--ambre); }
.badge.manque { background: var(--rouge-clair); color: var(--rouge); }
.perso-carte .visuel .badge { position: absolute; top: 10px; left: 10px; }

.fiche { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.fiche > * { min-width: 0; }
.traits { margin: 0; padding-left: 18px; color: var(--gris); font-size: 14px; display: grid; gap: 4px; }

/* Plans : liste */
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filtre { border: 1.5px solid var(--trait); background: var(--papier); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 550; }
.filtre.actif { background: var(--vert-profond); border-color: var(--vert-profond); color: var(--creme); }
.script-titre { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; flex-wrap: wrap; }
.script-titre h2 em { color: var(--vert-profond); }
.script-titre .compte { color: var(--gris); font-size: 14px; }
.lignes { display: grid; gap: 8px; }
.ligne { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: var(--papier); border: 1px solid var(--trait); border-radius: 14px; padding: 10px 14px; text-decoration: none; color: inherit; }
.ligne:hover { border-color: var(--vert); }
.ligne .code { font-family: "Instrument Serif", serif; font-style: italic; font-size: 26px; color: var(--vert); line-height: 1; }
.ligne .quoi { min-width: 0; }
.ligne .quoi b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.ligne .quoi span { color: var(--gris); font-size: 13px; }
.ligne.fait { background: #F6F9EC; }
.ligne.fait .code::after { content: " ✓"; font: 700 16px "Outfit"; color: var(--vert-profond); }
.avatars { display: flex; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #E6DFCC; border: 2px solid var(--papier); margin-left: -8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; overflow: hidden; }
.avatar:first-child { margin-left: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.manque { box-shadow: 0 0 0 2px var(--rouge); }

/* Plan : page */
.plan-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.plan-tete .code { font-family: "Instrument Serif", serif; font-style: italic; font-size: 44px; color: var(--vert); line-height: 1; }
.plan-tete .titre { flex: 1; min-width: 200px; }
.plan-tete .titre span { color: var(--gris); font-size: 14px; }
.nav-plans { display: flex; gap: 8px; }
.resume { color: var(--encre); font-size: 16px; margin-bottom: 18px; }
.etapes { display: grid; gap: 14px; }
.etape { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.etape .num { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--vert-clair); color: var(--vert-profond); }
.etape.ok .num { background: var(--vert-profond); color: var(--creme); }
.etape .contenu { display: grid; gap: 10px; min-width: 0; }
.etape h3 { font-size: 17px; }
.etape .aide { color: var(--gris); font-size: 14px; }
.joindre { display: flex; flex-wrap: wrap; gap: 10px; }
.tuile { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border: 1px solid var(--trait); border-radius: 12px; background: var(--papier); text-decoration: none; color: inherit; }
.tuile img, .tuile .ph { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #EFEADC; display: grid; place-items: center; font-size: 12px; color: var(--gris); }
.tuile b { display: block; font-size: 14px; }
.tuile span { font-size: 12px; color: var(--gris); }
.tuile.manque { border-color: var(--rouge); background: var(--rouge-clair); }
details summary { cursor: pointer; color: var(--gris); font-size: 14px; font-weight: 550; }
.prompt { margin-top: 8px; background: #F5F2E8; border: 1px solid var(--trait); border-radius: 12px; padding: 14px; font-size: 13px; white-space: pre-wrap; max-height: 300px; overflow: auto; }
.bascule { display: inline-flex; border: 1.5px solid var(--trait); border-radius: 999px; overflow: hidden; }
.bascule button { border: 0; background: var(--papier); padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.bascule button.actif { background: var(--vert-profond); color: var(--creme); }

/* Dépôt */
.depot { border: 2px dashed #CFC6AE; border-radius: 14px; background: #FCFAF4; padding: 18px; display: grid; place-items: center; gap: 6px; text-align: center; cursor: pointer; transition: all .15s; min-height: 110px; color: var(--gris); }
.depot:hover, .depot.survol { border-color: var(--vert); background: var(--vert-clair); color: var(--vert-profond); }
.depot svg { width: 28px; height: 28px; }
.depot b { color: var(--vert-profond); }
.depot .barre-envoi { width: 100%; max-width: 260px; height: 6px; border-radius: 6px; background: var(--trait); overflow: hidden; }
.depot .barre-envoi i { display: block; height: 100%; width: 0; background: var(--vert); }
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.media { position: relative; border-radius: 12px; overflow: hidden; background: #111; aspect-ratio: 16/9; }
.media.portrait { aspect-ratio: 4/5; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media .retirer { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.media .etiq { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 6px; }
.grand-visuel { border-radius: 16px; overflow: hidden; aspect-ratio: 4/5; background: #EFEADC; }
.grand-visuel img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Produits */
.produit { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.produit .ph { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: #EFEADC; display: grid; place-items: center; font-size: 12px; color: var(--gris); }
.produit .ph img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
input[type=text], input[type=url], input[type=password], select { width: 100%; border: 1.5px solid var(--trait); background: var(--papier); border-radius: 12px; padding: 11px 13px; min-height: 46px; }
label { display: block; font-size: 13px; font-weight: 650; color: var(--gris); margin: 10px 0 6px; }

/* Aide */
.reco { background: var(--vert-profond); color: var(--creme); border-radius: 20px; padding: 24px; display: grid; gap: 10px; }
.reco h2 { font-size: 26px; }
.reco h2 em { color: var(--vert); }
.reco a { color: #DDEBB0; }
.points { display: grid; gap: 6px; margin: 0; padding-left: 18px; }
.tutos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tuto { text-decoration: none; color: inherit; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--r); overflow: hidden; box-shadow: var(--ombre); }
.tuto img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #222; }
.tuto div { padding: 12px 14px 14px; }
.tuto b { display: block; font-size: 15px; line-height: 1.3; }
.tuto span { color: var(--gris); font-size: 13px; }
.section { margin-top: 32px; display: grid; gap: 14px; }

#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--vert-profond); color: var(--creme); padding: 12px 20px; border-radius: 999px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .2s; z-index: 50; max-width: 90vw; text-align: center; }
#toast.vu { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Entrée */
.page-entree { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.entree { width: min(380px, 100%); background: var(--papier); border: 1px solid var(--trait); border-radius: 20px; padding: 32px 26px; box-shadow: var(--ombre); display: grid; gap: 8px; justify-items: start; }
.entree h1 { margin: 10px 0 8px; }
.entree label, .entree input, .entree .bouton { width: 100%; }
.erreur { color: var(--rouge); font-weight: 600; }

@media (max-width: 820px) {
  .barre { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .jauges { width: 100%; margin: 0; gap: 14px; }
  .jauge { flex: 1; min-width: 0; }
  .onglets { top: 92px; padding: 8px 10px; gap: 2px; }
  .onglets a { padding: 8px 11px; font-size: 15px; }
  main { padding: 20px 14px 80px; }
  .maintenant { grid-template-columns: 1fr; padding: 20px; }
  .maintenant .bouton { width: 100%; }
  .chemin { grid-template-columns: 1fr; }
  .fiche { grid-template-columns: 1fr; }
  .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .perso-carte .corps { padding: 10px 12px 12px; }
  .perso-carte h3 { font-size: 17px; }
  .perso-carte .role { display: none; }
  .ligne { grid-template-columns: 52px 1fr; }
  .ligne .avatars { grid-column: 2; }
  .plan-tete .code { font-size: 36px; }
  .etape { grid-template-columns: 32px 1fr; gap: 10px; }
  .etape .num { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
