/* Création racontée native Le Fil (js/raconte/, spec docs/specs/2026-10-07-le-fil-design.md) : « Imaginer » un séjour (#/sejour/nouveau), la une d'un séjour (#/projet/<id>/une) et l'entrée
   racontée du projet pédagogique (#/projet/<id>/projet-pedagogique, /semer). Style de Le Fil : encre, filets, aucune couleur de décor, cibles de 44 px et plus, sept tailles de texte (12, 14, 16, 18,
   24, 30), Instrument Serif seulement pour le titre du séjour (la une). Le titre et le retour sont ceux de l'en-tête commun (js/fil/entete.js) : ces écrans n'ont ni fil d'Ariane, ni grand titre,
   ni surtitre. Préfixe `fra-` pour les écrans ; les COMPOSANTS partagés de js/raconte/phrases.js (mot, blanc, choix, amorces, bascule, phrase) sont stylés sous `[data-raconte]`, donc aussi pour
   « Mes activités » (js/mes-activites/, qui garde son habillage de page dans css/raconte.css). Remplace les règles d'Imaginer, de la une, du projet pédagogique et des phrases de css/raconte.css. */

[data-app] .fra { box-sizing: border-box; width: 100%; padding: 16px 0 56px; color: var(--f-encre); font: 400 16px/1.5 Inter, system-ui, sans-serif; }
[data-app] .fra *, [data-app] .fra *::before, [data-app] .fra *::after { box-sizing: border-box; }
[data-raconte] [hidden] { display: none !important; }
[data-raconte] .sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fra :where(h2, p, ol, ul, figure) { margin: 0; }
.fra :where(ol, ul) { list-style: none; padding: 0; }
.fra :focus-visible, [data-raconte] :focus-visible { outline: 2px solid var(--f-encre); outline-offset: 3px; }

/* ---------- Mise en page : les phrases à gauche, la une / l'arbre à droite (au téléphone : la une collée en haut) ---------- */
.fra-grille { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.fra-ecrire, .fra-droite { min-width: 0; }
.fra-titre-sec { margin: 0 0 8px; font: 600 16px/1.3 Inter, system-ui, sans-serif; color: var(--f-encre); }
.fra-etat { margin: 0 0 12px; padding: 7px 12px; width: fit-content; max-width: 100%; border: 1px dashed var(--f-encre-3); border-radius: 99px; color: var(--f-encre-2); font: 500 12px/1.3 Inter, system-ui, sans-serif; }
.fra-bas { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 16px 0 0; padding-top: 8px; border-top: 1px solid var(--f-filet); }
.fra-note { min-height: 21px; margin: 8px 0 0; color: var(--f-encre-2); font: 400 14px/1.5 Inter, system-ui, sans-serif; text-wrap: pretty; overflow-wrap: anywhere; }
.fra-note[data-etat="erreur"] { color: var(--f-urgent); }
.fra-aide { margin: 0; color: var(--f-encre-2); font: 400 12px/1.4 Inter, system-ui, sans-serif; text-wrap: pretty; }
.fra-vide { margin: 8px 0 0; color: var(--f-encre-3); font: 400 14px/1.45 Inter, system-ui, sans-serif; }
.fra-suite { display: grid; gap: 0; }
.fra-actions { display: grid; justify-items: start; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--f-filet); }
@media (min-width: 900px) {
  .fra-grille { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px 56px; align-items: start; }
  .fra-droite { display: grid; gap: 24px; }
  .fra-arbre { position: sticky; top: 88px; }
}
@media (max-width: 899px) {
  /* Imaginer, la une : l'aperçu reste visible en haut pendant qu'on écrit (sous la barre haute de 68 px), bord à bord comme le conteneur. */
  .fra-droite { display: contents; }
  .fra-apercu { position: sticky; top: 68px; z-index: 20; order: -1; margin-inline: calc(-1 * var(--f-marge, 16px)); padding: 8px var(--f-marge, 16px); background: var(--f-fond); border-bottom: 1px solid var(--f-filet); }
  .fra-ecrire { order: 0; }
  .fra-suite { order: 1; }
  .fra-apercu:has(.est-deplie) { position: static; }
}

