/* Le partage en image (partage.js, 20/10/2026). */

/* L'ecran de partage remplace le titre et le « Fermer » de la fenetre par
   son propre en-tete (une fleche, Partager, Ajouter a mes photos). */
.modale.pa-actif .tete { display: none; }
.modale.pa-actif .contenu { padding-top: 0; }

/* L'en-tete reste en haut quand on fait defiler les reglages : les deux
   boutons d'action sont toujours sous le pouce. */
.pa-tete {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  margin: 0 -16px 12px; padding: 12px 16px 10px;
  background: var(--fond2); border-bottom: 1px solid var(--bord);
}
.pa-retour {
  flex: 0 0 44px; width: 44px; padding: 0; display: inline-grid; place-items: center;
  background: none; border-color: transparent; color: var(--texte);
}
.pa-retour svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pa-retour:focus-visible, .pa-bouton-partager:focus-visible, .pa-bouton-photos:focus-visible { outline: 2px solid var(--actif); outline-offset: 2px; }

/* Partager : l'icone de partage puis les logos des reseaux, sans texte ; on
   comprend du premier coup d'oeil ou ca part. */
.pa-bouton-partager {
  position: relative; flex: 1 1 auto; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 10px;
}
.pa-ic { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pa-logos { display: inline-flex; gap: 3px; }
.pa-logos svg { width: 22px; height: 22px; }
.pa-logos .ms, .pa-logos .wa { background: #fff; border-radius: 50%; }
.pa-nombre:not(:empty) {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--attention); color: #1a1205;
  font-size: .75rem; font-weight: 700; display: grid; place-items: center;
}
/* Le mot reste pour les lecteurs d'ecran, pas a l'ecran. */
.pa-lisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pa-bouton-photos {
  flex: 0 1 auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  font-size: .78rem; line-height: 1.15; text-align: left;
}
.pa-bouton-photos span { max-width: 6.5em; }

/* Ce qu'on partage : une rangee qui defile au doigt. */
.pa-choix {
  display: flex; gap: 6px; overflow-x: auto; margin: 0 -2px 10px; padding: 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.pa-choix::-webkit-scrollbar { display: none; }
.pa-choix .jeton { flex: 0 0 auto; white-space: nowrap; }

/* L'apercu a gauche, les cases a droite. Agrandi, l'apercu prend toute la
   largeur et les cases passent dessous. */
.pa-grille { display: grid; grid-template-columns: minmax(0, 44%) minmax(0, 1fr); gap: 12px; align-items: start; margin: 0 0 6px; }
.pa-grille.grand { grid-template-columns: minmax(0, 1fr); }
.pa-apercu {
  position: relative; width: 100%; aspect-ratio: 9 / 16;
  border-radius: 12px; overflow: hidden; background: var(--fond);
  border: 1px solid var(--bord);
  box-shadow: 0 12px 28px -18px rgba(0, 0, 0, .9);
}
.pa-grille.grand .pa-apercu { width: min(100%, calc(62vh * 9 / 16)); margin: 0 auto; }
.pa-apercu canvas { display: block; width: 100%; height: 100%; }
.pa-attente {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center;
  font-size: .8rem; color: var(--texte2); background: var(--fond);
}
/* Le transparent se voit sur un damier, comme dans un logiciel de dessin. */
.pa-apercu.damier { background: repeating-conic-gradient(#1b2030 0 25%, #121621 0 50%) 0 0 / 18px 18px; }
.pa-agrandir {
  position: absolute; right: 6px; bottom: 6px; width: 36px; height: 36px; min-height: 36px; padding: 0;
  display: grid; place-items: center; border-radius: 10px;
  background: rgba(11, 14, 20, .72); border-color: rgba(232, 234, 237, .2); color: var(--texte);
}
.pa-agrandir svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pa-grille.grand .pa-agrandir { background: var(--actif2); color: #06210f; border-color: var(--actif2); }

/* Les cases, une par ligne dans la colonne de droite. */
.pa-droite { min-width: 0; }
.pa-droite .pa-titre { margin-top: 0; }
.pa-grille.grand .pa-droite { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pa-grille.grand .pa-droite .pa-titre { grid-column: 1 / -1; }
.pa-case {
  display: flex; align-items: center; gap: 9px;
  font-size: .84rem; line-height: 1.2; color: var(--texte); cursor: pointer; min-height: 32px;
  margin: 0; padding: 3px 0;
}
/* Le style general des champs de l'appli (44 px de haut, cadre vert au
   toucher) s'appliquait aussi a ces cases : un rectangle vert plus grand que
   la case apparaissait. On le retire ; le clavier garde un contour net. */
.pa-case input {
  width: 20px; height: 20px; min-height: 0; flex: 0 0 20px; margin: 0; padding: 0;
  border: 0; background: none; border-radius: 4px; accent-color: var(--actif2);
}
.pa-case input:focus { outline: none; }
.pa-case input:focus-visible { outline: 2px solid var(--actif); outline-offset: 2px; }

.pa-astuce { font-size: .78rem; color: var(--texte2); margin: 4px 0 8px; }
.pa-astuce[hidden] { display: none; }

/* La toute petite ligne grise sous l'apercu (« Agrandis pour modifier ») :
   discrete a l'oeil, mais une zone d'appui assez haute pour le pouce. */
.pa-indice {
  display: block; width: 100%; min-height: 0; margin: 0; padding: 7px 0 3px;
  background: none; border: 0; border-radius: 0; color: var(--texte2);
  font-size: .7rem; font-weight: 400; line-height: 1.2; text-align: center; cursor: pointer;
}
.pa-indice[hidden] { display: none; }
.pa-indice:focus { outline: none; }
.pa-indice:focus-visible { outline: 2px solid var(--actif); outline-offset: 2px; }

/* Agrandi, les remarques et smileys passent juste sous l'image, dans un
   panneau : on regle sans remonter chercher les outils. */
.pa-gauche .pa-ajouts {
  margin: 10px 0 0; padding: 10px 12px 2px;
  background: var(--fond2); border: 1px solid var(--bord); border-radius: 12px;
}
.pa-gauche .pa-ajouts .pa-titre { margin-top: 2px; }

/* L'ajout touche : son texte, sa taille, Retirer. */
.pa-choisi { display: grid; gap: 8px; margin: 0 0 10px; padding: 0 0 10px; border-bottom: 1px solid var(--bord); }
.pa-choisi[hidden], .pa-choisi input[hidden] { display: none; }
.pa-choisi input[type="text"] {
  min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 10px;
  background: var(--fond); border: 1px solid var(--actif2); color: var(--texte); font: inherit;
}
.pa-choisi-ligne { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: var(--texte2); }
.pa-choisi-ligne input[type="range"] {
  flex: 1 1 auto; min-width: 0; min-height: 0; height: 32px; margin: 0; padding: 0;
  border: 0; background: none; accent-color: var(--actif2);
}
.pa-choisi-ligne input[type="range"]:focus { outline: none; }
.pa-choisi-ligne input[type="range"]:focus-visible { outline: 2px solid var(--actif); outline-offset: 2px; }
.pa-retirer { flex: 0 0 auto; min-height: 40px; padding: 0 12px; color: var(--alerte); }
.pa-aide { font-size: .78rem; color: var(--texte2); margin: 0 0 12px; line-height: 1.4; }
.pa-titre {
  font-size: .76rem; margin: 14px 0 8px; color: var(--texte2); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}

/* La serie : le bouton + et les miniatures deja gardees. */
.pa-serie { display: flex; align-items: center; gap: 8px; overflow-x: auto; margin: 8px 0 6px; padding: 8px 2px 2px; scrollbar-width: none; }
.pa-serie::-webkit-scrollbar { display: none; }
.pa-ajout-serie {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  border-style: dashed; border-color: var(--actif2); color: var(--actif); background: none; font-weight: 600;
}
.pa-ajout-serie .plus { font-size: 1.3rem; line-height: 1; }
/* L'image affichee est deja dans la serie. */
.pa-ajout-serie:disabled { opacity: .4; cursor: default; }
.pa-vignettes { display: flex; gap: 10px; }
.pa-vignette { position: relative; flex: 0 0 auto; }
.pa-vignette img { display: block; width: 40px; height: 71px; object-fit: cover; border-radius: 6px; border: 1px solid var(--bord); }
/* Toucher une miniature y revient ; celle qu'on retouche a un contour vert. */
.pa-vignette-voir { display: block; min-height: 0; margin: 0; padding: 0; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.pa-vignette-voir:focus { outline: none; }
.pa-vignette-voir:focus-visible { outline: 2px solid var(--actif); outline-offset: 3px; }
.pa-vignette.on img { border-color: var(--actif2); box-shadow: 0 0 0 2px var(--actif2); }
.pa-vignette-x {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; min-height: 24px; padding: 0;
  border-radius: 50%; background: var(--alerte); border-color: var(--alerte); color: #2a0707;
  font-size: .9rem; line-height: 1; font-weight: 700;
}

/* Sous l'apercu, dans la colonne de gauche : le bouton prend toute la largeur
   et les miniatures passent a la ligne. */
.pa-gauche .pa-serie { flex-wrap: wrap; overflow: visible; margin: 10px 0 4px; }
.pa-gauche .pa-ajout-serie { width: 100%; justify-content: center; font-size: .82rem; padding: 8px; }
.pa-gauche .pa-aide { margin: 4px 0 0; }
.pa-grille.grand .pa-gauche .pa-ajout-serie { width: auto; }

/* Ecrire une remarque : le champ, Ajouter, et le petit bouton smiley. */
.pa-ecrire { display: flex; gap: 8px; margin: 0 0 10px; }
.pa-ecrire input, .pa-tags, .pa-nom-repas input {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 10px;
  background: var(--fond); border: 1px solid var(--bord); color: var(--texte); font: inherit;
}
.pa-ecrire input:focus-visible, .pa-tags:focus-visible, .pa-nom-repas input:focus-visible { outline: 2px solid var(--actif); outline-offset: 1px; }
.pa-ouvrir-smileys {
  flex: 0 0 44px; width: 44px; padding: 0; display: inline-grid; place-items: center;
  color: var(--texte); background: var(--fond3);
}
.pa-ouvrir-smileys.on { border-color: var(--actif2); color: var(--actif); }
.pa-ouvrir-smileys svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pa-smileys { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; margin: 0 0 10px; }
.pa-smileys[hidden] { display: none; }
.pa-smiley { min-height: 44px; padding: 0; font-size: 1.45rem; line-height: 1; background: var(--fond3); border-color: transparent; border-radius: 10px; }

/* Les fonds : une vignette du paysage et son nom, en rangee qui defile. */
.pa-fonds { display: flex; gap: 8px; overflow-x: auto; padding: 2px; margin: 0 -2px; scrollbar-width: none; }
.pa-fonds::-webkit-scrollbar { display: none; }
.pa-fond {
  flex: 0 0 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px;
  min-height: 0; border-radius: 12px; font-size: .72rem; line-height: 1.2; text-align: center;
}
.pa-fond.on { border-color: var(--actif2); box-shadow: inset 0 0 0 1px var(--actif2); color: var(--actif); }
.pa-fond-vue {
  width: 48px; height: 85px; border-radius: 8px; border: 1px solid rgba(232, 234, 237, .2);
  background: #0b0e14 center / cover no-repeat;
}
.pa-fond-vue.uni { background: linear-gradient(180deg, #111827, #0b0e14); }
.pa-fond-vue.photo { background: linear-gradient(160deg, #38bdf8, #4ade80 55%, #fbbf24); }
.pa-fond-vue.appareil { background: radial-gradient(circle at 50% 50%, #e8eaed 0 16%, #3a4256 18% 100%); }
.pa-fond-vue.vide { background: repeating-conic-gradient(#3a4256 0 25%, #1b2030 0 50%) 0 0 / 10px 10px; }

/* Les photos gardees, en fond : « Photos de la séance », « Tes plats en photo ». */
.pa-photos { display: flex; gap: 8px; overflow-x: auto; padding: 2px; margin: 0 -2px; scrollbar-width: none; }
.pa-photos::-webkit-scrollbar { display: none; }
.pa-photo {
  flex: 0 0 64px; width: 64px; height: 86px; min-height: 0; padding: 0; overflow: hidden;
  border-radius: 10px; border: 1px solid var(--bord); background: var(--fond3);
}
.pa-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pa-photo.on { border-color: var(--actif2); box-shadow: 0 0 0 2px var(--actif2); }

/* Nommer ses repas : le nom du repas au-dessus de son champ. */
.pa-nom-repas { display: grid; gap: 4px; margin: 0 0 10px; font-size: .8rem; color: var(--texte2); }

.pa-tags { width: 100%; margin: 0 0 8px; }
.pa-poids { margin-top: 4px; }
.pa-autre { width: 100%; margin-top: 6px; }

/* « Quitter le partage ? » : par-dessus tout l'ecran, en-tete compris. */
.pa-question {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 7, 11, .72);
}
.pa-question-carte {
  width: min(100%, 340px); padding: 20px 18px 16px; border-radius: 16px;
  background: var(--fond2); border: 1px solid var(--bord);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .9);
}
.pa-question-titre { margin: 0 0 6px; font-size: 1.05rem; font-weight: 600; color: var(--texte); }
.pa-question-boutons { display: flex; gap: 10px; margin-top: 4px; }
.pa-question-boutons button { flex: 1 1 0; }

/* Le bouton de partage, dans le bandeau du haut a cote des amis. */
.bandeauPartage {
  flex: 0 0 auto; display: inline-grid; place-items: center;
  width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 12px;
  background: var(--fond3); border: 1px solid var(--bord); color: var(--texte);
}
.bandeauPartage svg {
  width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.bandeauPartage:focus-visible { outline: 2px solid var(--actif); outline-offset: 2px; }
