/* gpalémo : un billet de voyage en papier, encre bleu nuit et tampon rouge. */

@font-face {
  font-family: "Young Serif";
  src: url("polices/young-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("polices/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("polices/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --papier: #f3ecdf;
  --papier-2: #e8dcc8;
  --carte: #fffdf7;
  --encre: #1b2a4a;
  --encre-2: #4b5876;
  --trait: #cbbca3;
  --tampon: #c8402a;
  --tampon-fonce: #9f2f1d;
  --vert: #1d6e53;
  --ombre: 0 1px 0 rgba(27, 42, 74, .06), 0 8px 24px -12px rgba(27, 42, 74, .35);
  --rayon: 14px;
  --barre-bas: calc(64px + env(safe-area-inset-bottom));
  --titre: "Young Serif", Georgia, "Times New Roman", serif;
  --texte: "Atkinson Hyperlegible Next", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--texte);
  font-size: 17px;
  line-height: 1.45;
  color: var(--encre);
  background-color: var(--papier);
  /* grain de papier : bruit SVG très léger */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .27 0 0 0 0 .15 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  padding-bottom: calc(var(--barre-bas) + 16px);
}
img { max-width: 100%; }
a { color: var(--encre); text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--tampon); outline-offset: 2px; }
[hidden] { display: none !important; }

.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.saut { position: absolute; left: -9999px; }
.saut:focus { left: 16px; top: 8px; z-index: 50; background: var(--carte); padding: 8px 12px; border-radius: 8px; }

/* En-tête */
.entete {
  position: relative; z-index: 20;
  padding: calc(10px + env(safe-area-inset-top)) 16px 6px;
}
.entete-ligne { display: flex; align-items: center; gap: 12px; max-width: 1180px; margin: 0 auto; }
.marque {
  font-family: var(--titre); font-size: 28px; line-height: 1; text-decoration: none; color: var(--encre);
  letter-spacing: -.01em;
}
.marque-e { color: var(--tampon); }
.puce-pays {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 4px 14px 4px 6px; border-radius: 999px;
  border: 1.5px solid var(--encre); background: var(--carte);
  text-align: left; max-width: 62vw;
}
.puce-pays-drapeau { font-size: 26px; line-height: 1; width: 34px; text-align: center; }
.puce-pays-texte { display: flex; flex-direction: column; min-width: 0; }
.puce-pays-texte > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pays-nom { font-weight: 700; font-size: 15px; line-height: 1.1; }
.puce-pays-langue { font-size: 13px; color: var(--encre-2); line-height: 1.2; }
.puce-pays.a-choisir { border-color: var(--tampon); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tampon) 18%, transparent); }
.etat-reseau {
  max-width: 1180px; margin: 6px auto 0; font-size: 14px; color: var(--encre-2);
  display: flex; align-items: center; gap: 6px;
}
.etat-reseau::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vert); }
.etat-reseau.hors-ligne::before { background: var(--tampon); }

/* Onglets : barre du bas sur téléphone, dans l'en-tête sur grand écran */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--encre); padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -6px 20px -10px rgba(0, 0, 0, .4);
}
.onglets a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; color: #d7deec; text-decoration: none; font-size: 13px; position: relative;
}
.onglets a svg { width: 24px; height: 24px; }
.onglets a[aria-current="page"] { color: #fff; }
.onglets a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--tampon);
}

main { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.vue { padding-top: 14px; }
h2 { font-family: var(--titre); font-weight: 400; font-size: 30px; margin: 8px 0 6px; letter-spacing: -.01em; }
h3 { font-size: 17px; margin: 26px 0 10px; }
.aide { color: var(--encre-2); font-size: 15px; margin: 6px 0 14px; }
.titre-intro {
  font-family: var(--texte); font-weight: 400; font-size: 15.5px; color: var(--encre-2);
  margin: 0 0 12px; max-width: 60ch;
}

/* Le billet : 4 cases séparées par des pointillés, avec les encoches d'un ticket */
.colonne-billet {
  position: sticky; top: 0; z-index: 10;
  padding: calc(8px + env(safe-area-inset-top)) 0 12px; margin: 0 -16px; padding-inline: 16px;
  background: linear-gradient(var(--papier) 88%, color-mix(in srgb, var(--papier) 0%, transparent));
}
.billet {
  position: relative; display: flex; background: var(--carte); border-radius: var(--rayon);
  box-shadow: var(--ombre); border: 1px solid color-mix(in srgb, var(--trait) 70%, transparent);
  --encoche: radial-gradient(circle at 0 50%, var(--papier) 7px, transparent 7.5px);
}
.billet.secousse { animation: secousse .4s; }
@keyframes secousse { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.billet-talon {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--titre); font-size: 13px; color: var(--tampon);
  padding: 10px 6px; border-right: 2px dashed var(--trait); text-align: center; letter-spacing: .04em;
}
.billet-cases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); flex: 1; min-width: 0; }
.billet-cases > li { position: relative; min-width: 0; }
.billet-cases > li + li { border-left: 2px dashed var(--trait); }
.billet-cases > li + li::before, .billet-cases > li + li::after {
  content: ""; position: absolute; left: -8px; width: 14px; height: 8px; background: var(--papier);
}
.billet-cases > li + li::before { top: -1px; border-radius: 0 0 8px 8px; }
.billet-cases > li + li::after { bottom: -1px; border-radius: 8px 8px 0 0; }
.case {
  width: 100%; height: 100%; min-height: 112px; border: 0; background: none; padding: 8px 4px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px;
  touch-action: pan-y; border-radius: 10px;
}
.case-vide { color: var(--trait); justify-content: center; font-size: 13px; }
.case-vide svg { width: 30px; height: 30px; }
.case .image { width: 56px; height: 56px; }
.case-nom {
  font-weight: 700; font-size: 14px; line-height: 1.15; text-align: center; max-width: 100%;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto;
}
.case-fr { font-size: 12px; color: var(--encre-2); line-height: 1.1; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.case.tampon { animation: tampon .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes tampon { 0% { transform: scale(1.5) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

.billet-actions { display: flex; gap: 10px; margin-top: 10px; }
.bouton-montrer {
  flex: 1; min-height: 56px; border: 0; border-radius: 14px;
  background: var(--tampon); color: #fff; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 2px 0 var(--tampon-fonce), 0 10px 20px -12px var(--tampon-fonce);
  transition: transform .08s;
}
.bouton-montrer svg { width: 24px; height: 24px; stroke-width: 2.2; }
.bouton-montrer:active:not(:disabled) { transform: translateY(2px) rotate(-.6deg); box-shadow: 0 0 0 var(--tampon-fonce); }
.bouton-montrer:disabled { background: var(--papier-2); color: var(--encre-2); box-shadow: none; cursor: default; }
.bouton-rond {
  width: 56px; height: 56px; flex: none; border-radius: 14px; border: 1.5px solid var(--encre);
  background: var(--carte); display: grid; place-items: center;
}
.bouton-rond svg { width: 24px; height: 24px; }
.bouton-rond:disabled { border-color: var(--trait); color: var(--trait); cursor: default; }

/* Recherche et catégories */
.recherche { position: relative; margin-top: 4px; }
.recherche > svg { position: absolute; left: 16px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); color: var(--encre-2); pointer-events: none; }
.recherche input {
  width: 100%; min-height: 56px; border-radius: 14px; border: 1.5px solid var(--encre);
  background: var(--carte); padding: 0 52px 0 48px; font-size: 18px;
  -webkit-appearance: none; appearance: none;
}
.recherche input::placeholder { color: #7d869c; }
.recherche input::-webkit-search-cancel-button { display: none; }
.recherche-vider { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; }
.recherche-vider svg { width: 20px; height: 20px; }

.categories {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 6px; margin: 0 -16px;
  scrollbar-width: none; scroll-padding-inline: 16px;
}
.categories::-webkit-scrollbar { display: none; }
.categorie {
  flex: none; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 14px 4px 8px;
  border-radius: 999px; border: 1.5px solid var(--trait); background: var(--carte); font-size: 15px; white-space: nowrap;
}
.categorie .image { width: 28px; height: 28px; }
.categorie[aria-pressed="true"] { background: var(--encre); color: #fff; border-color: var(--encre); }
.categorie-pack { border-style: dashed; }

.grille-titre { font-size: 14px; color: var(--encre-2); margin: 8px 0 8px; min-height: 1.2em; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.tuile {
  position: relative; border: 1px solid color-mix(in srgb, var(--trait) 75%, transparent); background: var(--carte);
  border-radius: 12px; padding: 8px 4px 6px; min-height: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform .12s, box-shadow .12s;
}
.tuile:hover { box-shadow: var(--ombre); }
.tuile:active { transform: scale(.95); }
.tuile .image { width: 52px; height: 52px; }
.tuile-nom {
  font-size: 12.5px; line-height: 1.15; text-align: center; color: var(--encre-2);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.tuile-absente { border-style: dashed; background: transparent; }
.tuile-absente .image { opacity: .75; }
.tuile-badge {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--encre); color: #fff; display: grid; place-items: center;
}
.tuile-badge svg { width: 14px; height: 14px; stroke-width: 2.4; }
.tuile-suppr { outline: 2px solid var(--tampon); }
.tuile-suppr::after {
  content: ""; position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--tampon) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center/14px no-repeat;
}
.vide { grid-column: 1 / -1; color: var(--encre-2); padding: 16px 0; }
.photos-outils { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.bouton-photo { display: inline-flex; align-items: center; gap: 8px; }
.bouton-photo svg { width: 22px; height: 22px; }

/* Une image : SVG OpenMoji, photo, ou caractère quand le pack n'est pas téléchargé */
.image { position: relative; display: grid; place-items: center; flex: none; }
.image > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.image > img.photo { object-fit: cover; border-radius: 10%; }
.image-texte { font-size: 40px; line-height: 1; }
.image.barre::after {
  content: ""; position: absolute; inset: -4%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='44' fill='none' stroke='%23d62f1e' stroke-width='9' opacity='.92'/%3E%3Cpath d='M19 19 81 81' stroke='%23d62f1e' stroke-width='9' stroke-linecap='round' opacity='.92'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Boutons génériques */
.bouton-principal, .bouton-secondaire {
  min-height: 48px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer;
}
.bouton-principal { background: var(--encre); color: #fff; border: 1.5px solid var(--encre); }
.bouton-secondaire { background: var(--carte); color: var(--encre); border: 1.5px solid var(--encre); }
.bouton-danger { color: var(--tampon-fonce); border-color: var(--tampon-fonce); }
.bouton-principal.bouton-danger { background: var(--tampon-fonce); color: #fff; }
.bouton-lien { background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--encre-2); min-height: 44px; }
.bouton-lien[aria-pressed="true"] { color: var(--tampon-fonce); font-weight: 700; }
.badge { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--papier-2); color: var(--encre-2); white-space: nowrap; }
.badge-ok { background: color-mix(in srgb, var(--vert) 14%, white); color: var(--vert); }

/* Recettes */
.liste-recettes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.recette {
  display: flex; align-items: center; gap: 10px; background: var(--carte); border-radius: 12px; padding: 8px 8px 8px 12px;
  border: 1px solid color-mix(in srgb, var(--trait) 75%, transparent);
}
.recette-charger { flex: 1; display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; min-height: 56px; padding: 0; min-width: 0; }
.recette-images { display: flex; gap: 4px; flex: none; }
.recette-images .image { width: 40px; height: 40px; }
.recette-nom { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.recette-suppr { width: 44px; height: 44px; border: 0; background: none; color: var(--encre-2); display: grid; place-items: center; flex: none; }
.recette-suppr svg { width: 20px; height: 20px; }
.liste-vide { color: var(--encre-2); font-size: 15px; }

/* Packs */
.stockage { font-size: 15px; color: var(--encre-2); }
.liste-packs { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pack {
  display: flex; align-items: center; gap: 12px; background: var(--carte); border-radius: var(--rayon); padding: 12px;
  border: 1px solid color-mix(in srgb, var(--trait) 75%, transparent);
}
.pack-apercu { display: grid; grid-template-columns: repeat(2, 26px); gap: 2px; flex: none; }
.pack-apercu .image { width: 26px; height: 26px; }
.pack-apercu .image-texte { font-size: 20px; }
.pack-texte { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pack-texte span { font-size: 14px; color: var(--encre-2); }
.pack-texte .pack-taille { font-size: 13px; }
.pack .bouton-secondaire, .pack .bouton-principal { flex: none; min-height: 44px; padding: 0 14px; font-size: 15px; }
.pack-bientot { background: transparent; border-style: dashed; }
.encart-pros {
  display: block; margin: 26px 0 8px; padding: 16px 18px; border-radius: var(--rayon); text-decoration: none;
  background: var(--encre); color: #fff;
}
.encart-pros strong { display: block; font-family: var(--titre); font-weight: 400; font-size: 21px; margin-bottom: 4px; }
.encart-pros span { color: #d7deec; font-size: 15px; }

/* Réglages */
.reglage {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid color-mix(in srgb, var(--trait) 70%, transparent);
}
.reglage > div { display: flex; flex-direction: column; gap: 2px; }
.reglage span { font-size: 14.5px; color: var(--encre-2); }
.interrupteur {
  -webkit-appearance: none; appearance: none; flex: none; width: 56px; height: 32px; border-radius: 999px;
  background: var(--papier-2); border: 1.5px solid var(--encre-2); position: relative; cursor: pointer; margin: 0;
  transition: background .15s;
}
.interrupteur::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%;
  background: var(--carte); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s;
}
.interrupteur:checked { background: var(--vert); border-color: var(--vert); }
.interrupteur:checked::after { transform: translateX(24px); }
.liens-pied { list-style: none; padding: 0; margin: 20px 0; display: flex; gap: 20px; flex-wrap: wrap; }

.pied { max-width: 1180px; margin: 36px auto 0; padding: 0 16px; font-size: 14px; color: var(--encre-2); }
.pied p { margin: 4px 0; }
.pied a { color: var(--encre-2); }

/* Feuilles (dialogues en bas d'écran) */
dialog { color: var(--encre); }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgba(20, 28, 48, .45); overflow: hidden; overscroll-behavior: contain; }
.feuille {
  border: 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--carte);
  width: 100%; max-width: 520px; margin: auto auto 0; border-radius: 20px 20px 0 0;
  max-height: 88dvh;
}
.feuille[open] { animation: monte .22s ease-out; }
@keyframes monte { from { transform: translateY(40px); opacity: 0; } }
.feuille h2 { font-size: 24px; margin: 0 0 6px; }
.feuille label { display: block; font-weight: 700; margin: 12px 0 6px; }
.feuille label.case-a-cocher { font-weight: 400; display: flex; gap: 10px; align-items: center; min-height: 44px; }
.feuille label.case-a-cocher input { width: 22px; height: 22px; }
.feuille input[type="text"], .feuille input[type="search"] {
  width: 100%; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--encre); padding: 0 14px; font-size: 17px; background: #fff;
}
.feuille-tete { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.feuille-tete h2 { font-family: var(--texte); font-weight: 700; font-size: 19px; margin: 0; }
.feuille-tete p { margin: 2px 0 0; color: var(--encre-2); }
.feuille-image .image { width: 64px; height: 64px; }
.feuille-action {
  width: 100%; display: flex; align-items: center; gap: 14px; min-height: 56px; border: 0; background: none;
  border-top: 1px solid color-mix(in srgb, var(--trait) 60%, transparent); text-align: left; font-size: 17px; padding: 0 4px;
}
.feuille-action svg { width: 24px; height: 24px; flex: none; }
.feuille-action-danger { color: var(--tampon-fonce); }
.feuille-annuler { width: 100%; min-height: 52px; margin-top: 10px; border-radius: 12px; border: 1.5px solid var(--trait); background: var(--papier); font-weight: 700; }
/* Le bouton qui valide est le premier du formulaire (la touche Entrée l'active), affiché à droite. */
.feuille-boutons { display: flex; flex-direction: row-reverse; gap: 10px; justify-content: flex-start; margin-top: 18px; flex-wrap: wrap; }
.feuille-haute { height: 88dvh; display: none; }
.feuille-haute[open] { display: flex; flex-direction: column; }
.feuille-tete-simple p { margin: 0 0 10px; color: var(--encre-2); }
.liste-pays { list-style: none; margin: 10px -16px 0; padding: 0; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.liste-pays button {
  width: 100%; display: flex; align-items: center; gap: 14px; min-height: 56px; border: 0; background: none; text-align: left; padding: 6px 16px;
  border-top: 1px solid color-mix(in srgb, var(--trait) 45%, transparent);
}
.liste-pays button[aria-pressed="true"] { background: color-mix(in srgb, var(--vert) 10%, white); }
.liste-pays .drapeau { font-size: 26px; width: 34px; text-align: center; flex: none; }
.liste-pays .langue { color: var(--encre-2); font-size: 14px; display: block; }
.liste-pays .sous-titre { padding: 16px 16px 6px; font-weight: 700; font-size: 14px; color: var(--encre-2); }
.photo-apercu { display: block; max-height: 30dvh; margin: 8px auto 0; border-radius: 12px; }

/* La scène : la recette en très grand, fond blanc, contraste maximal */
.scene {
  overflow: hidden;
  border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: #fff; color: #0d1426;
}
.scene::backdrop { background: #fff; }
.scene-contenu { width: 100%; height: 100%; display: flex; flex-direction: column; }
.scene-barre { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 4px; }
.scene-langue { flex: 1; text-align: center; color: #5a6680; font-size: 14px; }
.scene-bouton {
  min-height: 48px; min-width: 48px; border-radius: 999px; border: 1.5px solid #c9cfdb; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; font-weight: 700;
}
.scene-bouton svg { width: 24px; height: 24px; }
.scene-fermer { padding: 0; }
.scene-cartes {
  list-style: none; margin: 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); flex: 1; min-height: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 14px; align-items: stretch;
}
.scene-carte {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5vmin; min-width: 0; min-height: 0;
  animation: carte .35s cubic-bezier(.2, 1.2, .4, 1) both;
}
.scene-carte:nth-child(2) { animation-delay: .06s; }
.scene-carte:nth-child(3) { animation-delay: .12s; }
.scene-carte:nth-child(4) { animation-delay: .18s; }
@keyframes carte { from { transform: translateY(14px) scale(.96); opacity: 0; } }
.scene-carte .image { width: 100%; flex: 1; min-height: 0; max-height: 62vmin; }
.scene-carte .image-texte { font-size: 40vmin; }
.scene-nom {
  font-weight: 700; font-size: clamp(22px, 7vmin, 64px); line-height: 1.1; text-align: center; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; max-width: 100%;
}
.scene-fr { font-size: clamp(13px, 2.6vmin, 20px); color: #5a6680; text-align: center; }
.scene[data-n="3"] .scene-nom, .scene[data-n="4"] .scene-nom { font-size: clamp(18px, 5vmin, 44px); }
.scene[data-n="4"] .scene-carte .image { max-height: 48vmin; }

/* Téléphone en portrait : la scène est tournée pour s'afficher en paysage */
@media (orientation: portrait) {
  .scene[data-pivot="oui"] .scene-contenu {
    position: absolute; top: 0; left: 100%;
    width: 100dvh; height: 100vw; transform-origin: 0 0; transform: rotate(90deg);
  }
  .scene[data-pivot="non"] .scene-cartes { grid-auto-flow: row; grid-auto-rows: 1fr; grid-auto-columns: auto; }
  .scene[data-pivot="non"][data-n="4"] .scene-cartes { grid-template-columns: 1fr 1fr; grid-auto-flow: row; }
  .scene[data-pivot="non"] .scene-carte .image { max-height: 30vh; }
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--barre-bas) + 16px); transform: translate(-50%, 20px);
  background: var(--encre); color: #fff; padding: 12px 16px; border-radius: 12px; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
  font-size: 15px;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: #ffd2c4; font-weight: 700; text-decoration: underline; min-height: 40px; }
.noscript { padding: 16px; }

/* Grand écran : billet à gauche, choix à droite, onglets dans l'en-tête */
@media (min-width: 900px) {
  body { padding-bottom: 24px; }
  .onglets { position: static; display: flex; gap: 4px; background: none; box-shadow: none; padding: 0; margin-left: 28px; }
  .onglets a { flex-direction: row; min-height: 44px; padding: 0 14px; color: var(--encre-2); font-size: 15px; gap: 8px; border-radius: 10px; }
  .onglets a[aria-current="page"] { color: var(--encre); background: var(--carte); }
  .onglets a[aria-current="page"]::before { top: auto; bottom: 0; left: 14px; right: 14px; border-radius: 3px 3px 0 0; }
  .onglets a svg { width: 20px; height: 20px; }
  .toast { bottom: 24px; }
  #vue-composer:not([hidden]) {
    display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 0 32px; align-items: start;
  }
  .titre-intro { grid-column: 1 / -1; font-size: 17px; margin-top: 6px; }
  .colonne-billet { top: 0; margin: 0; padding-inline: 0; }
  .case { min-height: 132px; }
  .case .image { width: 68px; height: 68px; }
  .grille { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .categories { flex-wrap: wrap; overflow: visible; margin: 0; padding: 12px 0 6px; }
  .tuile .image { width: 60px; height: 60px; }
  .vue:not(#vue-composer) { max-width: 760px; }
  .feuille { border-radius: 20px; margin: auto; }
}

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

/* Pages de texte : pros, crédits */
.page { max-width: 760px; margin: 0 auto; padding: 8px 16px 40px; }
.page-entete { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 4px; max-width: 760px; margin: 0 auto; }
.page-entete .retour { margin-left: auto; font-size: 15px; }
.page h1 { font-family: var(--titre); font-weight: 400; font-size: clamp(30px, 6vw, 44px); line-height: 1.1; margin: 18px 0 10px; letter-spacing: -.01em; }
.page h2 { font-size: 24px; margin: 30px 0 8px; }
.page p, .page li { max-width: 64ch; }
.page .chapeau { font-size: 19px; color: var(--encre-2); }
.texte-legal {
  white-space: pre-wrap; font-size: 12.5px; line-height: 1.4; background: var(--carte); border: 1px solid var(--trait);
  border-radius: 10px; padding: 12px; max-height: 320px; overflow: auto; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.page form { display: grid; gap: 6px; margin-top: 12px; }
.page form label { font-weight: 700; margin-top: 8px; }
.page form input, .page form select, .page form textarea {
  font: inherit; color: inherit; width: 100%; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--encre);
  padding: 10px 14px; background: #fff;
}
.page form textarea { min-height: 120px; resize: vertical; }
.page form .bouton-principal { margin-top: 14px; justify-self: start; }
.offres { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 16px 0; padding: 0; list-style: none; }
.offre { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; }
.offre strong { display: block; font-family: var(--titre); font-weight: 400; font-size: 21px; margin-bottom: 6px; }
.offre p { margin: 0; color: var(--encre-2); font-size: 15.5px; }
.vitrine-billet { display: flex; gap: 10px; align-items: center; margin: 18px 0; }
.vitrine-billet img { width: 64px; height: 64px; background: var(--carte); border-radius: 12px; padding: 6px; border: 1px solid var(--trait); }
body.page-texte { padding-bottom: 24px; }

.colonne-choix, .colonne-billet { min-width: 0; }
