/* ==========================================================================
   SlOS · Composants (page « Design system » du Figma, section Composants)
   ========================================================================== */

.icone { color: var(--color-icon-primary); }

/* Barre d'état (58:1634) ------------------------------------------------- */
.barre-etat {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-14) var(--space-24) var(--space-6);
  flex-shrink: 0;
  color: var(--color-text-primary);
}
.barre-etat__heure { padding: 0; }
.barre-etat__indicateurs { display: flex; align-items: center; gap: var(--space-4); }
.accueil .barre-etat { color: var(--color-home-content); }
.accueil .barre-etat .icone { color: var(--color-home-content); }
/* Appui long sur l'heure de l'accueil = appel d'urgence simulé (flow 4) */
.barre-etat__heure[data-appui-long] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* En-tête (58:1664) ------------------------------------------------------- */
.en-tete {
  display: flex; align-items: center; gap: var(--space-12);
  padding: var(--space-12) var(--space-20);
  flex-shrink: 0;
}
.en-tete__titre { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.bouton-icone {
  position: relative; display: grid; place-items: center;
  width: 24px; height: 24px; flex-shrink: 0;
  color: var(--color-icon-primary);
}
/* Zone tactile de 44 × 44 autour d'une icône de 24 */
.bouton-icone::before { content: ""; position: absolute; inset: -10px; }
.en-tete__recherche { width: 22px; height: 22px; }

/* Chip (58:1674) : Inactif / Actif / Veille ------------------------------- */
.chip {
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center;
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  background: var(--color-accent-soft);
  color: var(--color-text-primary);
  font-size: var(--font-size-caption); font-weight: 500; line-height: 1.3;
  white-space: nowrap;
}
/* Zone tactile de 44 px de haut, sans changer la mise en page */
.chip::before { content: ""; position: absolute; left: -4px; right: -4px; top: -8px; bottom: -8px; }
.chip--actif, .chip[aria-pressed="true"] { background: var(--color-accent); color: var(--color-on-accent); }
.chip--veille {
  background: var(--color-bg-default);
  color: var(--color-text-secondary);
  box-shadow: inset 0 0 0 var(--stroke-default) var(--color-border-subtle);
  padding: 7px 13px; /* Figma : 1,25 px de contour en plus */
}
.rangee-chips {
  display: flex; gap: var(--space-8); align-items: flex-start;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  /* place pour la zone tactile étendue des chips */
  padding-block: 8px; margin-block: -8px;
}
.rangee-chips::-webkit-scrollbar { display: none; }

/* Bascule Flux / Fichiers (58:1679) ------------------------------------ */
.bascule {
  position: absolute; left: 50%; bottom: 25px; transform: translateX(-50%);
  display: flex; gap: var(--space-4); padding: var(--space-4);
  background: var(--color-bg-default);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-float);
  z-index: 2;
  margin-bottom: env(safe-area-inset-bottom);
}
.bascule__segment {
  position: relative;
  display: flex; align-items: center; gap: var(--space-6);
  padding: var(--space-8) var(--space-14);
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  font-size: var(--font-size-small); font-weight: 500; line-height: 1.35;
}
.bascule__segment::before { content: ""; position: absolute; left: 0; right: 0; top: -5px; bottom: -5px; }
.bascule__segment .icone { color: currentColor; }
.bascule__segment[aria-current="page"] { background: var(--color-accent); color: var(--color-on-accent); }

/* Champ (58:1726) --------------------------------------------------------- */
.champ {
  display: flex; align-items: center; gap: var(--space-10);
  padding: 13px 0;
  border-bottom: var(--stroke-hairline) solid var(--color-border-subtle);
}
.champ .icone { width: 18px; height: 18px; }
.champ__saisie, .champ__texte {
  flex: 1 1 auto; min-width: 0;
  font-size: var(--font-size-body); line-height: 1.35;
  color: var(--color-text-primary);
}
.champ__saisie::placeholder, .titre-saisie::placeholder, .contenu-saisie::placeholder { color: var(--color-text-secondary); opacity: 1; }
.champ__texte { color: var(--color-text-secondary); }

