/* ==========================================================================
   SlOS · Mise en page des écrans
   Mesures reprises des maquettes 360 × 760 (page « Prototype » du Figma).
   ========================================================================== */

/* Accueil (1.1) ------------------------------------------------------------ */
.ecran.accueil { background: var(--color-home-bg); color: var(--color-home-content); }
.accueil__verbes {
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: 72px var(--space-24) var(--space-16) var(--space-32);
}
.accueil__verbe {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-16);
  font-size: var(--font-size-display); font-weight: 500; line-height: 1.15;
  color: var(--color-home-content);
}
/* Zone tactile d'au moins 44 px de haut */
.accueil__verbe::before { content: ""; position: absolute; left: -8px; right: -8px; top: -4px; bottom: -4px; }
/* Consulter (dernier verbe) est un peu détaché des verbes qui créent */
.accueil__verbes li:last-child { margin-top: var(--space-24); }
/* Picto à gauche du verbe : 24 px, même couleur que le texte */
.accueil__picto { flex: none; color: var(--color-home-content); }
.accueil__compteur { font-size: var(--font-size-heading); line-height: 1.25; }
.accueil__utilitaires {
  position: absolute; left: var(--space-24);
  bottom: calc(30px + env(safe-area-inset-bottom));
  display: flex; gap: var(--space-6);
}

/* Consulter (1.2, 5.1, 11.2, 11.3) ---------------------------------------- */
.energie { display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-2) var(--space-24) var(--space-4); flex-shrink: 0; }
.energie__barre { height: 10px; border-radius: 5px; background: var(--color-accent-soft); overflow: hidden; }
.energie__niveau { display: block; height: 100%; border-radius: 5px; background: var(--color-accent); }

.filtres { flex-shrink: 0; padding: var(--space-4) 0 var(--space-12) var(--space-20); }
.rangee-chips::after { content: ""; flex: 0 0 12px; }

.consulter__defile {
  --flux-entete: 52px; /* hauteur de l'en-tête collé du mois */
  padding: 0 var(--space-20) 96px var(--space-16);
}
.flux, .flux__jours { display: flex; flex-direction: column; gap: var(--space-10); }
/* En-tête du mois : collé en haut de la zone qui défile tant qu'on est dans
   ce mois. Il appartient au bloc du mois : à la fin du mois, l'en-tête du
   mois suivant arrive et le pousse vers le haut. */
.flux__entete {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: var(--space-10);
  height: var(--flux-entete); padding: var(--space-4) 0 var(--space-6);
  background: var(--color-bg-default);
}
.flux__mois-repere { display: flex; flex-direction: column; align-items: center; width: 32px; flex-shrink: 0; }
/* « ↑ Jours précédents », à droite du mois : s'efface quand on remonte */
.flux__precedents {
  display: flex; align-items: center; gap: var(--space-6);
  transition: opacity var(--duree-courte) ease, visibility var(--duree-courte);
}
.flux__precedents .icone { transform: rotate(90deg); }
.consulter__defile--passe .flux__precedents { opacity: 0; visibility: hidden; }
.flux__jour { display: flex; align-items: flex-start; gap: var(--space-10); }
.flux__jour--centre { align-items: center; }
/* Pastille du jour : collée sous l'en-tête du mois jusqu'à la fin de son jour */
.flux__jour-repere {
  position: sticky; top: var(--flux-entete); z-index: 1;
  flex-shrink: 0; background: var(--color-bg-default);
}
.flux__elements { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-8); }
.flux__elements--posts { gap: var(--space-18); }

