/* chrome.css — Chrome système undust v3 (N11).
   Modèle relevé sur les rendus Penpot (recette/home-v4, projet-v1, todos-v1) :
   AUCUNE barre, aucune bordure horizontale. Quatre couches :
     1. CANVAS pleine page (--surface-raised) ;
     2. CHROME FLOTTANT posé dessus : Accueil à gauche (profondeur ≥ 1),
        monogramme + « <compte>-<Produit> ▾ » centrés, slot app à droite ;
     3. FENÊTRE (--surface, radius.window) centrée — la « légère
        différence de couleur ». Le BREADCRUMB vit DANS la fenêtre : rangée
        d'en-tête (parents à gauche, actions fenêtre à droite, filet hairline) ;
     4. BANDE BASSE (app : My Bar…) + contrôles système à droite (FR|EN, thème,
        wordmark undust.).
   Charger APRÈS tokens.css. Aucun hex ici. JAMAIS d'emoji. */

/* ── 1. canvas ── */
/* Relevé Basecamp : la fenêtre est toujours PLUS CLAIRE que le canvas —
   blanc sur gris en clair, gris élevé sur fond profond en sombre. Les deux
   tokens de surface s'échangent donc selon le thème (mapping, pas un hex neuf). */
.chrome-canvas{
  --c-canvas: var(--surface-raised);
  --c-fenetre: var(--surface);
}
[data-theme="dark"] .chrome-canvas,
html.dark .chrome-canvas,
.dark .chrome-canvas{
  --c-canvas: var(--surface);
  --c-fenetre: var(--surface-raised);
}
.chrome-canvas{
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--c-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  container-type: inline-size;
}

/* ── 2. chrome flottant (pas une barre : pas de fond, pas de filet) ── */
.chrome-haut{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--space-3) var(--space-6) 0;
  min-height: 40px;
}
.chrome-retour{
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--type-small-size);
  font-weight: var(--type-small-weight);
}
.chrome-retour:hover{ color: var(--text-primary); }
.chrome-retour .glyphe-accueil{ width: 14px; height: 14px; flex: none; }

.chrome-compte{
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 18px;                      /* T18 relevé */
  letter-spacing: var(--type-h3-tracking);
}
.chrome-compte:hover{ color: var(--text-accent); }
.chrome-mono{ width: 20px; height: 20px; flex: none; display: block; color: var(--text-primary); }
.chrome-mono .atome{ fill: var(--accent); }
.chrome-compte .commutateur{ color: var(--text-secondary); }

.chrome-haut-droite{
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--type-small-size);
}
.chrome-haut-droite a{ color: var(--text-primary); text-decoration: none; }
.chrome-haut-droite a:hover{ color: var(--text-accent); }
.glyphe{ width: 16px; height: 16px; display: block; }
/* Glyphes du chrome : style ../icons/ EXACT — viewBox 24, stroke 2 currentColor,
   butt/miter, angles droits. JAMAIS d'emoji dans le chrome système. */
.chrome-pastille{ /* non-lu : carré accent, jamais rond */
  display: inline-block;
  width: var(--square-bullet); height: var(--square-bullet);
  background: var(--accent);
  vertical-align: 2px;
}

/* ── 3. fenêtre ── */
.chrome-fenetre{
  flex: 1;
  width: min(1088px, calc(100% - 2 * var(--space-16)));
  margin: var(--space-8) auto var(--space-6);
  background: var(--c-fenetre);
  border-radius: var(--radius-window);
  padding: 0 var(--space-8) var(--space-8);
  min-height: 0;
}
/* rangée d'en-tête de fenêtre = LE breadcrumb (todos-v1 : parent à gauche,
   actions à droite, filet hairline dessous). Absente à profondeur 0. */
.fenetre-entete{
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 48px;
  border-bottom: var(--border-width-hairline) solid var(--border);
  margin-bottom: var(--space-6);
}
.fil-ariane{
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  white-space: nowrap;
  font-size: var(--type-small-size);
}
.fil-niveau{
  color: var(--text-secondary);
  text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; max-width: 32ch;
}
.fil-niveau:hover{ color: var(--text-primary); }
.fil-sep{ color: var(--text-secondary); user-select: none; }
.fenetre-actions{ /* slot app : Signet, •••, Inviter… */
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--type-small-size);
  color: var(--text-secondary);
}
.fenetre-actions a{ color: var(--text-secondary); text-decoration: none; }
.fenetre-actions a:hover{ color: var(--text-primary); }

/* ── 4. bande basse : SYSTÈME à gauche, nav au centre, GESTE à droite ──
   Ordre Luc 03/09 (N11 amendé) : les contrôles système passent à gauche et la
   droite revient au geste principal de l'app, présent sur toutes ses pages.
   La barre est COLLÉE EN BAS — `sticky`, jamais `fixed` : `.chrome-canvas`
   porte `container-type`, donc du containment, et un `fixed` s'ancrerait au
   bas du DOCUMENT (mesuré sur agents le 03/09 : barre invisible au
   chargement). Fond opaque et filet de tête : le contenu défile dessous. */