/* ---------- Boutons : un seul plein par écran (à l'encre) ; le reste en liens soulignés ---------- */
:root [data-app] .fra .fra-bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 1px solid var(--f-encre); border-radius: 14px; background: var(--f-encre); color: var(--f-fond); font: 600 14px/1 Inter, system-ui, sans-serif; cursor: pointer; text-decoration: none; }
:root [data-app] .fra .fra-bouton:hover { background: var(--f-encre-2); border-color: var(--f-encre-2); }
:root [data-app] .fra .fra-bouton:disabled { opacity: .5; cursor: default; }
:root [data-app] [data-raconte] .fra-lien { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--f-encre-2); font: 400 14px/1.3 Inter, system-ui, sans-serif; text-decoration: underline; text-decoration-color: var(--f-encre-3); text-underline-offset: 3px; cursor: pointer; }
:root [data-app] [data-raconte] .fra-lien:hover { color: var(--f-encre); text-decoration-color: currentColor; }
:root [data-app] [data-raconte] .fra-lien:disabled { opacity: .55; cursor: progress; }

/* ---------- Phrases à compléter : mots à choisir, blancs, amorces (composants de js/raconte/phrases.js) ---------- */
[data-raconte] .phrase { margin: 0; font: 400 18px/1.6 Inter, system-ui, sans-serif; text-wrap: pretty; overflow-wrap: anywhere; }
[data-raconte] .phrases .phrase + .phrase, [data-raconte] .phrases .choix + .phrase { margin-top: 8px; }
@media (min-width: 900px) { [data-raconte] .phrase { font-size: 24px; line-height: 1.5; } }
:root [data-app] [data-raconte] .mot { display: inline-block; min-height: 44px; padding: 0 2px; border: 0; border-radius: 8px; background: none; color: var(--f-encre); font: inherit; font-weight: 600; line-height: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: currentColor; text-underline-offset: 6px; cursor: pointer; }
:root [data-app] [data-raconte] .mot-court { min-width: 1.4em; text-align: center; }
:root [data-app] [data-raconte] .mot:hover { background: var(--f-surface-2); }
:root [data-app] [data-raconte] .mot[aria-expanded="true"] { background: var(--f-surface-2); }
:root [data-app] [data-raconte] .mot.est-vide { color: var(--f-encre-3); font-weight: 400; text-decoration-style: dotted; }
:root [data-app] [data-raconte] .mot.est-vide:hover { color: var(--f-encre); }
[data-raconte] .choix { margin: 8px 0 12px; padding: 12px; border: 1px solid var(--f-filet); border-radius: 18px; background: var(--f-surface); }
[data-raconte] .choix-q { margin: 0 0 8px; color: var(--f-encre-2); font: 500 14px/1.4 Inter, system-ui, sans-serif; }
[data-raconte] .choix-liste { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
[data-raconte] .choix-liste li { display: flex; margin: 0; }
:root [data-app] [data-raconte] .choix-o { min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--f-filet); border-radius: 14px; background: var(--f-surface-2); color: var(--f-encre); font: 500 16px/1.2 Inter, system-ui, sans-serif; cursor: pointer; }
:root [data-app] [data-raconte] .choix-o:hover { border-color: var(--f-encre-3); }
:root [data-app] [data-raconte] .choix-o[aria-pressed="true"] { background: var(--f-encre); border-color: var(--f-encre); color: var(--f-fond); }
:root [data-app] [data-raconte] .blanc { min-height: 44px; min-width: 4ch; max-width: 100%; padding: 0 4px; border: 0; border-bottom: 2px solid var(--f-encre-3); border-radius: 8px 8px 0 0; background: transparent; box-shadow: none; color: var(--f-encre); font-family: Inter, system-ui, sans-serif; font-size: inherit; font-weight: 400; line-height: 1.4; field-sizing: content; vertical-align: baseline; }
:root [data-app] [data-raconte] .blanc::placeholder { color: var(--f-encre-3); opacity: 1; }
:root [data-app] [data-raconte] .blanc:hover { border-bottom-color: var(--f-encre); }
:root [data-app] [data-raconte] .blanc:focus, :root [data-app] [data-raconte] .blanc:focus-visible { outline: none; border-color: var(--f-encre); background: var(--f-surface-2); }
:root [data-app] [data-raconte] .blanc-zone { display: block; width: 100%; resize: none; overflow: hidden; padding-block: 6px; }
:root [data-app] [data-raconte] .blanc-n { min-width: 44px; text-align: center; }
[data-raconte] .amorces { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--f-encre-3); font: 400 14px/1.4 Inter, system-ui, sans-serif; }
[data-raconte] .amorces-lib { flex: 1 1 100%; }
[data-raconte] .amorces .sep { display: none; }
:root [data-app] [data-raconte] .amorce { min-height: 44px; padding: 0 14px; border: 1px solid var(--f-filet); border-radius: 14px; background: var(--f-surface); color: var(--f-encre-2); font: 400 14px/1.3 Inter, system-ui, sans-serif; text-align: left; cursor: pointer; }
:root [data-app] [data-raconte] .amorce:hover { border-color: var(--f-encre-3); color: var(--f-encre); }
/* Bascule (interrupteur) */
[data-raconte] .bascule { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; font: 500 14px/1.3 Inter, system-ui, sans-serif; cursor: pointer; }
[data-raconte] .bascule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
[data-raconte] .bascule-piste { position: relative; flex: none; width: 44px; height: 26px; border: 1px solid var(--f-filet); border-radius: 13px; background: var(--f-surface-2); }
[data-raconte] .bascule-piste::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--f-encre-2); transition: transform 160ms var(--f-spring, ease); }
[data-raconte] .bascule input:checked + .bascule-piste { background: var(--f-encre); border-color: var(--f-encre); }
[data-raconte] .bascule input:checked + .bascule-piste::after { transform: translateX(18px); background: var(--f-fond); }
[data-raconte] .bascule input:focus-visible + .bascule-piste { outline: 2px solid var(--f-encre); outline-offset: 3px; }