/* Posts News */
.post { display: flex; flex-direction: column; gap: var(--space-8); }
.post__entete { display: flex; align-items: center; gap: var(--space-6); min-height: 18px; }
.post__reseau {
  display: grid; place-items: center; flex-shrink: 0;
  width: 18px; height: 18px; border-radius: var(--radius-xs);
  background: var(--color-bg-inverse); color: var(--color-text-inverse);
  font-size: var(--font-size-caption); font-weight: 500; line-height: 1;
}
.post__compte { flex: 1 1 auto; min-width: 0; }
.post__texte { overflow-wrap: anywhere; }
/* Durée d'une vidéo, posée en bas à droite du visuel */
.post__duree {
  position: absolute; right: var(--space-8); bottom: var(--space-8);
  padding: var(--space-2) var(--space-6); border-radius: var(--radius-xs);
  background: var(--color-bg-inverse); color: var(--color-text-inverse);
}
.post__visuel {
  position: relative; display: grid; place-items: center; overflow: hidden;
  aspect-ratio: 9 / 5; border-radius: var(--radius-md); background: var(--color-bg-muted);
}
.post__visuel img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Pastille lecture au centre des vidéos */
.post__lecture {
  position: absolute; inset: 0; margin: auto; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--radius-full);
  background: var(--color-bg-default); color: var(--color-icon-primary);
}
.post__favori {
  position: relative;
  display: grid; place-items: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 15px;
  margin-block: -6px;
  background: var(--color-bg-default); color: var(--color-icon-primary);
}
.post__visuel .post__favori { position: absolute; top: var(--space-8); right: 2px; margin: 0; }
.post__favori::before { content: ""; position: absolute; inset: -7px; }
.post__favori[aria-pressed="true"] { background: var(--color-accent); color: var(--color-on-accent); }
.post__favori .icone { color: currentColor; }
/* Favori : l'icône se remplit (l'état ne repose pas sur la couleur seule) */
.icone--pleine path { fill: currentColor; }

/* Fichiers (11.4) */
.fichiers { display: flex; flex-direction: column; gap: var(--space-10); padding: var(--space-4) var(--space-20) 96px; }
.fichiers__section { display: flex; flex-direction: column; gap: var(--space-10); }
.rangee-defile { display: flex; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--space-20)); }
.rangee-defile::-webkit-scrollbar { display: none; }
.rangee-defile::after { content: ""; flex: 0 0 var(--space-20); }
.fichiers__photos, .fichiers__musique { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-8); }
.fichiers__photo { display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--radius-md); background: var(--color-bg-muted); }
.fichiers__album { display: flex; flex-direction: column; align-items: center; gap: var(--space-6); text-align: center; }
.fichiers__disque { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--color-bg-muted); }
.fichiers__livres { display: flex; justify-content: space-between; gap: var(--space-8); }
.fichiers__livre { width: 52px; height: 72px; border-radius: var(--radius-xs); background: var(--color-accent-soft); }

/* Internet (pas de maquette) : même pastille que le champ « Où vas-tu ? » d'Aller */
.internet { padding: var(--space-8) var(--space-20) 96px; }
.internet__recherche {
  display: flex; align-items: center; gap: var(--space-10);
  min-height: 48px; padding: var(--space-12) var(--space-14);
  border-radius: var(--radius-lg); background: var(--color-accent-soft);
  cursor: text;
}
.internet__recherche:focus-within { outline: 2px solid var(--color-border-strong); outline-offset: 2px; }
.internet__saisie {
  flex: 1 1 auto; min-width: 0;
  font-size: var(--font-size-body); line-height: 1.35; /* 16 px au moins : pas de zoom au focus sur iPhone */
  color: var(--color-text-primary);
}
.internet__saisie:focus-visible { outline: none; }
.internet__saisie::placeholder { color: var(--color-text-secondary); opacity: 1; }

