/* ═══════════════════════════════════════════════════════════
   AppSocle — feuille de style du socle des applications mobiles (13 octobre 2026)
   ───────────────────────────────────────────────────────────
   Extraite de « Prompt de poche » avec son JavaScript (/shared/appli-socle.js). Mobile
   d'abord : cibles tactiles de 44 px au moins, zones sûres (encoche, barre de gestes),
   aucun effet qui dépende du survol, un seul défilement vertical.

   ⚠️ À charger APRÈS /shared/jetons.css (échelle de rayons et d'ombres du site : jamais de
   littéral — controle-jetons.mjs le refuserait) et AVANT la feuille de l'appli, qui
   décline les couleurs : les jetons ci-dessous (--accent, --fond, --encre…) sont des
   valeurs PAR DÉFAUT, une appli les redéfinit dans son :root (et dans
   html[data-theme="sombre"]) ; ses règles propres viennent après celles du socle.

   Balisage conventionnel : #app > header.barre + main#ecran + .cta + nav.dock, #toast.
   La teinte des ombres est --ombre-teinte (l'encre de l'appli, jamais du noir nu).
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ombre-teinte: 26, 22, 20;
  --fond: #faf6f0;
  --panneau: #ffffff;
  --panneau-2: #f4ede4;
  --trait: rgba(26, 22, 20, 0.13);
  --encre: #1a1614;
  --doux: #6b5f56;
  --accent: #a9622d;
  --accent-fort: #7e4519;
  --accent-clair: #f6e8da;
  --sur-accent: #ffffff;
  --ok: #2f7a4f;
  --alerte: #a8442a;
  --alerte-clair: #fbece8;
  --dock-h: 62px;
  --haut-h: 56px;
  --bas: env(safe-area-inset-bottom, 0px);
  --police: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --police-titre: 'Fraunces', Georgia, serif;
  color-scheme: light;
}
html[data-theme="sombre"] {
  --ombre-teinte: 0, 0, 0;
  --fond: #16120f;
  --panneau: #211b17;
  --panneau-2: #2b231e;
  --trait: rgba(243, 236, 228, 0.16);
  --encre: #f3ece4;
  --doux: #b3a69a;
  --accent: #e0955c;
  --accent-fort: #f0b383;
  --accent-clair: #3a2a1e;
  --sur-accent: #1a1209;
  --ok: #6cc48f;
  --alerte: #f08a6f;
  --alerte-clair: #3a1f19;
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--haut-h) + 12px); }
body {
  font-family: var(--police);
  background: var(--fond);
  color: var(--encre);
  line-height: 1.5;
  font-size: 16px;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-appearance: none; appearance: none; touch-action: manipulation; }
textarea, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── barre du haut ─────────────────────────────────────── */
.barre {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: calc(var(--haut-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: var(--fond);
  border-bottom: 1px solid var(--trait);
}
.barre-titre { display: flex; align-items: center; gap: 10px; min-width: 0; }
.barre-titre > div { min-width: 0; }
.barre h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { font-size: 26px; line-height: 1; }
.barre h1 { font-family: var(--police-titre); font-size: 1.2rem; font-weight: 600; line-height: 1.15; }
/* La boussole du site, à côté du titre (la même que dans la bio de l'accueil). */
.boussole-titre { display: inline-block; width: 24px; height: 24px; vertical-align: -4px; margin-left: 4px; }
.barre p { font-size: .76rem; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.barre-btn { width: 44px; height: 44px; border-radius: var(--r-pill); font-size: 20px; background: var(--panneau-2); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
/* Déconnexion (version protégée) : un mot, pas seulement une icône — on ne devine pas ce que fait une porte. */
.barre-btn-texte { width: auto; padding: 0 14px; gap: 6px; font-size: 20px; color: var(--encre); }
.barre-btn-texte .barre-btn-mot { font-size: .82rem; font-weight: 600; }
/* Étroit : le logo cède la place au bouton, le titre ne passe jamais dessous. */
@media (max-width: 420px) { .barre .logo { display: none; } .barre h1 { font-size: 1rem; } .barre-actions { gap: 4px; } .barre-btn-texte { padding: 0 9px; gap: 4px; } .barre-btn-texte .barre-btn-mot { font-size: .78rem; } }
@media (max-width: 340px) { .barre-btn-texte { padding: 0 9px; } .barre-btn-texte .barre-btn-mot { font-size: .76rem; } }

/* ── contenu ───────────────────────────────────────────── */
#ecran { max-width: 720px; margin: 0 auto; padding: 18px 16px calc(var(--dock-h) + 96px + var(--bas)); outline: none; }

.etiquette { display: block; font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; }
.etiquette.petit { font-size: .92rem; }
.etiquette em { font-weight: 400; color: var(--doux); font-style: normal; }

.champ { position: relative; }
textarea, select, input[type="text"], input[type="search"] {
  width: 100%;
  background: var(--panneau);
  border: 1.5px solid var(--trait);
  border-radius: var(--r-md);
  padding: 12px 14px;
  line-height: 1.5;
  box-shadow: var(--sh-1);
}
textarea { resize: vertical; min-height: 130px; font-size: 1rem; }
textarea:focus, select:focus, input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-clair); }
.champ-pied { display: flex; justify-content: space-between; align-items: center; font-size: .75rem; color: var(--doux); padding: 4px 4px 0; }

.btn-2.pleine { width: 100%; margin-bottom: 4px; }

.bloc {
  background: var(--panneau); border: 1px solid var(--trait);
  border-radius: var(--r-lg); padding: 14px; margin-top: 14px; box-shadow: var(--sh-1);
}
.bloc h3 { font-size: .98rem; margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bloc h3 small { font-weight: 400; color: var(--doux); font-size: .78rem; }
.bloc .etiquette { margin-bottom: 6px; }
.note { font-size: .78rem; color: var(--doux); margin-top: 8px; }
.note.maj-appli { margin-top: 16px; }   /* un léger espace avant le bloc « mise à jour + signature » */
.puces-texte { list-style: none; padding-left: 2px; display: grid; gap: 5px; font-size: .9rem; line-height: 1.45; }
.rangee { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ── boutons ───────────────────────────────────────────── */
.btn-1, .btn-2 {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-md);
  font-weight: 700; text-align: center; line-height: 1.2;
}
.btn-1 { background: var(--accent); color: var(--sur-accent); box-shadow: var(--sh-2); }
.btn-1:active { transform: translateY(1px); }
.btn-1[disabled] { opacity: .5; box-shadow: none; }
.btn-1.grand { width: 100%; min-height: 54px; font-size: 1.05rem; }
.btn-2 { background: var(--panneau-2); border: 1.5px solid var(--trait); }
.btn-lien { color: var(--accent-fort); font-weight: 700; min-height: 44px; padding: 0 8px; font-size: .9rem; white-space: nowrap; flex: 0 0 auto; }
.icone { width: 44px; height: 44px; border-radius: var(--r-pill); font-size: 20px; background: var(--panneau-2); }
.icone[aria-pressed="true"] { background: var(--accent-clair); }

/* ── bouton d'action principal, au pouce ───────────────── */
.cta {
  position: fixed; left: 0; right: 0; z-index: 25;
  bottom: calc(var(--dock-h) + var(--bas));
  padding: 24px 16px 10px;
  background: linear-gradient(to top, var(--fond) 62%, transparent);
  pointer-events: none;
}
.cta .btn-1 { max-width: 720px; margin: 0 auto; display: flex; pointer-events: auto; }

/* ── la barre d'actions du bas ─────────────────────────── */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center;
  height: calc(var(--dock-h) + var(--bas));
  padding: 0 4px var(--bas);
  background: var(--panneau);
  border-top: 1px solid var(--trait);
  box-shadow: var(--sh-3);
}
.dock button {
  flex: 1 1 0; max-width: 120px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: var(--r-md); color: var(--doux);
}
.d-ico { font-size: 21px; line-height: 1; }
.d-lib { font-size: .68rem; font-weight: 600; letter-spacing: .01em; }
.dock button[aria-current="true"] { color: var(--accent-fort); background: var(--accent-clair); }
.dock button:active { background: var(--panneau-2); }

.erreur { margin-top: 14px; background: var(--alerte-clair); color: var(--alerte); border-radius: var(--r-md); padding: 12px 14px; font-size: .9rem; font-weight: 600; }

/* ── feuilles (fenêtres du bas) ────────────────────────── */
.voile { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45); animation: fond .18s ease; }
@keyframes fond { from { opacity: 0; } }
.feuille {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-width: 720px; margin: 0 auto;
  max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--panneau); border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-3);
  padding-bottom: var(--bas);
  animation: monte .22s ease;
}
@keyframes monte { from { transform: translateY(40px); opacity: 0; } }
.feuille.haute { height: 88dvh; }
/* Sur ordinateur, une fenêtre posée au bas de l'écran paraît perdue : on la centre. Le téléphone garde la feuille du bas. */
@media (min-width: 760px) and (min-height: 480px) {
  .feuille {
    top: 0; bottom: 0; height: fit-content;
    margin: auto; width: calc(100% - 48px);
    border-radius: var(--r-xl);
    padding-bottom: 0;
  }
  .feuille.haute { height: min(88dvh, 820px); }
  .feuille-prise { display: none; }
  .feuille-tete { padding-top: 12px; }
}
.feuille-prise { width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--trait); margin: 8px auto 0; flex: 0 0 auto; }
.feuille-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 18px; flex: 0 0 auto; }
.feuille-tete h2 { font-family: var(--police-titre); font-size: 1.15rem; }
.feuille-fermer { width: 44px; height: 44px; border-radius: var(--r-pill); font-size: 18px; background: var(--panneau-2); }
.feuille-corps { overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 18px; flex: 1 1 auto; }
.feuille-corps > p { margin: 4px 0 12px; color: var(--doux); font-size: .9rem; }