/* ---------- Imaginer : « Déjà prêt pour la suite », simulation ---------- */
.fra-deja { margin: 0; }
.fra-deja-l { padding: 12px 0; border-bottom: 1px solid var(--f-filet); color: var(--f-encre-2); font: 400 14px/1.45 Inter, system-ui, sans-serif; text-wrap: pretty; }
.fra-deja-l b { color: var(--f-encre); font-weight: 600; }
.fra-sim { display: grid; gap: 2px; margin-top: 12px; }

/* ---------- La une (aperçu en direct) ---------- */
.fra-une { position: relative; padding: 16px; border: 1px solid var(--f-filet); border-radius: 24px; background: var(--f-surface); }
.fra-une-oreille { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--f-filet); color: var(--f-encre-3); font: 500 12px/1.3 Inter, system-ui, sans-serif; }
.fra-une-photo { position: relative; margin: 0 0 12px; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 14px; background: var(--f-surface-2); }
.fra-une-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fra-une-photo-vide { position: absolute; inset: 0; display: grid; place-items: center; border: 1px dashed var(--f-filet); border-radius: 14px; color: var(--f-encre-3); }
.fra-une-credit-hote .une-credit { margin: -4px 0 12px; }
.fra-une-surtitre { margin: 0 0 4px; color: var(--f-encre-2); font: 500 12px/1.4 Inter, system-ui, sans-serif; }
.fra-une-titre { margin: 0; font: 400 30px/1.15 'Instrument Serif', Georgia, serif; text-wrap: balance; overflow-wrap: anywhere; }
.fra-une-chapo { margin: 6px 0 0; color: var(--f-encre-2); text-wrap: pretty; overflow-wrap: anywhere; }
.fra-une-intention { margin: 12px 0 0; padding-left: 12px; border-left: 2px solid var(--f-encre-3); color: var(--f-encre); text-wrap: pretty; overflow-wrap: anywhere; }
.fra-une .est-vide { color: var(--f-encre-3); }
.fra-une-faits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; border-top: 1px solid var(--f-filet); }
.fra-une-faits li { display: grid; gap: 2px; min-width: 0; padding: 10px 8px 0 0; }
.fra-une-faits li + li { padding-left: 12px; border-left: 1px solid var(--f-filet); }
.fra-une-faits span { color: var(--f-encre-2); font: 500 12px/1.3 Inter, system-ui, sans-serif; }
.fra-une-faits b { font: 600 14px/1.3 Inter, system-ui, sans-serif; overflow-wrap: anywhere; }
.fra-une-deplier { display: none; }
@media (max-width: 899px) {
  .fra-une { display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 12px; padding: 8px; border-radius: 18px; }
  .fra-une-oreille { display: none; }
  .fra-une-photo { grid-row: 1 / span 2; align-self: start; margin: 0; aspect-ratio: 1; border-radius: 10px; }
  .fra-une-texte { min-width: 0; }
  .fra-une-credit-hote { grid-column: 1; grid-row: 3; }
  .fra-une-credit-hote .une-credit { margin: 4px 0 0; font-size: 12px; }
  .fra-une-titre { font-size: 24px; }
  .fra-une-chapo { margin-top: 2px; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .fra-une-intention, .fra-une-faits { display: none; }
  :root [data-app] .fra .fra-une-deplier { display: inline-flex; align-items: center; grid-column: 2; min-height: 44px; padding: 0; border: 0; background: none; color: var(--f-encre-2); font: 400 14px/1.3 Inter, system-ui, sans-serif; text-decoration: underline; text-decoration-color: var(--f-encre-3); text-underline-offset: 3px; cursor: pointer; }
  .fra-une.est-deplie { grid-template-columns: minmax(0, 1fr); }
  .fra-une.est-deplie .fra-une-photo { grid-row: auto; aspect-ratio: 3 / 2; margin-bottom: 12px; border-radius: 14px; }
  .fra-une.est-deplie .fra-une-credit-hote { grid-column: 1; grid-row: auto; }
  .fra-une.est-deplie .fra-une-chapo { display: block; -webkit-line-clamp: none; }
  .fra-une.est-deplie .fra-une-intention { display: block; }
  .fra-une.est-deplie .fra-une-faits { display: grid; }
  .fra-une.est-deplie .fra-une-deplier { grid-column: 1; }
  [data-raconte] .blanc, [data-raconte] .mot { scroll-margin-top: 220px; }
}

/* ---------- La une d'un séjour existant : sélecteur de photo ---------- */
.fra-ed-photo { margin-top: 8px; }
.fra-ed-selecteur { margin: 4px 0 12px; }
[data-raconte] .choix-photos { padding: 12px; }
:root [data-app] [data-raconte] .img-sel-q { min-height: 44px; padding: 0 4px; border: 0; border-bottom: 2px solid var(--f-encre-3); border-radius: 8px 8px 0 0; background: transparent; color: var(--f-encre); font: 400 16px/1.3 Inter, system-ui, sans-serif; }
:root [data-app] [data-raconte] .img-sel-q:focus, :root [data-app] [data-raconte] .img-sel-q:focus-visible { outline: none; border-color: var(--f-encre); background: var(--f-surface-2); }
[data-raconte] .img-sel-choix { border-radius: 14px; }

/* ---------- Projet pédagogique : les phrases sèment l'arbre ---------- */
.fra-pdf { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin: 0 0 8px; color: var(--f-encre-2); font: 400 14px/1.4 Inter, system-ui, sans-serif; }
.fra-pdf .pdfv-retour { flex: 1 1 100%; margin-top: 4px; }
.fra-pp-phrase { padding: 12px 0; border-top: 1px solid var(--f-filet); }
.fra-pp-phrase:first-of-type { border-top-color: var(--f-encre); }
.fra-valeur-libre { color: var(--f-encre-2); font-style: italic; }
.fra-arbre { padding: 16px; border: 1px solid var(--f-filet); border-radius: 24px; background: var(--f-surface); }
.fra-noeuds { padding-top: 4px; }
.fra-noeuds ol { margin: 0; }
.fra-noeud { position: relative; padding: 8px 0 8px 20px; }
.fra-noeud::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid var(--f-encre-3); }
.fra-noeud:last-child::before { bottom: auto; height: 22px; }
.fra-noeud::after { content: ''; position: absolute; left: 0; top: 22px; width: 12px; border-top: 1px solid var(--f-encre-3); }
.fra-noeud-type { display: block; color: var(--f-encre-2); font: 600 12px/1.3 Inter, system-ui, sans-serif; }
.fra-noeud-texte { margin-top: 2px; font: 400 16px/1.4 Inter, system-ui, sans-serif; text-wrap: pretty; overflow-wrap: anywhere; }
.fra-noeud-def { margin-top: 2px; color: var(--f-encre-2); font: 400 14px/1.4 Inter, system-ui, sans-serif; text-wrap: pretty; }
.fra-noeud.est-vide > .fra-noeud-texte { color: var(--f-encre-3); font-style: italic; }
.fra-noeud.est-atelier > .fra-noeud-texte { color: var(--f-encre-3); font-size: 14px; font-style: italic; }
.fra-noeud.est-atelier > .fra-noeud-type { color: var(--f-encre-3); }
.fra-noeud.est-atelier::before, .fra-noeud.est-atelier::after { opacity: .45; }
.fra-noeud-eval { margin-top: 8px; border-top: 1px solid var(--f-filet); }

@media (prefers-reduced-motion: reduce) { [data-raconte] *, [data-raconte] *::before, [data-raconte] *::after { transition: none; } }