/* Fil de conversation (1.3) ------------------------------------------------ */
.fil { padding: var(--space-16) var(--space-24) var(--space-16); }
.fil__messages { display: flex; flex-direction: column; gap: var(--space-14); }
.message { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.message--envoye { align-items: flex-end; }

/* Saisie : Répondre (1.4) et Écrire (6.2) ----------------------------------- */
.saisie { display: flex; flex-direction: column; gap: var(--space-20); padding: var(--space-16) var(--space-24); }
.saisie__destination { padding-bottom: var(--space-10); border-bottom: var(--stroke-hairline) solid var(--color-border-subtle); }
.saisie__origine {
  margin: 0; display: flex; flex-direction: column; gap: 3px;
  padding: var(--space-10) var(--space-12);
  border-radius: var(--radius-md); background: var(--color-bg-muted);
}
.saisie__origine blockquote { margin: 0; }
.titre-saisie {
  width: 100%; padding: 0 0 var(--space-10);
  border-bottom: var(--stroke-hairline) solid var(--color-border-subtle);
  font-size: var(--font-size-body); line-height: 1.35;
}
.contenu-saisie {
  width: 100%; min-height: 66px; resize: none; overflow: hidden;
  font-size: var(--font-size-body); line-height: 1.35;
}
@media (max-width: 599.98px) {
  .ecran--saisie .defile { padding-bottom: 80px; }
}

/* Confirmation (1.5) ------------------------------------------------------- */
.ecran.confirmation { align-items: center; justify-content: center; gap: var(--space-12); text-align: center; padding: var(--space-24); }
.confirmation__pastille {
  display: grid; place-items: center;
  width: 88px; height: 88px; border-radius: 44px;
  background: var(--color-bg-inverse); color: var(--color-icon-inverse);
}

/* Choisir la destination (6.3) --------------------------------------------- */
.destination { display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-20) var(--space-24) var(--space-16); }
.destination__rangee { display: flex; gap: var(--space-8); align-items: flex-start; }
.destination__rangee--contacts { gap: var(--space-4); } /* place pour le contour de sélection */
.destination .contact { width: 60px; }
.destination__contacts-titre { margin-top: var(--space-12); }
/* Destination choisie : contour épais autour de la tuile ou de l'avatar
   (l'état ne repose pas sur la couleur seule ; annoncé par aria-pressed) */
.destination [aria-pressed="true"] .dossier__tuile,
.destination [aria-pressed="true"] .avatar {
  /* un liseré blanc de 2 px sépare le contour des photos sombres */
  outline: var(--stroke-device) solid var(--color-border-strong);
  outline-offset: var(--space-2);
}
/* Titre du document : seulement quand le texte part dans un dossier */
.destination__titre { display: flex; flex-direction: column; gap: var(--space-10); margin-top: var(--space-12); }
.destination__titre[hidden] { display: none; }

/* Capturer (7.2) ------------------------------------------------------------ */
.capturer { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-4) var(--space-24) var(--space-16); }
.capturer__viseur {
  flex: 1 1 420px; min-height: 160px; max-height: 420px;
  display: grid; place-items: center;
  border-radius: var(--radius-screen);
  border-radius: 20px;
  background: var(--color-bg-inverse); color: var(--color-icon-inverse);
}
.capturer__modes { display: flex; justify-content: center; gap: var(--space-8); }
.capturer__bas {
  position: relative; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  height: 76px; margin: 60px 0 21px;
  margin-bottom: calc(21px + env(safe-area-inset-bottom));
}
.capturer__declencheur {
  display: grid; place-items: center;
  width: 76px; height: 76px; border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--color-border-strong);
}
.capturer__declencheur span { width: 58px; height: 58px; border-radius: 50%; background: var(--color-icon-primary); }
.capturer__derniere {
  position: absolute; left: 37px;
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--color-bg-muted);
}

/* Planifier (8.2, 3.2) ------------------------------------------------------ */
.planifier { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-16) var(--space-24); }
.planifier .titre-saisie { margin-bottom: 0; }
.planifier__contenu { margin-top: var(--space-16); }
.champ__saisie[type="date"] { min-height: 22px; }

/* Appeler (9.2) -------------------------------------------------------------- */
.appeler { display: flex; flex-direction: column; gap: var(--space-14); padding: var(--space-12) var(--space-24) var(--space-16); }
.appeler__favoris { display: flex; justify-content: space-between; }
.appeler__recents-titre { padding-top: var(--space-12); }
.appeler__recent .icone:last-of-type { margin-left: auto; }