.liste { display: grid; gap: 8px; list-style: none; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 56px; padding: 10px 14px;
  background: var(--panneau-2); border: 1.5px solid transparent; border-radius: var(--r-md);
}
a.item { text-decoration: none; color: inherit; }
.item:active { border-color: var(--accent); }
.item-ico { font-size: 22px; flex: 0 0 auto; width: 30px; text-align: center; }
/* Le lien vers les prompts à copier : une tuile d'accent, une icône grande dans un rond plein, pour qu'on le voie en premier. */
.item.item-vedette { background: var(--accent-clair); border-color: var(--accent); }
.item-vedette .item-ico { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--accent); border-radius: var(--r-pill); box-shadow: var(--sh-1); }
.item-vedette .item-txt b { color: var(--accent-fort); }
.item-txt { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.item-txt b { font-size: .96rem; line-height: 1.3; }
.item-txt small { font-size: .78rem; color: var(--doux); line-height: 1.35; margin-top: 1px; }
.item-txt small.a-verifier { color: var(--alerte); font-weight: 600; margin-top: 3px; }
.item-fin { color: var(--doux); flex: 0 0 auto; }

.petit.doux { font-size: .8rem; color: var(--doux); margin: 8px 0 0; line-height: 1.4; }
/* Filtre des formations : la langue d'abord, « Uniquement gratuites » ensuite. */
.puces { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.puce {
  min-width: 44px;
  min-height: 44px; padding: 8px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--trait); background: var(--panneau); color: var(--encre);
  font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
}
.puce[aria-pressed="true"] { background: var(--accent-clair); border-color: var(--accent); color: var(--accent-fort); }
.puce:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item.danger b { color: var(--alerte); }

.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--panneau-2); border-radius: var(--r-md); min-height: 56px; }
.interrupteur small { display: block; color: var(--doux); font-size: .76rem; line-height: 1.35; }
.interrupteur input { width: 26px; height: 26px; accent-color: var(--accent); flex: 0 0 auto; }