.chrome-bas{
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 48px;
  padding-inline: var(--space-4);
  background: color-mix(in srgb, var(--c-canvas) 90%, var(--text-primary));
  border-top: var(--border-width-hairline) solid var(--border);
  font-size: var(--type-small-size);
  color: var(--text-secondary);
}
.chrome-bas-gauche{ justify-self: start; display: inline-flex; align-items: center; gap: var(--space-3); }
.chrome-bas-centre{ display: inline-flex; align-items: center; gap: var(--space-6); }
.chrome-bas-centre a{ color: var(--text-secondary); text-decoration: none; }
.chrome-bas-centre a:hover, .chrome-bas-centre a[aria-current="true"]{ color: var(--text-primary); }
/* L'onglet courant se voit au TRAIT, pas à la couleur seule (A3). */
.chrome-bas-centre a[aria-current="page"]{
  color: var(--text-primary);
  background: var(--c-fenetre);
  border: var(--border-width-hairline) solid var(--border);
  padding: 2px var(--space-2);
}
/* Le geste principal de l'app, à droite de la barre : un aplat, pas un cadre.
   Il est là sur TOUTES les pages du front — celles qui ne portent pas le
   formulaire y posent le lien qui l'ouvre. */
.chrome-geste{
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--control-height);
  padding-inline: var(--space-4);
  background: var(--accent);
  color: var(--on-accent);
  border: var(--border-width-strong) solid var(--accent);
  border-radius: var(--radius-interactive);
  font: 700 14px/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
}
.chrome-geste:hover{
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent-hover);
}
.chrome-geste .glyphe{ width: 14px; height: 14px; }
.chrome-bas-droite{ justify-self: end; display: inline-flex; align-items: center; gap: var(--space-3); }
.chrome-bouton{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  height: 32px;
  min-width: 32px;
  padding-inline: var(--space-2);
  background: none;
  border: none;
  border-radius: var(--radius-interactive);
  font-family: var(--font-sans);
  font-size: var(--type-ui-compact-size);
  font-weight: var(--type-ui-compact-weight);
  color: var(--text-secondary);
  cursor: pointer;
}
.chrome-bouton:hover{ color: var(--text-primary); }
.chrome-bouton:focus-visible, .chrome-retour:focus-visible, .chrome-compte:focus-visible,
.fil-niveau:focus-visible, .chrome-haut-droite a:focus-visible{
  outline: var(--border-width-strong) solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--c-canvas);
}
.chrome-theme-glyphe{
  width: 12px; height: 12px; flex: none;
  background: linear-gradient(90deg, var(--text-primary) 50%, var(--surface) 50%);
  border: var(--border-width-hairline) solid var(--text-primary);
}
/* signature pied (N10b) : wordmark, point final = atome carré (comme .marque i) */
.chrome-signature{
  font: 800 14px/1 var(--font-sans);
  color: var(--text-secondary);
  text-decoration: none;
  /* N10b : le mot et son atome ne se séparent jamais (atome seul sous le mot à
     393 px, relevé en ligne sur vote le 08/10 ; surchargé localement jusqu'en 3.6.0). */
  white-space: nowrap;
}
.chrome-signature i{
  display: inline-block;
  width: var(--square-tick); height: var(--square-tick);
  background: var(--accent);
  margin-left: 2px;
}

/* ── ≤ 640 (volet) : relevés mobiles (boards 11-17) — ‹ seul, fenêtre bord à bord ── */
@container (max-width: 640px){
  /* Le slot droit garde AU MOINS son contenu : chargé (encart + outils),
     il passait SOUS le nom centré à 375-411 px (csee, 06/10). Le nom reste
     centré quand ça tient, se décale sinon — jamais recouvert. */
  .chrome-haut{
    padding: var(--space-2) var(--space-3) 0;
    grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr);
  }
  .chrome-haut-droite{ gap: var(--space-2); }
  .chrome-retour .libelle{ display: none; }
  .chrome-compte{ font-size: var(--type-body-size); }
  .chrome-haut-droite .libelle-long{ display: none; }
  .chrome-fenetre{
    width: 100%;
    margin: var(--space-3) 0 0;
    border-radius: var(--radius-window) var(--radius-window) 0 0;
    padding: 0 var(--space-4) var(--space-6);
  }
  .fil-niveau{ max-width: 40vw; }
  /* Deux rangées explicites : nav au-dessus, puis système à gauche et geste à
     droite — là où le pouce les trouve. On empile, on ne déborde pas (N9) :
     le geste garde sa largeur, le système prend le reste (`minmax(0, 1fr)`)
     et passe à la ligne s'il est chargé (version, notes — csee, 06/10) au
     lieu de pousser le geste hors de l'écran. */
  .chrome-bas{
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "nav nav"
      "gauche droite";
    justify-content: space-between;
    gap: var(--space-2);
    padding-block: var(--space-2);
    padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
  }
  .chrome-bas-gauche{ grid-area: gauche; justify-self: start; min-width: 0; flex-wrap: wrap; row-gap: var(--space-1); }
  .chrome-bas-centre{ grid-area: nav; justify-self: center; gap: var(--space-4); flex-wrap: wrap; justify-content: center; }
  .chrome-bas-droite{ grid-area: droite; justify-self: end; }
  .chrome-bas .libelle-long{ display: none; }
}

/* ≤ 400 (N9 nomme 375) : la barre resserre écarts et flancs plutôt que de
   déborder. On ne retire ni la signature ni le geste. */
@container (max-width: 400px){
  .chrome-bas{ padding-inline: var(--space-2); }
  .chrome-bas-gauche{ gap: var(--space-2); }
  .chrome-geste{ padding-inline: var(--space-3); }
}