/* En appel (2.2, 9.3) et Appel entrant (4.1) -------------------------------- */
.ecran.appel { align-items: stretch; }
.appel__haut { display: flex; flex-direction: column; align-items: center; gap: var(--space-12); padding: 120px var(--space-24) var(--space-16); text-align: center; }
.appel__controles { margin-top: auto; display: flex; justify-content: center; gap: var(--space-28); }
.appel__controle { display: flex; flex-direction: column; align-items: center; gap: var(--space-6); }
.appel__rond {
  display: grid; place-items: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--color-accent-soft); color: var(--color-text-primary);
}
.appel__rond--72 { width: 72px; height: 72px; }
.appel__rond--plein { background: var(--color-bg-inverse); color: var(--color-icon-inverse); }
.appel__rond--plein .icone { color: currentColor; }
.appel__raccrocher {
  display: grid; place-items: center; flex-shrink: 0;
  width: 72px; height: 72px; border-radius: 50%;
  margin: 58px auto calc(45px + env(safe-area-inset-bottom));
  background: var(--color-bg-inverse); color: var(--color-icon-inverse);
}
.appel__reponse {
  margin-top: auto; margin-bottom: calc(57px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; gap: 44px;
}
.appel__choix { display: flex; flex-direction: column; align-items: center; gap: var(--space-10); width: 100px; text-align: center; }

/* Naviguer (10.2) et Itinéraire (10.3) --------------------------------------- */
.naviguer { display: flex; flex-direction: column; gap: var(--space-14); padding: var(--space-8) var(--space-24) var(--space-16); }
.naviguer__recherche {
  display: flex; align-items: center; gap: var(--space-10);
  padding: var(--space-12) var(--space-14);
  border-radius: var(--radius-lg); background: var(--color-accent-soft);
}
.naviguer__titre { padding-top: var(--space-6); }
.naviguer__carte { aspect-ratio: 312 / 200; }
.carte { width: 100%; height: 100%; }
.itineraire { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-8) var(--space-24) var(--space-16); }
.itineraire__instruction {
  display: flex; align-items: center; gap: var(--space-16);
  padding: var(--space-20); border-radius: 20px;
  background: var(--color-bg-inverse); color: var(--color-text-inverse);
}
.itineraire__instruction .icone { color: var(--color-icon-inverse); }
.itineraire__textes { display: flex; flex-direction: column; gap: var(--space-4); }
.itineraire__carte { flex: 1 1 360px; min-height: 120px; max-height: 360px; }

/* Lampe (12.2) ------------------------------------------------------------------ */
.lampe { display: flex; flex-direction: column; align-items: center; gap: var(--space-16); padding: 120px var(--space-24) var(--space-16); text-align: center; }
.lampe__rond { display: grid; place-items: center; width: 160px; height: 160px; border-radius: 50%; background: var(--color-bg-muted); }
.lampe__intensite {
  -webkit-appearance: none; appearance: none;
  width: 240px; height: 28px; margin: -10px 0; background: none; cursor: pointer;
}
.lampe__intensite::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px;
  background: linear-gradient(to right, var(--color-icon-primary) 0 var(--niveau), var(--color-bg-muted) var(--niveau) 100%);
}
.lampe__intensite::-moz-range-track {
  height: 8px; border-radius: 4px;
  background: linear-gradient(to right, var(--color-icon-primary) 0 var(--niveau), var(--color-bg-muted) var(--niveau) 100%);
}
.lampe__intensite::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 8px; border: 0; background: transparent; }
.lampe__intensite::-moz-range-thumb { width: 8px; height: 8px; border: 0; background: transparent; }

/* Focus (12.3) ------------------------------------------------------------------ */
.focus { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-16); padding: var(--space-24) var(--space-24) var(--space-16); }
.focus__durees { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.focus__titre { padding-top: var(--space-12); }
.focus__contacts { display: flex; align-items: flex-start; gap: var(--space-12); }

/* Gérer (12.4) ------------------------------------------------------------------- */
.gerer { display: flex; flex-direction: column; gap: var(--space-10); padding: var(--space-4) var(--space-24) var(--space-16); }
.gerer__contextes { display: flex; gap: var(--space-6); overflow-x: auto; padding: var(--space-8) 0; margin: calc(-1 * var(--space-8)) 0; scrollbar-width: none; }
.gerer__liste { padding-top: var(--space-6); }
.gerer__pastille { width: 20px; height: 20px; border-radius: 50%; background: var(--color-accent); flex-shrink: 0; box-shadow: inset 0 0 0 var(--stroke-hairline) var(--color-border-strong); }
.gerer__aa { display: grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0; }

/* Couleur (12.5) et Police (12.6) ------------------------------------------------- */
.choix { display: flex; flex-direction: column; gap: var(--space-14); padding: var(--space-6) var(--space-24) var(--space-24); }
.apercu {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-16) var(--space-20);
  border-radius: var(--radius-xl);
  background: var(--color-accent); color: var(--color-on-accent);
}