.alerte-bloc { background: var(--alerte-clair); color: var(--alerte); border-radius: var(--r-md); padding: 12px 14px; font-size: .86rem; margin-bottom: 12px; line-height: 1.45; }
.alerte-bloc ul { margin: 6px 0 0 18px; }
.vide { text-align: center; color: var(--doux); padding: 28px 10px; font-size: .92rem; }
.pile { display: grid; gap: 10px; }

/* ── message passager ──────────────────────────────────── */
#toast {
  position: fixed; left: 50%; z-index: 90; transform: translate(-50%, 20px);
  bottom: calc(var(--dock-h) + var(--bas) + 84px);
  width: max-content; max-width: min(92vw, 520px);
  display: flex; align-items: center; gap: 12px;
  background: var(--encre); color: var(--fond);
  padding: 12px 16px; border-radius: var(--r-md); box-shadow: var(--sh-3);
  font-size: .9rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: var(--accent); font-weight: 800; min-height: 36px; padding: 0 4px; filter: brightness(1.4); }


/* ── grands écrans : on garde la forme d'appli, centrée ── */
@media (min-width: 760px) {
  .dock { left: 50%; right: auto; width: 720px; transform: translateX(-50%); border-radius: var(--r-lg) var(--r-lg) 0 0; border: 1px solid var(--trait); border-bottom: 0; }
  .d-lib { font-size: .74rem; }
}

