/* Les polices sont dans le projet (dossier polices/) : plus aucune demande envoyée à Google
   (sinon Google reçoit l'adresse de chaque visiteur). Licence libre SIL OFL, voir polices/LICENCE-*.txt. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("polices/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("polices/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("polices/space-grotesk-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("polices/space-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */

/* Les couleurs de Bidouli, reprises de la maquette */
:root {
  --fond: #0B0B10;
  --surface: #17171F;
  --surface-2: #22222D;
  --bord: #2A2A36;
  --texte: #F5F5F7;
  --texte-doux: #A1A1B0;
  --violet: #6D4AFF;
  --violet-clair: #8B6CFF;
  --corail: #FF7A5C;
  /* La hauteur cachée par la barre du système en bas du téléphone (0 sur ordinateur).
     Sur Android, Chrome donne une valeur qui CHANGE selon la page et le défilement
     (safe-area-inset-bottom) : on prend sa valeur fixe, le maximum (safe-area-max-inset-bottom).
     Sur iPhone, ce maximum n'existe pas : on prend safe-area-inset-bottom, qui y est stable. */
  --zone-sure-bas: env(safe-area-max-inset-bottom, env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--texte);
  font-family: Inter, system-ui, sans-serif;
}

button { font-family: inherit; }

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* L'écran fait la taille d'un téléphone, centré sur ordinateur.
   Volontairement, les pages ne demandent PAS viewport-fit=cover : le téléphone garde la page
   entre ses barres (sur Android avec 3 boutons, Chrome passait la page sous les boutons sans
   dire quelle place ils cachaient). Les valeurs ci-dessous valent donc 0 en temps normal ;
   elles laissent de la place aux barres seulement si un téléphone en déclare quand même :
   env(safe-area-inset-top) = la hauteur cachée par l'heure / l'encoche en haut,
   --zone-sure-bas = celle cachée par la barre du système en bas. */
.ecran {
  position: relative;
  /* 100 % = la vraie hauteur de la fenêtre (html et body sont à 100 %).
     Pas de 100dvh : dans l'appli installée sur Android, Chrome lui donnait parfois
     56 pixels de trop après la page profil, et la barre du bas passait sous les boutons. */
  height: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--fond);
  display: grid;
  grid-template-rows: 56px 1fr calc(72px + var(--zone-sure-bas));
  /* Une seule colonne, jamais plus large que l'écran (même si un contenu est très large) */
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