/* Dossier (58:1737) ------------------------------------------------------- */
.dossier {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-6);
  width: 72px; flex-shrink: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-caption); font-weight: 500; line-height: 1.3;
  text-align: center;
}
.dossier__tuile {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: var(--radius-xl);
  background: var(--color-accent-soft);
}
.accueil .dossier { color: var(--color-home-content); }
/* Seconde ligne sous le nom (durée de Focus quand il est actif) */
.dossier__detail { display: block; }
.accueil .dossier__tuile { background: var(--color-home-tile); }
.accueil .dossier .icone { color: var(--color-home-content); }

/* Contact (58:1747) ------------------------------------------------------- */
.contact {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-6);
  width: 64px; flex-shrink: 0;
  font-size: var(--font-size-caption); font-weight: 500; line-height: 1.3;
  text-align: center;
  color: var(--color-text-primary);
}
.avatar {
  display: grid; place-items: center; flex-shrink: 0;
  width: 52px; height: 52px; border-radius: 50%;
  overflow: hidden;
  background: var(--color-accent-soft);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--40 { width: 40px; height: 40px; }
.avatar--120 { width: 120px; height: 120px; }
.ajouter-rond {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  border: var(--stroke-default) dashed var(--color-border-subtle); /* pointillé, comme le Figma */
}

/* Jour (59:1531) ---------------------------------------------------------- */
.jour {
  display: flex; flex-direction: column; align-items: center;
  width: 32px; height: 40px; flex-shrink: 0;
}
.jour__numero { font-size: var(--font-size-body); font-weight: 500; line-height: 1.35; }
.jour__nom { font-size: var(--font-size-caption); line-height: 1.3; color: var(--color-text-secondary); }
.jour--aujourdhui .jour__pastille {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: var(--radius-full);
  background: var(--color-accent); color: var(--color-on-accent);
}
.jour--aujourdhui .jour__nom { color: var(--color-text-primary); font-weight: 500; }

/* Carte timeline (58:1760) ------------------------------------------------ */
.carte-timeline {
  display: flex; align-items: center; gap: var(--space-10);
  padding: var(--space-12);
  border-radius: var(--radius-xl);
  background: var(--color-accent-soft);
  font-size: var(--font-size-small); line-height: 1.35;
}
.carte-timeline .icone { width: 16px; height: 16px; }

/* Carte en attente (58:1773) ---------------------------------------------- */
.carte-attente {
  position: relative;
  display: flex; align-items: flex-start; gap: var(--space-10);
  padding: var(--space-12);
  border: var(--stroke-hairline) solid var(--color-border-strong);
  border-radius: var(--radius-2xl);
  background: var(--color-bg-default);
}
.carte-attente__avatar {
  display: grid; place-items: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 18px;
  background: var(--color-bg-inverse);
}
.carte-attente__avatar .icone { color: var(--color-icon-inverse); width: 16px; height: 16px; }
.carte-attente__contenu { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-8); }
.carte-attente__textes { display: flex; flex-direction: column; gap: var(--space-2); }
.carte-attente__apercu {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Ouvrir le fil en touchant la carte (le bouton reste l'action principale) */
.carte-attente__lien::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.carte-attente__action {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  width: 100%;
  padding: 7px var(--space-8);
  border-radius: var(--radius-2xl);
  background: var(--color-accent); color: var(--color-on-accent);
  font-size: var(--font-size-caption); font-weight: 500; line-height: 1.3;
}
.carte-attente__action::before { content: ""; position: absolute; left: 0; right: 0; top: -7px; bottom: -7px; }

/* Bouton principal (58:1771) ---------------------------------------------- */
.bouton-principal {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 52px;
  border-radius: var(--radius-lg);
  background: var(--color-accent); color: var(--color-on-accent);
  font-size: var(--font-size-body); font-weight: 500; line-height: 1.35;
}
.zone-bouton {
  flex-shrink: 0;
  padding: 0 var(--space-24) var(--space-28);
  padding-bottom: max(var(--space-28), env(safe-area-inset-bottom));
}

/* Bulles (58:1790 / 58:1792) ---------------------------------------------- */
.bulle {
  max-width: 234px;
  padding: 9px var(--space-12);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-small); line-height: 1.35;
  overflow-wrap: anywhere;
}
.bulle--recue { background: var(--color-bg-muted); }
.bulle--envoyee { background: var(--color-accent-soft); }

/* Lignes de liste (Gérer, Appeler, Naviguer) ----------------------------- */
.ligne {
  position: relative;
  display: flex; align-items: center; gap: var(--space-12);
  width: 100%;
  padding: var(--space-12) 0;
  border-bottom: var(--stroke-hairline) solid var(--color-border-subtle);
  text-align: left;
}
.ligne__textes { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ligne__chevron { color: var(--color-text-secondary); font-size: var(--font-size-heading); font-weight: 500; line-height: 1.25; }

/* Ligne réglage (59:1559) : Actif / Inactif ------------------------------- */
.ligne-reglage { padding: var(--space-12) 0; }
.ligne-reglage .icone { width: 20px; height: 20px; }
.ligne-reglage .ligne__textes { gap: 1px; }
.ligne-reglage .ligne__chevron { font-size: var(--font-size-body); font-weight: 400; line-height: 1.35; }
.ligne-reglage--inactif .ligne__titre { color: var(--color-text-secondary); }
.ligne-reglage--inactif .icone { color: var(--color-icon-secondary); }

/* Options couleur et police (59:1560 / 59:1567) ---------------------------- */
.option {
  display: flex; align-items: center; gap: var(--space-12);
  width: 100%; min-height: 51px;
  padding: var(--space-10) 0;
  border-bottom: var(--stroke-hairline) solid var(--color-border-subtle);
  text-align: left;
}
.option__textes { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.option__teinte {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  box-shadow: inset 0 0 0 var(--stroke-hairline) var(--color-border-strong);
}
.option__aa { width: 32px; flex-shrink: 0; }
.option__coche { width: 24px; height: 24px; }

/* Titres de section (DOCUMENTS, CONTACTS…) ------------------------------- */
.titre-section { color: var(--color-text-secondary); font-size: var(--font-size-caption); font-weight: 500; line-height: 1.3; }

/* Clavier dessiné (visible seulement sur ordinateur) ------------------------ */
.saisie-bas { flex-shrink: 0; margin-top: auto; }
.barre-format {
  display: flex; align-items: center; gap: var(--space-18);
  height: 47px;
  padding: var(--space-12) var(--space-20) 0;
  background: var(--color-accent-soft);
  border-bottom: var(--stroke-hairline) solid var(--color-border-subtle);
  font-size: var(--font-size-body); font-weight: 500; line-height: 1.35;
  overflow: hidden;
}
.barre-format__bouton { position: relative; min-width: 12px; display: grid; place-items: center; }
.barre-format__bouton--fin { font-weight: 400; }
.barre-format__envoyer {
  display: none;
  margin-left: auto;
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-md);
  background: var(--color-accent); color: var(--color-on-accent);
  font-size: var(--font-size-small); font-weight: 500;
}
.clavier-dessine {
  position: relative; height: 223px;
  background: var(--color-accent-soft);
}
.clavier-dessine__rangee { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.clavier-dessine__rangee:first-child { margin-top: 13px; }
.clavier-dessine__rangee--bas { gap: var(--space-6); }
.touche { width: 29px; height: 40px; border-radius: var(--radius-sm); background: var(--color-bg-default); }
.touche--maj { width: 48px; }
.touche--espace { width: 170px; }
.touche-envoyer {
  display: grid; place-items: center;
  width: 114px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-accent); color: var(--color-on-accent);
  font-size: var(--font-size-small); font-weight: 500; line-height: 1.35;
}
@media (max-width: 599.98px) {
  /* La barre de mise en forme suit le haut du vrai clavier (voir clavier.js) */
  .saisie-bas {
    position: fixed; left: 0; right: 0;
    bottom: var(--clavier-decalage, 0px);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--color-accent-soft);
    z-index: 3;
  }
  .barre-format { border-bottom: 0; padding-right: var(--space-12); height: 52px; padding-top: 0; }
  .barre-format__envoyer { display: block; }
}