/* ── clavier ouvert : on range la barre du bas, le bouton principal passe en bas de ce qui reste ── */
html.clavier .dock { display: none; }
html.clavier .cta { bottom: 0; padding-top: 10px; }
html.clavier #toast { bottom: 78px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Une ligne de liste avec un petit bouton à côté (refaire, supprimer). */
.ligne-double { display: flex; gap: 8px; align-items: stretch; }
.ligne-double .item { flex: 1 1 auto; min-width: 0; }
.item-aux { flex: 0 0 auto; min-width: 48px; min-height: 48px; border-radius: var(--r-md); border: 1.5px solid var(--trait); background: var(--panneau-2); color: var(--accent-fort); font-size: 1.15rem; font-family: inherit; cursor: pointer; }
.item-aux:active { border-color: var(--accent); }
.item-aux:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.visite { text-align: center; padding: 8px 4px 0; }
.visite-ico { font-size: 44px; line-height: 1.1; }
.visite h3 { font-size: 1.15rem; margin: 8px 0 6px; }
.visite p { font-size: .95rem; line-height: 1.5; color: var(--doux); }
.visite-points { display: flex; justify-content: center; gap: 8px; margin: 14px 0; }
.visite-points span { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--trait); }
.visite-points span.actif { background: var(--accent); width: 22px; }

/* Visite (13 octobre 2026) : une accroche, un avant/après sur le premier panneau, trois puces au plus. */
.visite-liste { list-style: none; margin: 12px 0 0; padding: 0; text-align: left; display: grid; gap: 8px; }
.visite-liste li { position: relative; padding-left: 26px; font-size: .95rem; line-height: 1.4; }
.visite-liste li::before { content: "✓"; position: absolute; left: 2px; top: 0; font-weight: 700; color: var(--accent-fort); }
.visite-note { margin: 12px 0 0; font-size: .85rem; }

.micro { min-height: 44px; padding: 0 12px; border-radius: var(--r-pill); border: 1.5px solid var(--trait); background: var(--panneau-2); color: var(--accent-fort); font: inherit; font-size: .82rem; cursor: pointer; }
.micro[hidden] { display: none; }
.micro-champ { display: block; margin: 6px 0 0 auto; }
.micro[aria-pressed="true"] { background: var(--accent-clair); border-color: var(--accent); }
.micro:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.etapes-install { margin: 0 0 12px 22px; display: grid; gap: 8px; font-size: .92rem; line-height: 1.45; }

/* Le drapeau de la langue, en haut à droite : celui de la langue VERS laquelle on bascule. */
.barre-btn-langue .drapeau { display: none; width: 28px; height: 19px; border-radius: var(--r-xs); box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); }
.barre-btn-langue[data-vers="en"] .drapeau-en, .barre-btn-langue[data-vers="fr"] .drapeau-fr { display: block; }