/* ---------- Barre du haut ---------- */
.haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 0;
}
.haut .vide { width: 44px; } /* le bloc vide qui centre le titre (pas la bio vide du profil) */
.onglets { display: flex; gap: 22px; }
/* Dans le feed, 5 onglets : plus serrés pour tenir sur un téléphone de 360 pixels (et on peut les faire glisser) */
.haut:has([data-fil]) { padding-left: 16px; gap: 8px; }
.onglets:has([data-fil]) { gap: 10px; overflow-x: auto; scrollbar-width: none; }
.onglets [data-fil] { font-size: 13px; white-space: nowrap; }
.onglet {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 4px 0;
  color: var(--texte-doux);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.onglet.actif { color: var(--texte); font-weight: 600; border-bottom-color: var(--texte); }

.icone-bouton {
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--texte);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------- Le feed ---------- */
/* Le "scroll-snap" fait que chaque slide se cale en plein écran, comme TikTok */
.zone { position: relative; min-height: 0; }
.zone > * { height: 100%; }

.feed {
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.feed::-webkit-scrollbar { display: none; }

.slide {
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
}

.scene {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 8px;
  padding: 8px 8px 0 16px;
}

/* La mini-app tourne dans une "iframe" : une page dans la page, isolée du reste.
   Dans le feed, on ne peut pas la toucher (pointer-events: none) : glisser fait défiler le feed,
   et un appui sur le bouton posé dessus l'ouvre en plein écran. */
.cadre {
  flex: 1;
  min-width: 0;
  position: relative;
}
.cadre-app {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 24px;
  background: var(--surface);
  pointer-events: none;
}
.ouvrir-app {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 24px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
}
.ouvrir-app span {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

/* L'app ouverte : elle passe par-dessus tout l'écran (même largeur que l'écran sur ordinateur).
   Elle n'est pas déplacée dans la page, donc pas rechargée : elle garde sa partie en cours. */
.slide.ouverte .cadre-app {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 430px;
  margin: 0 auto;
  /* une iframe ne s'étire pas seule entre top et bottom : on lui donne sa hauteur */
  height: calc(100% - env(safe-area-inset-top, 0px));
  border-radius: 0;
  z-index: 50;
  pointer-events: auto;
}
.slide.ouverte .ouvrir-app { display: none; }
body.app-ouverte .feed { overflow: hidden; } /* pas de défilement derrière l'app */
.fermer-app {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: max(10px, calc(50% - 215px + 10px));
  z-index: 51;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fermer-app[hidden] { display: none; }

/* ---------- Boutons d'action à droite ---------- */
.actions {
  width: 56px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding-bottom: 8px;
}
.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #D4D4DC;
}
.action button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: #1E1E28;
  color: var(--texte);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s;
}
.action button:active { transform: scale(0.9); }
.action button svg { width: 22px; height: 22px; }
.action .bouton-remix { background: var(--violet); color: #fff; }
.action .bouton-like[aria-pressed="true"] { color: var(--corail); }
.action .bouton-like[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- Légende sous l'app ---------- */
.legende {
  flex-shrink: 0;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.createur { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--fond);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pseudo { font-size: 15px; font-weight: 600; }
.bouton-suivre {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #5A5A6A;
  background: transparent;
  color: var(--texte);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.bouton-modifier {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-color: var(--violet-clair);
  color: #E2DAFF;
}
.bouton-suivre[aria-pressed="true"] { background: var(--surface-2); border-color: var(--surface-2); color: var(--texte-doux); }
.infos { margin: 0; font-size: 13px; color: var(--texte-doux); }
.infos strong { color: var(--texte); font-weight: 600; }
/* La place dans le top de la semaine */
.rang-top { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: #F5C542; }
/* La description de l'app : 2 lignes au plus, en entier après un appui */
.description-app {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--texte-doux);
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}
.description-app.ouverte { -webkit-line-clamp: unset; max-height: 40vh; overflow-y: auto; }

/* ---------- Barre du bas ---------- */
.bas {
  border-top: 1px solid #1F1F29;
  display: flex;
  justify-content: space-around;
  align-items: center;
  /* Les boutons restent au-dessus de la barre du système du téléphone */
  padding-bottom: calc(6px + var(--zone-sure-bas));
}
.nav-lien {
  min-width: 64px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--texte-doux);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.nav-lien.actif { color: var(--texte); font-weight: 600; }
.nav-creer {
  width: 56px;
  height: 40px;
  border-radius: 14px;
  border: none;
  background: var(--violet);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-creer svg { stroke-width: 2.4; }
.nav-creer.actif { outline: 2px solid #C9BBFF; outline-offset: 3px; }
.nav-icone { position: relative; display: inline-flex; }
.pastille {
  position: absolute;
  top: -4px;
  right: -9px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #FF4757;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* ---------- Page Créer ---------- */
[hidden] { display: none !important; }

.titre-page { font-size: 16px; font-weight: 600; }

.creer {
  overflow-y: auto;
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
}
.etape { flex: 1; display: flex; flex-direction: column; gap: 18px; }

.grand-titre {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
}

.champ { display: flex; flex-direction: column; gap: 8px; }
.champ label, .etiquette { font-size: 13px; font-weight: 600; color: #D4D4DC; }
.creer textarea, .creer input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--bord);
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-size: 15px;
}
.creer textarea { resize: none; line-height: 1.4; }
.creer textarea:focus, .creer input:focus { outline: none; border-color: var(--violet-clair); }
/* Les menus déroulants (Pour qui ?, Ambiance...) : le même style sombre que les champs, avec une petite flèche */
.creer select {
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 14px;
  border-radius: 14px;
  border: 1.5px solid var(--bord);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A1A1B0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
  color: var(--texte);
  font: inherit;
  font-size: 15px;
  appearance: none;
  cursor: pointer;
}
.creer select:focus { outline: none; border-color: var(--violet-clair); }
.creer select option { background: var(--surface); color: var(--texte); }
/* Les cases à cocher gardent leur taille normale (la règle des champs ci-dessus les étirerait) */
.creer input[type="checkbox"] { width: 20px; height: 20px; padding: 0; flex-shrink: 0; accent-color: var(--violet-clair); }
.creer ::placeholder { color: #7C7C8C; }

.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--bord);
  background: var(--surface);
  color: #D4D4DC;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.puce[aria-pressed="true"] { border-color: var(--violet-clair); background: rgba(109, 74, 255, 0.22); color: var(--texte); font-weight: 600; }

.etapes { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.etapes li { font-size: 12px; color: var(--texte-doux); border-top: 4px solid var(--bord); border-radius: 2px; padding-top: 6px; }
.etapes li.faite { color: var(--texte); font-weight: 600; border-top-color: var(--violet-clair); }

.bandeau { margin: 0; padding: 12px 14px; border-radius: 14px; background: rgba(109, 74, 255, 0.18); color: #E2DAFF; font-size: 14px; line-height: 1.4; }

.bas-etape { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.note { margin: 0; font-size: 12px; color: var(--texte-doux); text-align: center; }

.bouton-principal, .bouton-secondaire {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.bouton-principal { flex: 1; background: var(--violet); color: #fff; }
.bouton-principal svg { width: 20px; height: 20px; }
.bouton-secondaire { background: var(--surface-2); color: var(--texte); font-size: 15px; }
.bouton-principal:disabled { background: #3A3550; color: #A9A3C2; cursor: not-allowed; }

/* Le panneau Style */
.panneau-style {
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid var(--bord);
}
.panneau-style summary {
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.panneau-style summary::-webkit-details-marker { display: none; }
.panneau-style summary::after { content: "▾"; margin-left: auto; color: var(--texte-doux); }
.panneau-style[open] summary::after { content: "▴"; }
.note-inline { font-size: 12px; font-weight: 400; color: var(--texte-doux); }
.contenu-style { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 16px; }

.grille-choix { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grille-choix.quatre { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choix {
  min-height: 64px;
  padding: 8px 4px;
  border-radius: 12px;
  border: 1.5px solid var(--bord);
  background: var(--surface-2);
  color: #D4D4DC;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.choix[aria-pressed="true"] { border-color: var(--violet-clair); background: rgba(109, 74, 255, 0.22); color: var(--texte); font-weight: 600; }
.pastilles { display: flex; }
.pastilles i { width: 16px; height: 16px; border-radius: 99px; border: 1.5px solid #0B0B10; margin-left: -4px; }
.pastilles i:first-child { margin-left: 0; }
.apercu-police { font-size: 20px; line-height: 1; color: var(--texte); }
.apercu-forme { width: 26px; height: 20px; border-radius: 6px; background: transparent; border: 2px solid #C9BBFF; box-sizing: border-box; }
.choix .apercu-forme[style*="background"] { border: none; }
.ligne-couleur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--texte-doux);
}
.ligne-couleur input[type="color"] {
  width: 56px;
  height: 36px;
  padding: 2px;
  border-radius: 10px;
  border: 1.5px solid var(--bord);
  background: var(--surface-2);
  cursor: pointer;
}
.bouton-secondaire.petit { min-height: 40px; margin-top: 10px; font-size: 14px; width: 100%; }

.bouton-lien {
  align-self: center;
  min-height: 44px;
  padding: 0 12px;
  margin-top: -10px;
  border: none;
  background: none;
  color: #C9BBFF;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.ligne { display: flex; gap: 10px; }
.ligne input { flex: 1; min-width: 0; }

.apercu {
  width: 100%;
  height: 420px;
  flex-shrink: 0;
  border: none;
  border-radius: 24px;
  background: var(--surface);
}

.attente { justify-content: center; align-items: center; text-align: center; }
.anim { display: flex; gap: 10px; }
.anim span { width: 14px; height: 14px; border-radius: 99px; background: var(--violet-clair); animation: saut 1s infinite ease-in-out; }
.anim span:nth-child(2) { animation-delay: 0.15s; }
.anim span:nth-child(3) { animation-delay: 0.3s; }
@keyframes saut { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-12px); opacity: 1; } }

.erreur { margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(255, 92, 92, 0.15); color: #FFB4A6; font-size: 14px; }

/* ---------- Page Profil ---------- */
.profil {
  overflow-y: auto;
  padding: 8px 20px 24px;
  display: flex;
  flex-direction: column;
}
#vue-profil { display: flex; flex-direction: column; gap: 16px; }
.texte-doux { margin: 0; color: var(--texte-doux); font-size: 14px; line-height: 1.5; }
.note-gauche { font-size: 12px; color: var(--texte-doux); }

.entete-profil { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.grand-avatar {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  color: var(--fond);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.grand-avatar.avec-emoji { font-size: 44px; }
.nom-profil { margin: 0; font-family: "Space Grotesk", Inter, sans-serif; font-size: 22px; font-weight: 700; }
.pseudo-profil { margin: 0; font-size: 14px; color: var(--texte-doux); }
.bio-profil { margin: 4px 0 0; max-width: 300px; font-size: 14px; line-height: 1.45; color: #D4D4DC; }
.bio-profil.vide { color: var(--texte-doux); font-style: italic; }

.stats { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; }
.stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.stats dt { font-size: 11px; color: var(--texte-doux); }
.stats dd { margin: 0; font-size: 18px; font-weight: 600; }

.boutons-profil { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.boutons-profil .bouton-principal, .boutons-profil .bouton-secondaire { min-height: 44px; font-size: 14px; }

.onglets-profil { display: flex; border-bottom: 1px solid #1F1F29; }
.onglet-profil {
  flex: 1;
  height: 44px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--texte-doux);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.onglet-profil[aria-pressed="true"] { color: var(--texte); font-weight: 600; border-bottom-color: var(--texte); }

.grille-apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tuile { border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.tuile-lien {
  min-height: 120px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--texte);
  text-decoration: none;
}
.tuile-icone {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: auto;
}
.tuile-titre { margin-top: 12px; font-size: 14px; font-weight: 600; line-height: 1.25; }
.tuile-infos { font-size: 12px; color: var(--texte-doux); }
.tuile-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #262632; }
.mini-bouton {
  min-height: 40px;
  border: none;
  background: none;
  color: #C9BBFF;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}
.mini-bouton + .mini-bouton { border-left: 1px solid #262632; }
.tuile-actions.une-action { grid-template-columns: 1fr; }
.mini-bouton.danger { color: #FF9C84; }
.vide-profil { margin: 8px 0; text-align: center; font-size: 14px; line-height: 1.5; color: var(--texte-doux); }

/* Fenêtre "Modifier le profil" */
.fenetre {
  width: min(400px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 1px solid var(--bord);
  border-radius: 20px;
  background: var(--fond);
  color: var(--texte);
}
.fenetre::backdrop { background: rgba(0, 0, 0, 0.6); }
.formulaire { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.petit-titre { font-size: 20px; }
.formulaire input, .formulaire textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--bord);
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-size: 15px;
  resize: none;
}
.formulaire input:focus, .formulaire textarea:focus { outline: none; border-color: var(--violet-clair); }
.grille-emojis, .grille-couleurs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.choix-rond {
  aspect-ratio: 1;
  min-height: 36px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--surface-2);
  color: var(--texte);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.choix-rond[aria-pressed="true"] { border-color: var(--texte); box-shadow: 0 0 0 2px var(--violet-clair); }

.nav-lien.actif { color: var(--texte); font-weight: 600; }
a.avatar { text-decoration: none; color: var(--fond); }
a.pseudo { text-decoration: none; color: inherit; }
.infos a { color: inherit; text-decoration: none; }
.fil-vide {
  height: 100%;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  color: var(--texte-doux);
  line-height: 1.5;
}
.fil-vide p { margin: 0 0 8px; }
.champ-verrouille { padding: 12px 14px; border-radius: 14px; background: var(--surface); font-size: 15px; font-weight: 600; }

/* ---------- Bouton Favori ---------- */
.action .bouton-favori[aria-pressed="true"] { color: #F5C542; }
.action .bouton-favori[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- Onglet Liste ---------- */
.liste { overflow-y: auto; overflow-x: hidden; padding: 8px 16px 16px; }
.filtres { display: flex; flex-direction: column; gap: 10px; }
.recherche {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  min-height: 46px;
  border-radius: 14px;
  border: 1.5px solid var(--bord);
  background: var(--surface);
  color: var(--texte-doux);
}
.recherche:focus-within { border-color: var(--violet-clair); }
.recherche svg { width: 18px; height: 18px; flex-shrink: 0; }
.recherche input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  color: var(--texte);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.recherche input::placeholder { color: #7C7C8C; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.puces-defilantes { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.puces-defilantes .puce { flex-shrink: 0; height: 38px; font-size: 13px; }

.ligne-filtres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.petit-select { min-width: 0; }
.petit-select select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1.5px solid var(--bord);
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-size: 14px;
}
.case-favoris { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; color: #D4D4DC; cursor: pointer; }
.case-favoris input { width: 18px; height: 18px; accent-color: var(--violet-clair); }

.compte-resultats { margin: 12px 0 8px; font-size: 12px; color: var(--texte-doux); }
.liste-apps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ligne-app { display: flex; align-items: center; gap: 4px; border-radius: 16px; background: var(--surface); }
.ligne-app-lien {
  flex: 1;
  min-width: 0;
  min-height: 64px;
  padding: 10px 0 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  color: var(--texte);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ligne-app-icone { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.ligne-app-texte { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ligne-app-titre { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-app-infos { font-size: 12px; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etoile {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin-right: 6px;
  border: none;
  background: none;
  color: var(--texte-doux);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.etoile svg { width: 22px; height: 22px; }
.etoile[aria-pressed="true"] { color: #F5C542; }
.etoile[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- Connexion, compte et règles ---------- */
.formulaire-page { display: flex; flex-direction: column; gap: 16px; }
.formulaire-page input:not([type="checkbox"]) {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--bord);
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-size: 15px;
}
.formulaire-page input:focus { outline: none; border-color: var(--violet-clair); }
.case-longue { align-items: flex-start; line-height: 1.4; }
.case-longue input { margin-top: 1px; flex-shrink: 0; }
.case-longue a { color: #C9BBFF; }
.carte {
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.carte h2 { margin: 0; font-size: 16px; }
.carte p { margin: 0; font-size: 14px; color: #D4D4DC; line-height: 1.5; }
.lien-bouton { width: 100%; text-decoration: none; }
.centre { align-self: center; min-height: 44px; display: inline-flex; align-items: center; }
.lien-discret { font-size: 13px; color: var(--texte-doux); }
.bouton-danger { background: rgba(255, 92, 92, 0.15); color: #FFB4A6; }
.texte-regles { display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.6; color: #D4D4DC; }
.texte-regles h2 { margin: 12px 0 0; font-size: 17px; color: var(--texte); }
.texte-regles ul { margin: 0; padding-left: 20px; }
.texte-regles p { margin: 0; }

/* ---------- Fenêtre des commentaires (monte du bas, comme sur TikTok) ---------- */
.feuille {
  width: min(430px, 100%);
  max-width: 100%;
  height: min(75%, 640px);
  margin: auto auto 0;
  padding: 0;
  border: none;
  border-radius: 20px 20px 0 0;
  /* Le bas de la fenêtre (le champ pour écrire) reste au-dessus de la barre du système du téléphone */
  padding-bottom: var(--zone-sure-bas);
  background: var(--fond);
  color: var(--texte);
  display: none;
  flex-direction: column;
}
.feuille[open] { display: flex; }
.feuille::backdrop { background: rgba(0, 0, 0, 0.55); }
.feuille-haut { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid #1F1F29; }
.petit-titre-feuille { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liste-commentaires { flex: 1; overflow-y: auto; margin: 0; padding: 8px 16px; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.commentaire { display: flex; gap: 10px; align-items: flex-start; }
.petit-avatar { width: 32px; height: 32px; flex-shrink: 0; font-size: 14px; }
.commentaire-corps { flex: 1; min-width: 0; }
.commentaire-entete { margin: 0 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.commentaire-entete a { color: var(--texte); text-decoration: none; }
.commentaire-texte { margin: 0; font-size: 14px; line-height: 1.45; color: #D4D4DC; white-space: pre-wrap; overflow-wrap: anywhere; }
.badge { padding: 1px 8px; border-radius: 999px; background: rgba(109, 74, 255, 0.25); color: #E2DAFF; font-size: 11px; font-weight: 600; }

/* Les boutons de test des plans (Mon compte, équipe seulement) */
.boutons-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.boutons-plans [aria-pressed="true"] { outline: 2px solid var(--violet-clair); outline-offset: 1px; }

/* ---------- Badges : clé (admin), bouclier (modérateur), plume (créateur), Pro, Premium ---------- */
.badge-role { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; vertical-align: middle; }
.badge-role svg { width: 18px; height: 18px; }
.createur .badge-role { margin-left: -6px; } /* collé au pseudo dans le feed */
.badges-profil { margin: 2px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.badge-role.avec-nom { padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--texte); }
.badge-role.avec-nom svg { width: 22px; height: 22px; }
.ecrire-commentaire { padding: 10px 16px 16px; border-top: 1px solid #1F1F29; display: flex; flex-direction: column; gap: 8px; }
.ecrire-commentaire textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--bord);
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-size: 15px;
  resize: none;
}
.ecrire-commentaire textarea:focus { outline: none; border-color: var(--violet-clair); }
.ligne-envoi { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.petit-bouton { flex: 0 0 auto; min-height: 44px; padding: 0 18px; font-size: 14px; }
.sans-compte-commentaire { padding: 16px; border-top: 1px solid #1F1F29; }
.sans-compte-commentaire a { color: #C9BBFF; font-weight: 600; }

/* ---------- Créer à plusieurs ---------- */
.liste-equipe { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.membre-equipe { min-height: 40px; display: flex; align-items: center; gap: 8px; }
.membre-equipe a { color: var(--texte); font-weight: 600; text-decoration: none; }
.membre-equipe .mini-bouton { margin-left: auto; min-height: 36px; }
.actions-invitation { display: flex; gap: 8px; padding: 0 12px 10px 56px; }
.actions-invitation .bouton-principal, .actions-invitation .bouton-secondaire { min-height: 40px; font-size: 14px; flex: 1; }

/* ---------- Signaler et modération ---------- */
.motifs { margin: 0; padding: 0; border: none; display: grid; grid-template-columns: 1fr; gap: 2px; max-height: 40vh; overflow-y: auto; }
.motif { min-height: 40px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: #D4D4DC; cursor: pointer; }
.motif input { width: 18px; height: 18px; accent-color: var(--violet-clair); }
.formulaire a, .texte-doux a { color: #C9BBFF; }
.bouton-plus {
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--texte-doux);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.lien-signaler { background: none; border: none; color: var(--texte-doux); font: inherit; font-size: 12px; cursor: pointer; padding: 4px 0; min-height: 32px; }
.dossier-moderation { display: flex; flex-direction: column; gap: 10px; }
.dossier-moderation .apercu-moderation { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; color: #D4D4DC; overflow-wrap: anywhere; white-space: pre-wrap; }
.boutons-moderation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.boutons-moderation button { min-height: 44px; font-size: 13px; padding: 0 6px; }
.etiquette-masquee { font-size: 12px; color: #FFB4A6; }

/* ---------- Mini-aperçus des apps ---------- */
.miniature {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  flex-shrink: 0;
}
.miniature iframe {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  transform-origin: 0 0;
  pointer-events: none;   /* on ne joue pas dans l'aperçu : un appui ouvre l'app */
  opacity: 0;
  transition: opacity 0.2s;
}
.miniature.chargee iframe { opacity: 1; }
.miniature-emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.miniature.chargee .miniature-emoji { display: none; }
.tuile .miniature { width: 100%; aspect-ratio: 4 / 3; margin-bottom: 8px; }
.ligne-app .miniature { width: 52px; height: 72px; }

/* ---------- Page Activité ---------- */
.liste-notifications { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.notification-lien {
  min-height: 60px;
  padding: 10px 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--texte);
  text-decoration: none;
}
.non-lue .notification-lien { background: rgba(109, 74, 255, 0.14); }
.notification-texte { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; color: #D4D4DC; overflow-wrap: anywhere; }
.notification-texte strong { color: var(--texte); }
.notification-icone { font-size: 18px; flex-shrink: 0; }

/* ---------- Message temporaire ---------- */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(88px + var(--zone-sure-bas)); /* juste au-dessus de la barre du bas */
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { margin-left: 8px; color: #C9BBFF; font-weight: 600; }

/* ---------- L'assistant « app complexe » (page Créer) ---------- */
.choix-sorte { display: flex; gap: 8px; flex-wrap: wrap; }
.entete-assistant { display: flex; align-items: center; justify-content: space-between; }
.barre-progression { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.barre-progression span { display: block; height: 100%; width: 20%; background: var(--violet-clair); transition: width 0.2s; }
.sous-etape { display: flex; flex-direction: column; gap: 14px; }
.liste-ecrans { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: ecran; }
.ligne-ecran { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 10px; border-radius: 14px; background: var(--surface); }
.ligne-ecran .ecran-role { grid-column: 1 / -1; }
.ligne-ecran .mini-bouton { grid-row: 1; grid-column: 2; }
.recapitulatif { margin: 0; padding: 12px; border-radius: 12px; background: var(--surface); color: #D4D4DC; font: 13px/1.5 Inter, system-ui, sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow-y: auto; }
.boutons-assistant { flex-direction: row; gap: 10px; }
.boutons-assistant button { flex: 1; }
.deux-colonnes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ligne-ecran .ecran-actions, .ligne-ecran .ecran-details, .ligne-ecran .fonction-details { grid-column: 1 / -1; }

/* ---------- La fabrication d'une app complexe : les 4 étapes ---------- */
.suivi { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.suivi li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--surface); }
.pastille-suivi { flex-shrink: 0; width: 22px; height: 22px; margin-top: 2px; border-radius: 999px; border: 2px solid var(--bord); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.suivi li[data-etat="encours"] .pastille-suivi { border-color: var(--violet-clair); border-top-color: transparent; animation: tourner 0.9s linear infinite; }
.suivi li[data-etat="fait"] .pastille-suivi { background: #15803D; border-color: #15803D; }
.suivi li[data-etat="fait"] .pastille-suivi::after { content: "✓"; color: #fff; }
.suivi li[data-etat="probleme"] .pastille-suivi { background: #B45309; border-color: #B45309; }
.suivi li[data-etat="probleme"] .pastille-suivi::after { content: "!"; color: #fff; }
.suivi li[data-etat="saute"] { opacity: 0.6; }
.suivi li[data-etat="saute"] .pastille-suivi::after { content: "–"; }
@keyframes tourner { to { transform: rotate(360deg); } }
#plan-technique { font: 13px/1.5 Inter, system-ui, sans-serif; }

/* Le bandeau « Brouillon retrouvé » de la page Créer */
.bandeau-brouillon { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* L'agent IA (plan Premium), dans l'assistant */
.bloc-agent { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--bord); }
.case-agent { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.case-agent input:disabled + * { opacity: .6; }
.champs-agent { display: flex; flex-direction: column; gap: 12px; }
.champs-agent[hidden] { display: none; }

/* ---------- Le tableau de bord de l'administrateur ---------- */
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chiffre { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.chiffre strong { font-family: "Space Grotesk", Inter, sans-serif; font-size: 24px; line-height: 1.1; }
.chiffre span { font-size: 12px; color: var(--texte-doux); line-height: 1.3; }
.graphique { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; padding-top: 6px; }
.colonne { display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; min-width: 0; }
.barres { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.barre { display: block; width: 40%; min-height: 2px; border-radius: 4px 4px 0 0; position: relative; }
.barre-visiteurs { background: var(--violet-clair); display: flex; align-items: flex-end; }
.barre-connectes { width: 100%; background: #3DDC97; border-radius: 4px 4px 0 0; }
.barre-ouvertures { background: #F5C542; }
.valeur-colonne { font-size: 12px; font-weight: 600; }
.jour-colonne { font-size: 11px; color: var(--texte-doux); }
.legende-graphique { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; font-size: 12px; color: var(--texte-doux); }
.legende-graphique span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.pastille-visiteurs { background: var(--violet-clair); }
.pastille-connectes { background: #3DDC97; }
.pastille-ouvertures { background: #F5C542; }
.sous-titre-carte { margin: 4px 0 0; font-size: 14px; }
.classement { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.classement li { line-height: 1.4; }
.classement a { color: var(--texte); text-decoration: none; }
.classement .badge { margin-left: 4px; }

/* « Cet avis est utile », sous chaque avis */
.pied-avis { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bouton-utile { background: none; border: 1px solid var(--bord); border-radius: 999px; color: var(--texte-doux); font: inherit; font-size: 12px; padding: 4px 10px; min-height: 32px; cursor: pointer; }
.bouton-utile[aria-pressed="true"] { color: var(--texte); border-color: var(--violet-clair); background: rgba(109, 74, 255, 0.18); }

/* ============================================================
   Les écrans plus grands : tablette et ordinateur
   - Téléphone (moins de 600 pixels) : rien ne change.
   - Tablette (600 pixels et plus) : l'écran entier est utilisé ; les pages s'élargissent ;
     dans le feed, l'app grandit ; une app ouverte prend toute la largeur.
     (600 et pas 700 : beaucoup de tablettes Samsung en portrait font 600 à 690 pixels de large.)
   - Ordinateur (1024 pixels et plus) : la barre du bas devient un menu à gauche,
     et le contenu est centré.
   Dans le feed, les mini-apps gardent un format de téléphone ; sur ordinateur, une app
   ouverte aussi (sur un écran très large, l'étirer la déformerait).
   ============================================================ */

/* L'app ouverte en plein écran : le reste de la page est assombri (utile quand l'écran est plus large que l'app) */
body.app-ouverte::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(0, 0, 0, 0.88);
}

@media (min-width: 600px) {
  .ecran {
    /* Tout l'écran de la tablette (pas de bandes noires sur les côtés) */
    max-width: none;
    /* La largeur de l'app dans le feed : un format de téléphone (9/16), selon la hauteur de l'écran */
    --largeur-app: min(560px, calc((100vh - 260px) * 0.5625));
  }
  /* Les pages restent centrées et pas trop larges, pour rester faciles à lire */
  .haut, .creer, .profil, .liste { width: 100%; max-width: 820px; margin-left: auto; margin-right: auto; }
  .creer, .profil { padding-left: 32px; padding-right: 32px; }

  /* Le feed : l'app au centre, ses boutons juste à côté, la légende alignée dessous */
  .scene { justify-content: center; padding: 12px 16px 0; }
  .cadre { flex: 0 0 var(--largeur-app); }
  .legende { width: calc(var(--largeur-app) + 64px); max-width: 100%; align-self: center; padding-left: 0; padding-right: 0; }
}

/* Tablette seulement : une app ouverte prend toute la largeur, comme sur le téléphone */
@media (min-width: 600px) and (max-width: 1023px) {
  .slide.ouverte .cadre-app { max-width: none; }
  .fermer-app { left: 10px; }
}

@media (min-width: 1024px) {
  /* Deux colonnes : le menu à gauche, la page à droite */
  .ecran {
    max-width: none;
    grid-template-columns: 230px minmax(0, 1fr);
    grid-template-rows: 64px minmax(0, 1fr);
  }
  .ecran > * { grid-column: 2; }

  /* La barre du bas devient le menu de gauche */
  .ecran > .bas {
    grid-column: 1;
    grid-row: 1 / -1;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 6px;
    padding: 20px 14px;
    border-top: none;
    border-right: 1px solid #1F1F29;
  }
  /* Le logo et le nom, en haut du menu */
  .ecran > .bas::before {
    content: "Bidouli";
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    margin-bottom: 14px;
    padding-left: 48px;
    background: url("/icones/icone-192.png") no-repeat left center / 36px;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: 22px;
    font-weight: 700;
  }
  .nav-lien {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 15px;
  }
  .nav-lien:hover { background: var(--surface); color: var(--texte); }
  .nav-lien.actif { background: var(--surface); }
  .nav-creer { width: 100%; height: 48px; gap: 10px; order: 0; margin: 6px 0; font-size: 15px; font-weight: 600; text-decoration: none; }
  .nav-creer::after { content: "Créer une app"; }

  /* Les pages : centrées, pas trop larges pour rester faciles à lire */
  .haut { width: 100%; max-width: 820px; margin: 0 auto; }
  .creer, .profil, .liste { width: 100%; max-width: 820px; margin: 0 auto; }
  .creer.large { max-width: 1080px; }

  /* Le tableau de bord : 2 colonnes de cartes */
  #tableau { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
  #tableau > p { grid-column: 1 / -1; }

  /* La fenêtre des avis : au centre, et non collée en bas */
  .feuille { margin: auto; border-radius: 20px; height: min(80%, 720px); }
  .toast { bottom: 32px; }
}

/* ---------- Installer Bidouli (bandeau du feed, et étapes pour iPhone) ---------- */
.bandeau-installer {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(84px + var(--zone-sure-bas));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--bord);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.bandeau-installer img { border-radius: 10px; flex-shrink: 0; }
.bandeau-installer p { flex: 1; margin: 0; font-size: 13px; line-height: 1.35; color: var(--texte-doux); }
.bandeau-installer strong { color: var(--texte); }
.fermer-bandeau { width: 32px; height: 32px; flex-shrink: 0; border: none; border-radius: 999px; background: none; color: var(--texte-doux); font-size: 16px; cursor: pointer; }
.bouton-petit-principal { min-height: 36px; padding: 0 14px; border: none; border-radius: 999px; background: var(--violet); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.etapes-installation { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.45; }
.icone-etape { width: 20px; height: 20px; vertical-align: -4px; color: #4DA3FF; }
@media (min-width: 1024px) { .bandeau-installer { left: auto; right: 24px; bottom: 24px; max-width: 420px; } }

/* ---------- La messagerie privée ---------- */
.note-chiffrement { margin: 0 0 12px; font-size: 12px; line-height: 1.4; color: var(--texte-doux); }
.liste-conversations { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.conversation { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; color: var(--texte); text-decoration: none; }
.conversation:hover { background: var(--surface); }
.conversation-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conversation-haut { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.conversation-apercu { font-size: 13px; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-apercu.non-lu { color: var(--texte); font-weight: 600; }
.badge-non-lus { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #FF4757; color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.messagerie { padding-bottom: 0; }
.vue-conversation { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.fil-messages { flex: 1; margin: 0; padding: 0 0 12px; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bulle { max-width: 80%; padding: 8px 12px; border-radius: 18px; }
.bulle-moi { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 6px; }
.bulle-autre { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bulle-texte { margin: 0; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.bulle-pied { display: block; margin-top: 2px; font-size: 11px; opacity: 0.7; }
.etat-envoi { align-self: flex-end; margin-top: -4px; font-size: 11px; color: var(--texte-doux); list-style: none; }
.bulle-pied .lien-signaler { min-height: 0; padding: 0; font-size: 11px; }
.barre-envoi { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; padding: 10px 0 12px; background: var(--fond); }
.barre-envoi textarea { flex: 1; min-height: 44px; max-height: 120px; }
.barre-envoi .bouton-petit-principal { min-height: 44px; }
.centre { text-align: center; }

/* ---------- Les bulles de discussion façon Messenger (chat.js) ---------- */
/* Sur téléphone : en haut à droite (pour ne pas cacher les boutons du feed). Sur PC : en bas à droite. */
.zone-bulles {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  right: 10px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bulle-chat {
  position: relative;
  width: 52px;
  height: 52px;
  border: 2px solid var(--fond);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}
.bulle-chat .pastille { top: -2px; right: -2px; }
/* La petite fenêtre : en bas de l'écran sur téléphone, en bas à droite sur PC */
.fenetre-chat {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  padding: 0 12px calc(4px + var(--zone-sure-bas));
  border-radius: 18px 18px 0 0;
  background: var(--fond);
  border: 1px solid var(--bord);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
}
.fenetre-chat[hidden] { display: none; }
.chat-haut { display: flex; align-items: center; gap: 4px; padding: 8px 0; border-bottom: 1px solid #1F1F29; }
.chat-qui { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-haut .icone-bouton { width: 36px; height: 36px; font-size: 16px; color: var(--texte-doux); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.chat-fil { flex: 1; overflow-y: auto; padding-top: 10px; }
.fenetre-chat textarea { padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--bord); background: var(--surface); color: var(--texte); font: inherit; font-size: 15px; resize: none; }
.fenetre-chat textarea:focus { outline: none; border-color: var(--violet-clair); }
@media (min-width: 1024px) {
  .zone-bulles { top: auto; bottom: 24px; right: 24px; flex-direction: column-reverse; }
  .fenetre-chat { left: auto; right: 96px; bottom: 24px; width: 360px; height: 480px; border-radius: 18px; padding-bottom: 4px; }
}

/* ---------- Aide et support ---------- */
.fil-aide { max-height: 420px; overflow-y: auto; margin: 6px 0 0; }
.barre-aide { position: static; padding-bottom: 0; }
.barre-aide textarea, .liste-demandes textarea { flex: 1; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--bord); background: var(--surface); color: var(--texte); font: inherit; font-size: 15px; resize: none; }
.proposition-equipe { align-self: flex-start; list-style: none; }
.liste-demandes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.demande details { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.demande summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.demande .fil-messages { margin-top: 10px; }
.demande .barre-envoi { position: static; background: transparent; }
.statut-ouvert { background: rgba(245, 197, 66, 0.2); color: #F5C542; }
.statut-repondu { background: rgba(61, 220, 151, 0.2); color: #3DDC97; }
.statut-resolu { background: rgba(161, 161, 176, 0.2); color: var(--texte-doux); }