/* ── onglets (13 octobre 2026) ─────────────────────────────
   Une barre collée en haut du corps d'une feuille : l'icône au-dessus du libellé, cinq onglets tiennent à 360 px
   (cibles de 56 px au moins). Au-delà, la rangée défile du doigt plutôt que de passer à la ligne. */
.onglets {
  position: sticky; top: -4px; z-index: 2;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px 12px; padding: 6px 12px 8px;
  background: var(--panneau); border-bottom: 1px solid var(--trait);
}
.onglets::-webkit-scrollbar { display: none; }
.onglet {
  flex: 1 0 auto; min-width: 56px; min-height: 56px; padding: 6px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: var(--r-md); color: var(--doux); white-space: nowrap; border-bottom: 3px solid transparent;
}
.onglet-ico { font-size: 20px; line-height: 1; }
.onglet-lib { font-size: .68rem; font-weight: 700; letter-spacing: .01em; }
.onglet[aria-selected="true"] { color: var(--accent-fort); background: var(--accent-clair); border-bottom-color: var(--accent); }
.onglet:active { background: var(--panneau-2); }
.onglet-panneau { outline: none; }
.onglet-panneau > .liste + .liste, .onglet-panneau > .liste + .interrupteur, .onglet-panneau > .interrupteur + .liste { margin-top: 12px; }
.onglet-titre { margin: 4px 2px 8px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
@media (max-width: 359px) { .onglet-lib { font-size: .62rem; } }

/* ── installation, valorisée ───────────────────────────────
   L'en-tête (icône, titre, accroche), les avantages en tuiles, le bouton, le pas-à-pas par appareil. */
.install-hero { text-align: center; padding: 6px 4px 4px; }
.install-icone { display: block; margin: 0 auto 8px; width: 64px; height: 64px; border-radius: var(--r-lg); box-shadow: var(--sh-2); }
.install-hero h3 { font-family: var(--police-titre); font-size: 1.3rem; line-height: 1.2; margin: 0 0 6px; }
.install-hero p { font-size: .95rem; line-height: 1.5; color: var(--doux); margin: 0 auto; max-width: 34em; }
.install-systemes { margin: 12px 0 2px; padding: 10px 12px; text-align: center; border: 1.5px solid var(--accent); border-radius: var(--r-lg); background: var(--accent-clair); }
.install-systemes b { display: block; font-size: .9rem; color: var(--accent-fort); }
.install-systemes ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.install-systemes li { font-size: .82rem; font-weight: 600; padding: 5px 10px; border-radius: var(--r-pill); background: var(--panneau); border: 1px solid var(--trait); }
.install-avantages { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0 14px; }
.install-avantages li { display: flex; gap: 10px; align-items: flex-start; padding: 10px; background: var(--accent-clair); border-radius: var(--r-md); }
.install-av-ico { font-size: 22px; line-height: 1.2; flex: 0 0 auto; }
.install-av-txt { display: flex; flex-direction: column; min-width: 0; }
.install-av-txt b { font-size: .88rem; line-height: 1.25; color: var(--accent-fort); }
.install-av-txt small { font-size: .76rem; line-height: 1.35; color: var(--doux); margin-top: 2px; }
@media (max-width: 339px) { .install-avantages { grid-template-columns: 1fr; } }
.install-go { width: 100%; margin: 4px 0 6px; }
.install-ok { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-clair); font-weight: 600; font-size: .92rem; }
.install-ok-ico { flex: 0 0 auto; width: 28px; height: 28px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; background: var(--ok); color: var(--sur-accent); font-weight: 800; }
.install-pas { margin-top: 10px; }
.install-pas h4 { font-size: .98rem; margin: 0 0 4px; }
.install-pas .etapes-install { margin: 12px 0 4px 22px; }
.install-autre { margin-top: 16px; padding: 12px 14px; border: 1.5px dashed var(--trait); border-radius: var(--r-md); display: grid; gap: 6px; }
.install-autre small { color: var(--doux); font-size: .82rem; line-height: 1.4; }
