/* ============================================================================
   L'Entrepôt — système visuel, celui du Garde-Manger.
   Palette de marque : turquoise #44BFD6, teal #1A7D92 / #0F5C6E.
   Pensé d'abord pour l'iPhone du quai : cibles de 48 px, texte de 16 px (Safari ne zoome pas),
   barre d'onglets en bas, à portée du pouce.
   ============================================================================ */

:root {
  color-scheme: light;
  --marque: #1A7D92; --marque-fonce: #0F5C6E; --marque-vive: #44BFD6; --marque-pale: #E8F6FA;
  --page: #F3F7F9; --surface: #FFFFFF; --surface-2: #F7FAFB; --surface-3: #EDF3F6;
  --lateral: #0B3A45; --lateral-encre: #D7EDF3; --lateral-encre-2: #8FB9C6;
  --encre: #0F1F24; --encre-2: #4A5F67; --encre-3: #5F737B;
  --bord: #DCE6EA; --bord-2: #C9D7DD;
  --accent: #1A7D92; --accent-encre: #FFFFFF; --accent-doux: #E1F2F6;
  --ok: #0A8A0A; --ok-encre: #0A6B0A; --ok-doux: #E6F6E6;
  --attention: #fab219; --attention-encre: #7A5300; --attention-doux: #FFF6DD;
  --serieux: #ec835a; --serieux-encre: #8A3C1A; --serieux-doux: #FDEDE5;
  --critique: #d03b3b; --critique-encre: #A21F1F; --critique-doux: #FBE7E7;
  /* Les missions humanitaires : le bleu de leur aire au plan. */
  --missions: #2f6fd1; --missions-encre: #1D4F9E; --missions-doux: #E6EEFB;
  --ombre-1: 0 1px 2px rgba(15,31,36,.05), 0 1px 3px rgba(15,31,36,.04);
  --ombre-2: 0 2px 6px rgba(15,31,36,.06), 0 8px 24px rgba(15,31,36,.06);
  --ombre-3: 0 12px 40px rgba(10,69,83,.22);
  --rayon: 12px; --rayon-s: 8px;
  --transition: 160ms cubic-bezier(.2,.7,.3,1);
  --bas: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0D1417; --surface: #141C1F; --surface-2: #192327; --surface-3: #1F2B30;
    --lateral: #0A1518; --encre: #EEF4F6; --encre-2: #A9BBC2; --encre-3: #8A9DA5;
    --bord: #24323A; --bord-2: #2E3F47; --marque-pale: #10262D;
    --accent: #2FAFC8; --accent-encre: #06232A; --accent-doux: #0F2A32;
    --ok-encre: #4CC94C; --ok-doux: #0F2A0F; --attention-encre: #F5C860; --attention-doux: #2D2410;
    --serieux-encre: #F5A585; --serieux-doux: #2E1A12; --critique-encre: #F08080; --critique-doux: #2E1414;
    --missions-encre: #8FB5F5; --missions-doux: #13213A;
    --ombre-1: 0 1px 2px rgba(0,0,0,.4); --ombre-2: 0 2px 8px rgba(0,0,0,.45); --ombre-3: 0 16px 48px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0D1417; --surface: #141C1F; --surface-2: #192327; --surface-3: #1F2B30;
  --lateral: #0A1518; --encre: #EEF4F6; --encre-2: #A9BBC2; --encre-3: #8A9DA5;
  --bord: #24323A; --bord-2: #2E3F47; --marque-pale: #10262D;
  --accent: #2FAFC8; --accent-encre: #06232A; --accent-doux: #0F2A32;
  --ok-encre: #4CC94C; --ok-doux: #0F2A0F; --attention-encre: #F5C860; --attention-doux: #2D2410;
  --serieux-encre: #F5A585; --serieux-doux: #2E1A12; --critique-encre: #F08080; --critique-doux: #2E1414;
  --missions-encre: #8FB5F5; --missions-doux: #13213A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--page); color: var(--encre);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .6rem; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.ico { width: 20px; height: 20px; flex: none; }
.discret { color: var(--encre-3); font-size: .88rem; }
.chiffre { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.cache { display: none !important; }

/* ---------------------------------------------------------------- coquille */

.coquille { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.lateral { background: var(--lateral); color: var(--lateral-encre); position: sticky; top: 0; height: 100vh;
           display: flex; flex-direction: column; padding: 1rem .8rem; gap: .2rem;
           /* Un long menu sur un petit écran : il défile, pour que son pied (thème, sortie) reste atteignable. */
           overflow-y: auto; overscroll-behavior: contain; }
.lateral .marque { display: flex; gap: .65rem; align-items: center; padding: .3rem .45rem 1rem; }
.lateral .marque img { width: 36px; height: 36px; border-radius: 9px; background: #fff; padding: 3px; }
.lateral .marque b { color: #fff; display: block; line-height: 1.15; }
.lateral .marque span { font-size: .75rem; color: var(--lateral-encre-2); }
.lien-nav { display: flex; align-items: center; gap: .65rem; padding: .6rem .65rem; border-radius: 9px; border: 0;
            background: none; color: var(--lateral-encre); cursor: pointer; text-align: left; width: 100%; font-size: .95rem; }
.lien-nav:hover { background: rgba(255,255,255,.07); }
.lien-nav[aria-current="page"] { background: rgba(68,191,214,.16); color: #fff; box-shadow: inset 3px 0 0 var(--marque-vive); }
/* Les groupes du menu d'un rôle (« Au quai », « Suivi », « Gestion ») ; un groupe sans titre, un trait. */
/* Les titres de groupe du menu se lisent d'un coup d'œil : plus grands, en clair, avec un filet. */
.titre-nav { display: flex; align-items: center; gap: .6rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
             color: var(--lateral-encre); padding: 1.15rem .65rem .4rem; }
.titre-nav::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.22); }
.separe-nav { border-top: 1px solid rgba(255,255,255,.08); margin: .55rem .45rem; }
.titre-plus { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--encre-3); margin: 1.1rem 0 .15rem; }
.titre-plus:first-child { margin-top: 0; }
.separe-plus { border-top: 1px solid var(--bord); margin-top: .7rem; }
/* La langue (langue.js), tout en haut, à gauche des messages : le même interrupteur que le mode IA, FR | EN, la
   langue en cours en clair. La piste allumée (EN) prend la couleur d'accent, pas celle de l'IA. */
.interrupteur-ia.interrupteur-langue { padding: 0 .65rem; gap: .35rem; }
.interrupteur-langue .langue-mot { font-size: .78rem; font-weight: 600; letter-spacing: .04em; opacity: .5; }
.interrupteur-langue .langue-mot.allume { opacity: 1; font-weight: 800; color: var(--encre); }
.interrupteur-ia.interrupteur-langue.actif { border-color: var(--bord); }
.interrupteur-ia.interrupteur-langue.actif .interrupteur-ia-piste { background: var(--accent); }
.lien-nav .compte { margin-left: auto; background: var(--critique); color: #fff; border-radius: 99px; font-size: .72rem; padding: 0 .45rem; font-weight: 700; }
.lateral .pied { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: .8rem; font-size: .85rem; }
.lateral .pied b { color: #fff; display: block; }
.lateral .pied button { margin-top: .5rem; }
/* Les sélecteurs du thème et des mesures dans le menu, toujours sombre : leurs propres couleurs. */
.lateral .choix-theme, .lateral .choix-mesures { background: rgba(255,255,255,.08); }
.lateral .choix-theme button, .lateral .choix-mesures button { color: var(--lateral-encre-2); min-height: 32px; padding: .3rem .4rem; margin: 0; font-size: .8rem; }
.lateral .choix-theme button[aria-pressed="true"], .lateral .choix-mesures button[aria-pressed="true"] { background: rgba(255,255,255,.16); color: #fff; box-shadow: none; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.barre { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.4rem; border-bottom: 1px solid var(--bord); background: var(--page); }
.barre h1 { font-size: 1.2rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* La signature de la barre, comme au Garde-Manger ; sur un écran étroit, le titre passe avant elle. */
.signature { flex: none; display: flex; gap: .4rem; align-items: baseline; white-space: nowrap; font-size: .7rem; color: var(--encre-2); letter-spacing: .01em; }
.signature .sig-version { font-variant-numeric: tabular-nums; font-weight: 650; }
@media (max-width: 860px) { .signature { display: none; } }
.contenu { padding: 1.2rem 1.4rem 2rem; max-width: 1200px; width: 100%; }
.bandeau-bac { background: #e8590c; color: #fff; text-align: center; font-weight: 700; font-size: .8rem; padding: .25rem; letter-spacing: .04em; }
.onglets-bas { display: none; }

@media (max-width: 860px) {
  .coquille { grid-template-columns: 1fr; }
  .lateral { display: none; }
  .barre { position: sticky; top: 0; z-index: 20; padding: .7rem 1rem; padding-top: max(.7rem, env(safe-area-inset-top)); }
  .contenu { padding: 1rem 1rem calc(6rem + var(--bas)); }
  .onglets-bas {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: var(--surface); border-top: 1px solid var(--bord); padding-bottom: var(--bas); box-shadow: 0 -4px 16px rgba(0,0,0,.05);
  }
  .onglets-bas button { border: 0; background: none; padding: .5rem 0 .45rem; display: flex; flex-direction: column; align-items: center;
                        gap: .1rem; font-size: .7rem; color: var(--encre-3); cursor: pointer; min-height: 56px; }
  .onglets-bas button[aria-current="page"] { color: var(--accent); font-weight: 650; }
  .onglets-bas .ico { width: 24px; height: 24px; }
  .onglets-bas .scan { color: var(--accent); }
  .onglets-bas .scan .rond { color: var(--accent-encre); }
  .onglets-bas .scan .rond { background: var(--accent); border-radius: 99px; width: 52px; height: 52px; margin-top: -18px;
                             display: grid; place-items: center; box-shadow: var(--ombre-3); }
  .onglets-bas .scan .ico { width: 28px; height: 28px; }
}

/* ---------------------------------------------------------------- blocs */

.grille { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-1); padding: 1rem 1.1rem; }
.carte > h2 { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.carte > h2 .ico { color: var(--accent); }
.carte.critique { border-color: var(--critique); box-shadow: inset 4px 0 0 var(--critique), var(--ombre-1); }
.carte.attention { border-color: var(--attention); box-shadow: inset 4px 0 0 var(--attention), var(--ombre-1); }
.carte.ok { box-shadow: inset 4px 0 0 var(--ok), var(--ombre-1); }
.pile > * + * { margin-top: 1rem; }
.rangee { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.rangee.fin { justify-content: flex-end; }
.espace { flex: 1; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.tuile { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .8rem .9rem; }
.tuile .valeur { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tuile .libelle { font-size: .8rem; color: var(--encre-3); }
.vide { color: var(--encre-3); text-align: center; padding: 1.2rem .5rem; font-size: .92rem; }

.pastille { display: inline-flex; align-items: center; gap: .3rem; border-radius: 99px; padding: .08rem .55rem; font-size: .76rem;
            font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--encre-2); }
.pastille.ok { background: var(--ok-doux); color: var(--ok-encre); }
.pastille.attention { background: var(--attention-doux); color: var(--attention-encre); }
.pastille.serieux { background: var(--serieux-doux); color: var(--serieux-encre); }
.pastille.critique { background: var(--critique-doux); color: var(--critique-encre); }
.pastille.missions { background: var(--missions-doux); color: var(--missions-encre); }
/* Une carte des missions : le liseré bleu de leur aire. */
.carte.missions { box-shadow: inset 4px 0 0 var(--missions), var(--ombre-1); }

/* Une ligne qu'on touche : un lot, une denrée, une sortie. */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { border-top: 1px solid var(--bord); }
.liste > li:first-child { border-top: 0; }
.item { display: flex; gap: .75rem; align-items: center; padding: .7rem .2rem; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; min-height: 52px; }
.item:hover { background: var(--surface-2); }
.item .corps { flex: 1; min-width: 0; }
.item .titre { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.item .sous { font-size: .84rem; color: var(--encre-3); }
.item .droite { text-align: right; flex: none; }
.item.pris { opacity: .55; }
.item.pris .titre { text-decoration: line-through; }
.coche { width: 28px; height: 28px; border-radius: 99px; border: 2px solid var(--bord-2); display: grid; place-items: center; flex: none; }
.pris .coche { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------------------------------------------------------------- formulaires */

.bouton { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .55rem 1rem;
          border-radius: 10px; border: 1px solid var(--bord-2); background: var(--surface); cursor: pointer; font-weight: 600;
          transition: background var(--transition), transform var(--transition); text-decoration: none; color: var(--encre); }
.bouton:hover { background: var(--surface-2); }
.bouton:active { transform: scale(.98); }
.bouton.primaire { background: var(--accent); border-color: var(--accent); color: var(--accent-encre); }
.bouton.primaire:hover { filter: brightness(1.06); }
.bouton.danger { background: var(--critique); border-color: var(--critique); color: #fff; }
.bouton.discret { border-color: transparent; background: none; color: var(--accent); }
.bouton.grand { min-height: 56px; font-size: 1.05rem; width: 100%; border-radius: 14px; }
.bouton[disabled] { opacity: .5; pointer-events: none; }
.champ { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.champ > span { font-size: .82rem; font-weight: 600; color: var(--encre-2); }
.champ input, .champ select, .champ textarea {
  border: 1px solid var(--bord-2); border-radius: 10px; padding: .6rem .7rem; background: var(--surface); min-height: 46px; width: 100%;
  font-size: 16px;
}
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
.champ.erreur input, .champ.erreur select, .champ.erreur textarea { border-color: var(--critique); }
/* L'attribut hidden l'emporte sur un display posé par une règle (la bande « suite » est en flex). */
[hidden] { display: none !important; }
.champs { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.case { display: flex; gap: .55rem; align-items: flex-start; font-size: .92rem; }
.case input { width: 22px; height: 22px; margin: .1rem 0 0; flex: none; accent-color: var(--accent); }
.segments { display: flex; gap: .3rem; background: var(--surface-3); padding: .25rem; border-radius: 12px; overflow-x: auto; }
.segments button { flex: 1; border: 0; background: none; padding: .5rem .7rem; border-radius: 9px; cursor: pointer; font-weight: 600;
                   color: var(--encre-2); white-space: nowrap; min-height: 40px; }
.segments button[aria-pressed="true"] { background: var(--surface); color: var(--encre); box-shadow: var(--ombre-1); }
.quantite { display: flex; align-items: center; gap: .3rem; }
.quantite input { width: 5.5rem; text-align: center; border: 1px solid var(--bord-2); border-radius: 10px; min-height: 44px; font-size: 16px; background: var(--surface); }
.quantite button { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--bord-2); background: var(--surface); font-size: 1.3rem; cursor: pointer; }

table.tableau { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--encre-3); font-weight: 650;
              padding: .45rem .5rem; border-bottom: 1px solid var(--bord); }
.tableau td { padding: .5rem; border-bottom: 1px solid var(--bord); vertical-align: top; }
.tableau td.nombre, .tableau th.nombre { text-align: right; font-variant-numeric: tabular-nums; }
.defile { overflow-x: auto; }

/* ---------------------------------------------------------------- messages et modales */

.messages { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(5.5rem + var(--bas));
            display: flex; flex-direction: column; gap: .5rem; width: min(520px, calc(100vw - 2rem)); pointer-events: none; }
@media (min-width: 861px) { .messages { bottom: 1.5rem; } }
.message { background: var(--encre); color: var(--page); border-radius: 12px; padding: .75rem 1rem; box-shadow: var(--ombre-3);
           font-size: .95rem; pointer-events: auto; animation: monte .2s ease both; }
.message.erreur { background: var(--critique); color: #fff; }
.message.ok { background: var(--ok); color: #fff; }
.message.attention { background: var(--attention); color: #3a2800; }
@keyframes monte { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.voile { position: fixed; inset: 0; z-index: 60; background: rgba(8,20,24,.5); display: grid; place-items: end center; }
@media (min-width: 861px) { .voile { place-items: center; } }
.modale { background: var(--surface); width: min(560px, 100vw); max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0;
          padding: 1.1rem 1.1rem calc(1.1rem + var(--bas)); box-shadow: var(--ombre-3); }
@media (min-width: 861px) { .modale { border-radius: 16px; } }
.modale h2 { margin-bottom: .8rem; }

/* ---------------------------------------------------------------- le scanner */

.scanner { position: fixed; inset: 0; z-index: 80; background: #000; color: #fff; display: flex; flex-direction: column; }
.scanner .tete { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; padding-top: max(.7rem, env(safe-area-inset-top)); }
.scanner .tete h2 { flex: 1; color: #fff; font-size: 1.05rem; }
.scanner .tete button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 99px; min-width: 44px; height: 44px; padding: 0 .9rem; font-weight: 600; cursor: pointer; }
.scanner .vue { position: relative; flex: 1; overflow: hidden; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .cadre { position: absolute; left: 8%; right: 8%; top: 32%; height: 26%; border-radius: 16px;
                  box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); border: 3px solid rgba(255,255,255,.85); transition: border-color .15s; }
.scanner .cadre.arme { border-color: var(--marque-vive); border-width: 4px; }
.scanner .cadre.ok { border-color: #3ddc52; } .scanner .cadre.attention { border-color: #ffc53d; } .scanner .cadre.erreur { border-color: #ff5a5a; }
.scanner .aide { position: absolute; left: 0; right: 0; top: calc(58% + 12px); text-align: center; font-size: .9rem; color: rgba(255,255,255,.85); padding: 0 1rem; }
.scanner .resultat { min-height: 4.2rem; padding: .7rem 1rem; font-size: 1rem; background: #111; border-top: 1px solid #222;
                     display: flex; align-items: center; gap: .6rem; }
/* Des fonds francs, lisibles à bout de bras : on ne devrait pas avoir à lire la phrase. */
.scanner .resultat.ok { background: #1e9e45; color: #fff; } .scanner .resultat.attention { background: #ffc21a; color: #1a1300; }
.scanner .resultat.erreur { background: #d62828; color: #fff; }
.scanner .resultat .marque { font-size: 2.2rem; font-weight: 900; line-height: 1; min-width: 2.2rem; text-align: center; }
.scanner .resultat .mot { font-weight: 900; letter-spacing: .04em; font-size: 1.05rem; }
.scanner .resultat .texte { flex: 1; min-width: 0; }
/* La suite : la prochaine ligne à prendre, ce qui reste à compter, le lot qui attend sa place. */
.scanner .suite { display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; background: #1d2a2f; color: #e8f6fa; font-size: .95rem; border-top: 1px solid #2c3d44; }
.scanner .suite span { flex: 1; min-width: 0; }
.scanner .suite button { background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 99px; min-height: 40px; padding: 0 .9rem; font-weight: 700; cursor: pointer; }
/* Le pavé du comptage : dans le scanner, caméra ouverte ; pas de clavier de l'iPhone à faire surgir. */
.scanner .pave { background: #111; padding: .5rem .9rem .3rem; border-top: 1px solid #222; }
.scanner .pave .libelle { font-size: .9rem; color: #cfe3e9; }
.scanner .pave .valeur { font-size: 2rem; font-weight: 800; text-align: right; padding: .1rem .3rem; font-variant-numeric: tabular-nums; }
.scanner .pave .touches { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.scanner .pave button { min-height: 50px; border: 0; border-radius: 10px; background: #262626; color: #fff; font-size: 1.35rem; font-weight: 700;
                        touch-action: manipulation; cursor: pointer; }
.scanner .pave .actions { display: grid; grid-template-columns: 1fr 2fr; gap: .4rem; margin-top: .4rem; }
.scanner .pave .noter { background: var(--marque-vive); color: #002; }
.scanner .pave .annuler { background: #3a3a3a; font-size: 1rem; }
.scanner.compte .barre-declencheur, .scanner.compte .saisie { display: none; }
.scanner.compte .pave { padding-bottom: calc(.5rem + var(--bas)); }
@media (max-height: 700px) { .scanner .pave button { min-height: 42px; } .scanner .pave .valeur { font-size: 1.6rem; } }
.scanner .barre-declencheur { display: flex; justify-content: center; padding: .7rem 0 .4rem; background: #111; }
.declencheur { border: 0; background: none; color: #fff; display: flex; flex-direction: column; align-items: center; gap: .3rem;
               cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; font-weight: 700; }
.declencheur .rond-declencheur { width: 84px; height: 84px; border-radius: 99px; background: var(--marque-vive); color: #002;
                                  display: grid; place-items: center; box-shadow: 0 0 0 5px rgba(255,255,255,.25); transition: transform .12s; }
.declencheur .rond-declencheur .ico { width: 38px; height: 38px; }
.declencheur:active .rond-declencheur { transform: scale(.94); }
.declencheur.arme .rond-declencheur { background: #fff; animation: pulse .6s ease-in-out infinite alternate; }
.declencheur[disabled] { opacity: .35; }
@keyframes pulse { from { box-shadow: 0 0 0 5px rgba(68,191,214,.4); } to { box-shadow: 0 0 0 14px rgba(68,191,214,.1); } }
.scanner .saisie { display: flex; gap: .5rem; padding: .6rem .9rem calc(.6rem + var(--bas)); background: #111; }
.scanner .saisie input { flex: 1; border-radius: 10px; border: 1px solid #333; background: #1c1c1c; color: #fff; padding: .6rem .7rem; font-size: 16px; min-height: 46px; }
.scanner .saisie button { border-radius: 10px; border: 0; background: var(--marque-vive); color: #002; font-weight: 700; padding: 0 1rem; min-height: 46px; }
.scanner .panne { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 2rem; color: #ddd; }
.scanner .panne a { color: var(--marque-vive); }
/* Une erreur d'enregistrement : elle reste en tête du formulaire, la ligne en faute bordée de rouge. */
.faute-formulaire { display: flex; align-items: flex-start; gap: .6rem; background: var(--critique-doux); color: var(--critique-encre);
                    border: 1px solid var(--critique); border-radius: var(--rayon); padding: .7rem .9rem; font-weight: 600; }
.faute-formulaire > span { flex: 1; }
.faute-formulaire .bouton { min-height: 0; padding: .1rem; color: inherit; }
.en-faute { outline: 3px solid var(--critique); outline-offset: 2px; border-radius: var(--rayon); flex-wrap: wrap !important; }
.faute-ligne { flex-basis: 100%; margin: .5rem 0 0; color: var(--critique-encre); font-weight: 600; font-size: .92rem; }
.eclair { position: fixed; inset: 0; z-index: 85; pointer-events: none; animation: eclair .35s ease-out both; }
@keyframes eclair { from { opacity: .45; } to { opacity: 0; } }

/* ---------------------------------------------------------------- connexion */

.accueil-connexion { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(160deg, var(--lateral), var(--marque-fonce)); }
.accueil-connexion .carte { width: min(400px, 100%); padding: 1.6rem; }
.accueil-connexion img { width: 56px; height: 56px; border-radius: 14px; background: #fff; padding: 4px; }

/* ---------------------------------------------------------------- impression */

.etiquettes { display: flex; flex-wrap: wrap; gap: 6mm; }
.etiquette { width: 62mm; height: 29mm; border: 1px dashed var(--bord-2); border-radius: 2mm; padding: 1.2mm 2mm; background: #fff; color: #000;
             display: flex; flex-direction: column; gap: .3mm; overflow: hidden; font-family: system-ui, sans-serif; }
.etiquette .nom { font-weight: 800; font-size: 8.5pt; line-height: 1.05; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.etiquette .date { font-size: 12pt; font-weight: 800; line-height: 1.05; flex: none; }
.etiquette .date small { font-size: 6.5pt; font-weight: 700; display: block; letter-spacing: .03em; }
.etiquette .code { margin-top: auto; display: flex; align-items: flex-end; flex: none; }
.etiquette .code svg { height: 10.5mm; width: auto; max-width: 58mm; display: block; flex: none; }
.etiquette .infos { font-size: 6.5pt; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.etiquette .infos b { font-size: 7.5pt; font-family: ui-monospace, Menlo, monospace; }
.etiquette.lieu .code svg { height: 12mm; }
/* « MISSIONS — ne pas distribuer » : en blanc sur noir, lisible sans lunettes, pour qu'un sac de
   vêtements ne finisse pas au dépannage. */
.etiquette .bandeau { flex: none; background: #000; color: #fff; font-weight: 900; font-size: 7pt; line-height: 1.25; text-transform: uppercase;
                      letter-spacing: .04em; text-align: center; border-radius: .6mm; white-space: nowrap; overflow: hidden; }
.etiquette.lieu .nom { font-size: 16pt; text-transform: none; }
.etiquette.essai { display: flex; flex-direction: column; gap: 1.5mm; }
.etiquette.essai .nom { font-size: 7.5pt; text-transform: none; flex: none; }
.etiquette.essai .code { flex: 1; min-height: 0; align-items: center; }
.etiquette.essai .code svg { height: 100%; max-height: 20mm; max-width: 56mm; }
.bon { background: #fff; color: #000; padding: 1.5rem; border: 1px solid var(--bord); border-radius: var(--rayon); max-width: 800px; }
.bon table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.bon td, .bon th { border-bottom: 1px solid #ccc; padding: .35rem; text-align: left; }
.bon .destinataire { display: grid; grid-template-columns: max-content 1fr; gap: .15rem 1rem; margin: .6rem 0; }
.bon .destinataire dt { font-weight: 700; } .bon .destinataire dd { margin: 0; }
.bon .signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3rem; }
.bon .signatures div { border-top: 1px solid #000; padding-top: .3rem; font-size: .85rem; }

@media print {
  body { background: #fff; }
  .lateral, .barre, .onglets-bas, .messages, .bandeau-bac, .pas-imprime { display: none !important; }
  .coquille { display: block; }
  .contenu { padding: 0; max-width: none; }
  .bon { border: 0; padding: 0; }
  body, .principal, .contenu, .pile { background: #fff !important; }
  /* Rouleau : une étiquette par page, au format de l'étiquette, sans marges. */
  .etiquettes.rouleau { display: block; }
  .etiquettes.rouleau .etiquette { border: 0; border-radius: 0; page-break-after: always; break-after: page; margin: 0; page: etiquette; }
  /* Feuille : toutes à la suite sur du papier ordinaire, trois de front, avec des traits de coupe. */
  .etiquettes.feuille { display: grid; grid-template-columns: repeat(3, 62mm); gap: 3mm; justify-content: center; }
  .etiquettes.feuille .etiquette { border: .2mm dashed #888; border-radius: 0; break-inside: avoid; page-break-inside: avoid; }
  /* Palette : une grande étiquette par page Lettre. */
  .etiquettes.palette { display: block; }
  .etiquettes.palette .etiquette-palette { page: palette; width: auto; height: 250mm; border: .6mm solid #000; border-radius: 0; margin: 0;
                                           page-break-after: always; break-after: page; box-shadow: none; }
  /* Pas de page blanche après la dernière. */
  .etiquettes.palette .etiquette-palette:last-child, .etiquettes.rouleau .etiquette:last-child { page-break-after: auto; break-after: auto; }
}
@page etiquette { size: 62mm 29mm; margin: 0; }
@page palette { size: letter portrait; margin: 12mm; }
@page { margin: 10mm; }

/* ---------------------------------------------------------------- l'iPhone comme caméra du Mac */

.telecommande { background: var(--page); color: var(--encre); }
.telecommande .tete { background: var(--lateral); }
.telecommande .corps-telecommande { flex: 1; display: flex; gap: 2rem; padding: 1.5rem; overflow: auto; align-items: flex-start; }
.appairage { flex: none; width: 300px; text-align: center; }
.appairage .qr { width: 260px; height: 260px; background: #fff; padding: 12px; border-radius: 14px; }
.appairage.replie .qr { width: 110px; height: 110px; padding: 6px; opacity: .6; }
.appairage p { font-size: .9rem; color: var(--encre-2); }
.appairage .petit { font-size: .8rem; color: var(--encre-3); }
.telecommande .colonne { flex: 1; min-width: 0; }
.telecommande .consigne { color: var(--encre-3); }
.fil { list-style: none; margin: 0; padding: 0; }
.fil li { display: flex; gap: 1rem; padding: .6rem .8rem; border-radius: 10px; margin-bottom: .4rem; background: var(--surface); border-left: 4px solid var(--ok); }
.fil li.attention { border-left-color: var(--attention); }
.fil li.erreur { border-left-color: var(--critique); }
.fil li .mono { flex: none; color: var(--encre-3); }
.telecommande .resultat { background: var(--surface-2); color: var(--encre); }
.telecommande .resultat.ok { background: var(--ok-doux); color: var(--ok-encre); }
.telecommande .resultat.attention { background: var(--attention-doux); color: var(--attention-encre); }
.telecommande .resultat.erreur { background: var(--critique-doux); color: var(--critique-encre); }
.telecommande .saisie { background: var(--surface-2); }
.telecommande .saisie input { background: var(--surface); color: var(--encre); border-color: var(--bord-2); }

/* ---------------------------------------------------------------- l'étiquette de palette */

.etiquettes.palette { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; }
.etiquette-palette { width: min(190mm, 100%); aspect-ratio: 190 / 250; background: #fff; color: #000; border: 2px solid #000; border-radius: 4mm;
                     padding: 8mm 10mm; display: flex; flex-direction: column; gap: 5mm; font-family: system-ui, -apple-system, sans-serif;
                     box-shadow: var(--ombre-2); }
.etiquette-palette .tete-palette { display: flex; justify-content: space-between; font-size: 12pt; font-weight: 700; border-bottom: .6mm solid #000; padding-bottom: 2mm; }
.etiquette-palette .denree-palette { font-size: 40pt; font-weight: 900; line-height: 1.02; text-transform: uppercase; letter-spacing: -.01em; }
.etiquette-palette .denree-palette small { display: block; font-size: 16pt; font-weight: 600; text-transform: none; margin-top: 1mm; }
.etiquette-palette .quantite-palette { display: flex; flex-direction: column; border: .8mm solid #000; border-radius: 3mm; padding: 3mm 5mm; }
.etiquette-palette .quantite-palette b { font-size: 60pt; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.etiquette-palette .quantite-palette span { font-size: 22pt; font-weight: 700; }
.etiquette-palette .quantite-palette small { font-size: 13pt; }
.etiquette-palette .date-palette { font-size: 44pt; font-weight: 900; line-height: 1.05; }
.etiquette-palette .date-palette small { display: block; font-size: 16pt; font-weight: 800; letter-spacing: .04em; }
.etiquette-palette .code-palette { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 1mm; }
.etiquette-palette .code-palette svg { width: 150mm; max-width: 100%; height: 28mm; }
.etiquette-palette .code-palette .mono { font-size: 20pt; font-weight: 800; }
.etiquette-palette .bandeau-palette { background: #000; color: #fff; font-size: 26pt; font-weight: 900; text-transform: uppercase; text-align: center;
                                      letter-spacing: .03em; padding: 2mm 3mm; border-radius: 2mm; line-height: 1.1; }
.etiquette-palette .pied-palette { font-size: 11pt; text-align: center; border-top: .3mm solid #000; padding-top: 2mm; }
/* Une palette de plusieurs produits : ce qu'elle porte, en tableau ; le titre et la date, moins grands. */
.etiquette-palette.mixte .denree-palette { font-size: 34pt; }
.etiquette-palette.mixte .date-palette { font-size: 26pt; }
.etiquette-palette .contenu-etiquette { width: 100%; border-collapse: collapse; font-size: 14pt; }
.etiquette-palette .contenu-etiquette td { border-bottom: .3mm solid #000; padding: 1.6mm 2mm 1.6mm 0; vertical-align: baseline; }
.etiquette-palette .contenu-etiquette td b { font-size: 16pt; }
.etiquette-palette .contenu-etiquette td.nombre { text-align: right; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.etiquette-palette .contenu-etiquette td.mono { font-size: 10pt; white-space: nowrap; }

/* ---------------------------------------------------------------- ranger et sections */

.a-ranger { display: flex; flex-direction: column; gap: .7rem; }
.a-ranger.ok { box-shadow: inset 4px 0 0 var(--ok), var(--ombre-1); }
/* Une palette à ranger : ce qu'elle porte, en petite liste ; ses lignes, sous leur palette, à la réception. */
.contenu-palette { list-style: none; margin: 0; padding: 0 0 0 .8rem; border-left: 3px solid var(--bord-2); display: flex; flex-direction: column; gap: .15rem; font-size: .95rem; }
.titre-palette { margin: .6rem 0 0; font-size: 1.05rem; }
/* La liste du manutentionnaire : la section assignée en gros, à droite ; une case à cocher sur papier. */
.ligne-manut { display: flex; flex-direction: column; gap: .5rem; break-inside: avoid; page-break-inside: avoid; }
.ligne-manut.faite { box-shadow: inset 4px 0 0 var(--ok), var(--ombre-1); opacity: .75; }
.tete-manut { display: flex; gap: .8rem; align-items: flex-start; }
.corps-manut { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.liste-manutention .titre-imprime { display: none; }
.case-manut { display: none; flex: none; width: 7mm; height: 7mm; border: .5mm solid currentColor; border-radius: 1mm; margin-top: .1rem; }
.section-manut { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.section-manut small { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--encre-3); }
.section-manut .mono { font-size: 2rem; font-weight: 800; line-height: 1.05; white-space: nowrap; }
.section-manut .sans-place { color: var(--attention-encre); font-weight: 700; max-width: 9rem; }
@media print {
  .liste-manutention .ligne-manut { border: .3mm solid #000; box-shadow: none; opacity: 1; color: #000; background: #fff; }
  .liste-manutention .case-manut, .liste-manutention .titre-imprime { display: block; }
  .liste-manutention .titre-imprime { font-size: 18pt; margin: 0 0 2mm; color: #000; }
  .liste-manutention .discret, .liste-manutention .section-manut small { color: #333; }
}
.suggestion { display: flex; align-items: center; gap: .8rem; background: var(--accent-doux); border-radius: 12px; padding: .7rem .9rem; }
.suggestion .fleche { font-size: 1.6rem; color: var(--accent); font-weight: 800; }
.code-section { font-size: 1.6rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; flex: none; }
.plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.section-tuile { background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: .7rem; text-align: left; cursor: pointer;
                 display: flex; flex-direction: column; gap: .25rem; min-height: 96px; }
.section-tuile.ok { box-shadow: inset 0 -4px 0 var(--ok); }
.section-tuile.attention { box-shadow: inset 0 -4px 0 var(--attention); }
.section-tuile.critique { box-shadow: inset 0 -4px 0 var(--critique); background: var(--critique-doux); }
.section-tuile .code-section { font-size: 1.3rem; }
.section-tuile .petit { font-size: .8rem; color: var(--encre-2); }
.jauge { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.jauge span { display: block; height: 100%; background: var(--accent); }

/* « À demander » s'imprime seul : la liste du stock reste à l'écran. */
@media print { body.imprimer-demande .liste-stock { display: none; } }

/* ---------------------------------------------------------------- le plan en 3D */

.plan-3d { display: flex; flex-direction: column; gap: .6rem; }
.barre-3d { align-items: center; }
.corps-3d { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: .8rem; align-items: start; }
@media (max-width: 900px) { .corps-3d { grid-template-columns: 1fr; } .scene-3d { height: min(55vh, 640px); height: min(55svh, 640px); } }
.scene-3d { position: relative; height: min(68vh, 640px); min-height: 320px; border-radius: var(--rayon); overflow: hidden;
            border: 1px solid var(--bord); background: var(--page); }
/* Le doigt pilote la vue : la page ne défile ni ne zoome sous lui. */
.toile-3d { display: block; width: 100%; height: 100%; touch-action: none; outline: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.toile-3d:active { cursor: grabbing; }
.toile-3d.a-poser { cursor: crosshair; }
.toile-3d:focus-visible { box-shadow: inset 0 0 0 3px var(--marque-vive); }
.panneau-3d { min-width: 0; }
.scene-3d.sans-3d { height: auto; min-height: 0; display: grid; place-items: center; padding: 1rem; }
.outils-3d { align-items: center; gap: .5rem; }
/* Le plan 3D en plein écran : il couvre la fenêtre (sous les fenêtres de saisie et les messages). */
.plan-3d.plein-ecran-3d { position: fixed; inset: 0; z-index: 50; background: var(--page); overflow: auto; overscroll-behavior: contain;
                          padding: max(.8rem, env(safe-area-inset-top)) max(.8rem, env(safe-area-inset-right)) max(.8rem, env(safe-area-inset-bottom)) max(.8rem, env(safe-area-inset-left)); }
.plan-3d.plein-ecran-3d .scene-3d { height: calc(100vh - 8.5rem); height: calc(100dvh - 8.5rem); max-height: none; min-height: 320px; }
@media (max-width: 900px) { .plan-3d.plein-ecran-3d .scene-3d { height: calc(100svh - 10rem); } }
.page-plein-ecran-3d, .page-plein-ecran-3d body { overflow: hidden; }
.recherche-3d { flex: 1 1 220px; min-width: min(18rem, 100%); border: 1px solid var(--bord-2); border-radius: 99px; padding: .55rem 1rem; font-size: 16px;
                background: var(--surface); color: var(--encre); min-height: 42px; }
.choix-3d { flex: 0 1 15rem; min-width: 0; max-width: 100%; border: 1px solid var(--bord-2); border-radius: 99px; padding: .55rem .9rem; font-size: 16px;
             background: var(--surface); color: var(--encre); min-height: 42px; }
.choix-3d:focus { outline: none; border-color: var(--marque-vive); box-shadow: 0 0 0 3px var(--accent-doux); }
.recherche-3d:focus { outline: none; border-color: var(--marque-vive); box-shadow: 0 0 0 3px var(--accent-doux); }
.modes-3d { flex: 0 1 auto; }
.modes-3d button { min-height: 38px; padding: .35rem .7rem; }
.resultat-3d:empty { display: none; }
.lien-3d { border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }
/* L'infobulle du survol (Mac) : au-dessus de la toile, sans intercepter la souris. */
.infobulle-3d { position: absolute; z-index: 2; pointer-events: none; display: grid; gap: .1rem; min-width: 150px; max-width: 220px;
                background: var(--surface); color: var(--encre); border: 1px solid var(--bord); border-radius: 10px; padding: .45rem .65rem;
                box-shadow: var(--ombre-2); font-size: .85rem; }
.infobulle-3d b { font-size: 1rem; }
.infobulle-3d small { color: var(--encre-2); }
.legende-visite { position: absolute; z-index: 2; left: .8rem; bottom: .8rem; pointer-events: none; display: grid; gap: .05rem;
                  justify-items: start; text-align: left; width: max-content; max-width: min(44%, 24rem);
                  background: rgb(10 14 20 / .55); color: #fff; padding: .4rem .85rem; border-radius: 12px; font-size: .8rem;
                  backdrop-filter: blur(6px); box-shadow: 0 6px 24px rgb(0 0 0 / .35); }
.legende-visite b { font-size: .95rem; letter-spacing: .02em; }
.legende-visite span { color: rgb(255 255 255 / .82); font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.etat-3d { font-size: .85rem; }
.legende-3d { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .85rem; color: var(--encre-2); }
.pastille-3d { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: -1px; margin-right: .3rem; background: #9fb4bd; }
/* Le ton par un attribut : « vide », « ok »… sont déjà des classes de l'application. */
.pastille-3d[data-ton="ok"] { background: #2e9e4f; } .pastille-3d[data-ton="attention"] { background: #e6a100; }
.pastille-3d[data-ton="critique"] { background: #d03b3b; } .pastille-3d[data-ton="marque"] { background: #1A7D92; }

/* L'impression sort toujours en clair, même depuis un écran sombre : pas de texte clair sur papier
   blanc. (html:root… l'emporte sur les règles du thème sombre.) */
@media print {
  html:root:not([data-imprime]), html:root[data-theme="dark"] {
    color-scheme: light;
    --page: #FFFFFF; --surface: #FFFFFF; --surface-2: #F7FAFB; --surface-3: #EDF3F6; --marque-pale: #E8F6FA;
    --encre: #0F1F24; --encre-2: #4A5F67; --encre-3: #5F737B; --bord: #DCE6EA; --bord-2: #C9D7DD;
    --accent: #1A7D92; --accent-encre: #FFFFFF; --accent-doux: #E1F2F6;
    --ok-encre: #0A6B0A; --ok-doux: #E6F6E6; --attention-encre: #7A5300; --attention-doux: #FFF6DD;
    --serieux-encre: #8A3C1A; --serieux-doux: #FDEDE5; --critique-encre: #A21F1F; --critique-doux: #FBE7E7;
    --missions-encre: #1D4F9E; --missions-doux: #E6EEFB;
    --ombre-1: none; --ombre-2: none; --ombre-3: none;
  }
}

/* La fiche d'un produit trouvée dans les bases ouvertes (Open Food Facts…) : une aide, pas une vérité. */
.fiche-dehors { display: grid; gap: .15rem; padding: .6rem .8rem; border-radius: var(--rayon-s); background: var(--accent-doux); border: 1px solid var(--bord); }

/* Le chat, toujours sous la main : un bouton dans la barre du haut, avec le chiffre des messages non lus. */
.bouton-chat { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem;
               border-radius: 50%; border: 1px solid var(--bord); background: var(--surface); color: var(--encre); cursor: pointer; }
.bouton-chat:hover { background: var(--surface-2); }
.bouton-chat[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
.bouton-chat .ico { width: 1.25rem; height: 1.25rem; }
.bouton-chat .compte { position: absolute; top: -.25rem; right: -.25rem; margin: 0; background: var(--critique); color: #fff; border-radius: 99px;
                       font-size: .68rem; padding: 0 .38rem; font-weight: 700; line-height: 1.25; }

/* Nommer quelqu'un (@) : la liste qui s'ouvre au-dessus de la zone d'écriture, le nom en évidence, l'alerte sous la barre. */
.chat-saisie { position: relative; flex: 1; display: flex; }
.chat-saisie textarea { flex: 1; }
.chat-suggestions { position: absolute; left: 0; right: 0; bottom: calc(100% + .3rem); margin: 0; padding: .25rem; list-style: none; z-index: 30;
                    background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.chat-suggestions li { padding: .5rem .7rem; border-radius: 8px; cursor: pointer; }
.chat-suggestions li.actif, .chat-suggestions li:hover { background: var(--accent); color: #fff; }
.chat-suggestions li.actif .discret, .chat-suggestions li:hover .discret { color: inherit; opacity: .85; }
.compte.mention { background: var(--attention); color: #1b1300; }
.alerte-mention { display: flex; align-items: center; gap: .7rem; padding: .6rem 1.2rem; background: var(--attention-doux); color: var(--attention-encre);
                  border-bottom: 2px solid var(--attention); position: sticky; top: 0; z-index: 25; }
.alerte-mention[hidden] { display: none; }
.alerte-mention .ico { flex: none; }
.alerte-texte { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .alerte-mention { position: sticky; top: 3.4rem; padding: .55rem 1rem; } }

/* Le bouton du chat dit son nom, et — quand on nous a nommé — qui. */
.bouton-chat { width: auto; padding: 0 .85rem; gap: .45rem; border-radius: 99px; font-weight: 650; font-size: .88rem; }
.bouton-chat .chat-mot { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bouton-chat.alerte { background: var(--attention); border-color: var(--attention); color: #1b1300; animation: appel 1.6s ease-in-out infinite; }
@keyframes appel { 50% { box-shadow: 0 0 0 5px var(--attention-doux); } }
@media (max-width: 480px) { .bouton-chat .chat-mot { display: none; } .bouton-chat.alerte .chat-mot { display: inline; max-width: 8.5rem; } }
/* L'alerte : en gros, en texte, tant qu'on n'a pas répondu ou fermé. */
.alerte-mention { font-size: 1.05rem; padding: .85rem 1.2rem; background: var(--attention); color: #1b1300; border-bottom: 3px solid #1b1300; }
.alerte-mention .alerte-texte { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.alerte-mention .bouton { flex: none; }
.alerte-mention .bouton.discret { color: #1b1300; }

/* ================================================================ Messages : le salon de l'équipe */
.msg { --rayon: 20px; display: flex; flex-direction: column; height: calc(100vh - 9.5rem); height: calc(100dvh - 9.5rem); min-height: 440px; max-width: 880px;
       border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; position: relative;
       background: radial-gradient(1200px 400px at 100% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--surface);
       box-shadow: 0 10px 34px rgba(0,0,0,.18); }
.msg-tete { display: flex; align-items: center; gap: .8rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--bord);
            background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); }
.msg-logo { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 14px; color: #fff;
            background: linear-gradient(135deg, var(--accent), #6f5bd6); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent); }
.msg-logo .ico { width: 1.35rem; height: 1.35rem; }
.msg-tete-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msg-tete-titre b { font-size: 1.05rem; }
.msg-tete-titre span { font-size: .8rem; color: var(--encre-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-membres { display: flex; }
.msg-membres .avatar { margin-left: -.5rem; border: 2px solid var(--surface); }
.msg-membres .avatar:first-child { margin-left: 0; }

.avatar { flex: none; display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; color: #fff; font-weight: 700; font-size: .78rem;
          letter-spacing: .02em; box-shadow: 0 2px 6px rgba(0,0,0,.25); user-select: none; }
.avatar.petit { width: 1.6rem; height: 1.6rem; font-size: .62rem; }
.avatar.plus { background: var(--surface-3); color: var(--encre-2); box-shadow: none; }

.msg-corps { position: relative; flex: 1; min-height: 0; display: flex; }
.msg-fil { flex: 1; overflow-y: auto; padding: 1rem 1.1rem 1.4rem; display: flex; flex-direction: column; gap: .15rem; scroll-behavior: auto; overscroll-behavior: contain; }
.msg-jour, .msg-nouveaux { display: flex; align-items: center; gap: .8rem; margin: .9rem 0 .5rem; color: var(--encre-2); font-size: .74rem; font-weight: 650;
                           text-transform: capitalize; letter-spacing: .03em; }
.msg-jour::before, .msg-jour::after, .msg-nouveaux::before, .msg-nouveaux::after { content: ''; flex: 1; height: 1px; background: var(--bord); }
.msg-jour span { background: var(--surface-3); border-radius: 99px; padding: .2rem .8rem; }
.msg-nouveaux { color: var(--critique); text-transform: none; }
.msg-nouveaux::before, .msg-nouveaux::after { background: color-mix(in srgb, var(--critique) 45%, transparent); }
.msg-nouveaux span { background: color-mix(in srgb, var(--critique) 14%, transparent); border-radius: 99px; padding: .2rem .8rem; }

.msg-groupe { display: flex; align-items: flex-end; gap: .6rem; margin-top: .55rem; max-width: 100%; }
.msg-groupe.moi { flex-direction: row-reverse; }
.msg-pile { display: flex; flex-direction: column; gap: .15rem; min-width: 0; max-width: min(78%, 34rem); }
.msg-groupe.moi .msg-pile { align-items: flex-end; }
.msg-meta { display: flex; align-items: baseline; gap: .5rem; font-size: .74rem; color: var(--encre-2); padding: 0 .35rem; }
.msg-meta b { color: var(--encre); font-size: .8rem; }
.msg-bulle { position: relative; padding: .5rem .85rem; border-radius: 18px; background: var(--surface-3); color: var(--encre); line-height: 1.38; width: fit-content; max-width: 100%;
             box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.msg-groupe.autre .msg-bulle:first-of-type { border-bottom-left-radius: 6px; }
.msg-groupe.moi .msg-bulle { color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #6f5bd6)); border-bottom-right-radius: 6px;
                              box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.msg-texte { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-masquer { position: absolute; top: -.5rem; right: -.35rem; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 99px;
               background: var(--surface); color: var(--encre-2); box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; opacity: 0; transition: opacity .12s; }
.msg-masquer svg { width: 14px; height: 14px; }
.msg-bulle:hover .msg-masquer, .msg-masquer:focus-visible { opacity: 1; }
@media (hover: none) { .msg-masquer { opacity: .7; } }
.msg-bulle.pour-moi { background: color-mix(in srgb, var(--attention) 22%, var(--surface-3)); outline: 2px solid var(--attention); }
.msg-pour-vous { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--attention-encre); margin-bottom: .1rem; }
.nomme { font-weight: 700; background: color-mix(in srgb, currentColor 16%, transparent); border-radius: 6px; padding: 0 .25rem; }
.msg-groupe.moi .nomme { background: rgba(255,255,255,.24); }
.nomme.moi { background: var(--attention); color: #1b1300; }
.entree { animation: msgEntree .28s cubic-bezier(.2,.9,.3,1.2); }
@keyframes msgEntree { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.msg-vide { margin: auto; display: grid; justify-items: center; gap: .35rem; text-align: center; max-width: 22rem; color: var(--encre-2); padding: 2rem 1rem; }
.msg-vide b { color: var(--encre); font-size: 1.05rem; }
.msg-vide-rond { display: grid; place-items: center; width: 4.2rem; height: 4.2rem; border-radius: 50%; margin-bottom: .4rem; color: var(--accent);
                 background: color-mix(in srgb, var(--accent) 14%, transparent); }
.msg-vide-rond .ico { width: 2rem; height: 2rem; }

.msg-bas { position: absolute; right: 1.2rem; bottom: .9rem; border: 0; cursor: pointer; border-radius: 99px; padding: .45rem .9rem; font-weight: 700; font-size: .82rem;
           color: #fff; background: linear-gradient(135deg, var(--accent), #6f5bd6); box-shadow: 0 8px 22px rgba(0,0,0,.35); animation: msgEntree .25s; }
.msg-bas[hidden] { display: none; }

.msg-nommer { display: flex; align-items: center; gap: .45rem; padding: .5rem 1.1rem 0; overflow-x: auto; scrollbar-width: none; font-size: .78rem; }
.msg-nommer:empty { display: none; }
.msg-nommer::-webkit-scrollbar { display: none; }
.puce { flex: none; display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--bord); background: var(--surface); color: var(--encre); cursor: pointer;
        border-radius: 99px; padding: .18rem .7rem .18rem .2rem; font-size: .8rem; font-weight: 600; transition: transform .12s, background .12s; }
.puce:hover { background: var(--accent-doux); transform: translateY(-1px); }

.msg-compo { position: relative; display: flex; align-items: flex-end; gap: .45rem; padding: .7rem 1rem 1rem; }
.chat-saisie { position: relative; flex: 1; display: flex; }
.chat-saisie textarea { flex: 1; resize: none; max-height: 140px; border-radius: 22px; padding: .7rem 1.1rem; line-height: 1.35; border: 1px solid var(--bord);
                        background: var(--surface-2); transition: border-color .15s, box-shadow .15s; }
.chat-saisie textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.msg-outil { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--bord); background: var(--surface-2);
             color: var(--encre-2); font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: background .12s, color .12s; }
.msg-outil:hover { background: var(--accent-doux); color: var(--accent); }
.msg-envoyer { flex: none; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
               background: linear-gradient(135deg, var(--accent), #6f5bd6); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .12s; }
.msg-envoyer:hover { transform: scale(1.06) rotate(-6deg); }
.msg-envoyer:disabled { opacity: .5; }
.msg-envoyer .ico { width: 1.2rem; height: 1.2rem; }
.msg-emojis { position: absolute; left: 1rem; bottom: calc(100% - .3rem); z-index: 30; display: grid; grid-template-columns: repeat(9, 1fr); gap: .1rem; padding: .5rem;
              background: var(--surface); border: 1px solid var(--bord); border-radius: 16px; box-shadow: 0 12px 34px rgba(0,0,0,.4); animation: msgEntree .18s; }
.msg-emojis[hidden] { display: none; }
.msg-emojis button { border: 0; background: none; font-size: 1.35rem; width: 2.1rem; height: 2.1rem; border-radius: 10px; cursor: pointer; }
.msg-emojis button:hover { background: var(--accent-doux); }
.chat-suggestions li { display: flex; align-items: center; gap: .6rem; }
.chat-suggestions li .discret { margin-left: auto; font-size: .78rem; }

@media (max-width: 860px) {
  .msg { height: calc(100vh - 13rem); height: calc(100dvh - 13rem); border-radius: 16px; }
  .msg-pile { max-width: 84%; }
  .msg-compo { padding: .6rem .7rem .8rem; }
  .msg-membres { display: none; }
}
@media (prefers-reduced-motion: reduce) { .entree, .msg-bas, .msg-emojis { animation: none; } }

/* ---- Les listes d'envoi à ANV Distribution */
.pal-choix { display: flex; gap: .8rem; align-items: flex-start; cursor: pointer; transition: border-color .12s, background .12s; }
.pal-choix input[type=checkbox] { width: 1.4rem; height: 1.4rem; margin-top: .15rem; flex: none; accent-color: var(--accent); }
.pal-choix.choisie { border-color: var(--accent); background: var(--accent-doux); box-shadow: inset 4px 0 0 var(--accent); }
.pal-choix.bloquee { opacity: .55; cursor: default; }
.pal-choix-corps { flex: 1; min-width: 0; }
.pal-choix-titre { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.barre-envoi-3d { display: grid; gap: .6rem; border-color: var(--accent); background: var(--accent-doux); box-shadow: inset 4px 0 0 var(--accent); }
.pal-envoi { display: grid; gap: .5rem; padding: .7rem .8rem; }
.pal-envoi.choisie { border-color: var(--accent); background: var(--accent-doux); }
.pal-envoi-corps { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .4rem; }
.barre-envoi { position: sticky; bottom: .6rem; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
               padding: .7rem 1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.barre-envoi .bouton { flex: none; }
.envoi-carte { display: grid; gap: .3rem; text-align: left; width: 100%; cursor: pointer; color: inherit; font: inherit; }
.envoi-carte:hover { border-color: var(--accent); }
.envoi-carte.pour-moi { box-shadow: inset 4px 0 0 var(--attention); }
.envoi-carte-tete { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.envoi-jauge { height: .45rem; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.envoi-jauge span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #6f5bd6); border-radius: 99px; transition: width .3s; }
.envoi-jauge.grande { height: .7rem; }
.grande-case { width: 2rem; height: 2rem; accent-color: var(--ok, var(--accent)); flex: none; cursor: pointer; }

/* ---- L'entrée à la démonstration : on choisit son nom */
.equipe-entree { max-width: 560px; }
.equipe { display: grid; gap: .7rem; }
.personne { display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left; padding: .85rem 1rem; border-radius: 16px; cursor: pointer; color: var(--encre);
            background: var(--surface-2); border: 1px solid var(--bord); transition: transform .12s, border-color .12s, box-shadow .12s; }
.personne:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.personne.derniere { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.personne .avatar { width: 3rem; height: 3rem; font-size: 1rem; }
.personne-texte { display: flex; flex-direction: column; }
.personne-texte b { font-size: 1.1rem; }
.personne-texte span { color: var(--encre-2); font-size: .88rem; }

/* Qui est connecté : le nom et le titre, toujours en haut à droite. */
.qui { flex: none; display: flex; align-items: center; gap: .6rem; padding: .25rem .8rem .25rem .3rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--bord); }
.qui .avatar { width: 2.1rem; height: 2.1rem; font-size: .72rem; }
.qui-texte { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.qui-texte b { font-size: .9rem; white-space: nowrap; }
.qui-texte span { font-size: .72rem; color: var(--encre-2); white-space: nowrap; max-width: 15rem; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .qui-texte span { display: none; } .qui { padding-right: .6rem; } }
@media (max-width: 420px) { .qui-texte { display: none; } .qui { padding: .2rem; } }

/* Changer de personne : le nom en haut est un bouton, qui ouvre l'équipe. */
.qui-boite { position: relative; flex: none; }
button.qui { cursor: pointer; color: var(--encre); font: inherit; text-align: left; }
button.qui:hover { border-color: var(--accent); }
.qui-fleche { color: var(--encre-2); font-size: .8rem; margin-left: .1rem; }
.qui-menu { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 60; width: min(21rem, calc(100vw - 2rem)); padding: .4rem; border-radius: 18px;
            background: var(--surface); border: 1px solid var(--bord); box-shadow: 0 18px 44px rgba(0,0,0,.45); animation: msgEntree .16s; }
.qui-menu[hidden] { display: none; }
.qui-menu-titre { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-2); padding: .5rem .7rem .3rem; }
.qui-choix { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .55rem .7rem; border: 0; border-radius: 12px; background: none; color: var(--encre); cursor: pointer; text-align: left; font: inherit; }
.qui-choix:hover { background: var(--accent-doux); }
.qui-choix.actuel { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.qui-choix .personne-texte { flex: 1; min-width: 0; }
.qui-choix .personne-texte b { font-size: .95rem; }
.qui-choix .personne-texte span { font-size: .78rem; }
.qui-coche { color: var(--accent); font-weight: 800; }
.qui-sep { height: 1px; background: var(--bord); margin: .3rem .4rem; }
@media (max-width: 640px) { .qui-fleche { display: none; } }

/* Les titres de groupe du menu : de vrais repères — un ruban d'accent, en blanc, plus grands. */
.lateral .titre-nav { display: flex; align-items: center; gap: .55rem; margin: 1.35rem .2rem .5rem; padding: .5rem .8rem; border-radius: 12px; border-left: 4px solid var(--marque-vive);
                      font-size: .8rem; font-weight: 800; letter-spacing: .09em; color: #fff; white-space: nowrap;
                      background: linear-gradient(90deg, rgba(68,191,214,.34), rgba(111,91,214,.14) 70%, transparent);
                      box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.lateral .titre-nav::before { content: ''; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--marque-vive); box-shadow: 0 0 10px var(--marque-vive); }
.lateral .titre-nav::after { display: none; }
.lateral .lien-nav { margin-left: .2rem; }

/* Le manuel : un sommaire, puis une carte par sujet, lisible à l'écran comme sur papier. */
.manuel { max-width: 860px; }
.manuel-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.manuel-tete h1 { margin: 0 0 .2rem; font-size: 1.7rem; }
.manuel-table { padding: 1rem 1.2rem; border: 1px solid var(--bord); border-radius: 14px; background: var(--surface); }
.manuel-table ol { columns: 2; column-gap: 2rem; margin: .5rem 0 0; padding-left: 1.3rem; }
.manuel-table li { padding: .15rem 0; break-inside: avoid; }
.manuel-table a { color: var(--accent); text-decoration: none; font-weight: 600; }
.manuel-table a:hover { text-decoration: underline; }
.manuel-section { display: grid; gap: .7rem; scroll-margin-top: 4.5rem; }
.manuel-section h2 { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin: 0; font-size: 1.25rem; }
.manuel-section p { margin: 0; line-height: 1.55; }
.manuel-etapes, .manuel-liste { margin: 0; padding-left: 1.4rem; display: grid; gap: .5rem; line-height: 1.5; }
.manuel-etapes li::marker { font-weight: 800; color: var(--accent); }
.manuel-note { padding: .65rem .9rem; border-radius: 10px; background: var(--accent-doux); border-left: 4px solid var(--accent); }
.manuel-tableau { overflow-x: auto; }
.manuel-tableau table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.manuel-tableau th, .manuel-tableau td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--bord); vertical-align: top; }
@media (max-width: 640px) { .manuel-table ol { columns: 1; } }
@media print { .manuel-section { break-inside: avoid; box-shadow: none; } .manuel-table ol { columns: 2; } }

/* L'assistant : un fil de questions et de réponses, la saisie collée en bas. */
.assistant { display: grid; grid-template-rows: 1fr auto; gap: .8rem; max-width: 860px; min-height: calc(100vh - 11rem); }
.assistant-fil { display: flex; flex-direction: column; gap: .9rem; padding-bottom: .5rem; }
.assistant-bulle { display: flex; gap: .7rem; align-items: flex-start; max-width: 100%; }
.assistant-question { justify-content: flex-end; }
.assistant-question .assistant-corps { background: var(--accent); color: #04222a; font-weight: 600; padding: .6rem 1rem; border-radius: 18px 18px 4px 18px; max-width: 80%; }
.assistant-avatar { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; color: #fff;
                    background: linear-gradient(135deg, var(--accent), #6b6bff); box-shadow: 0 4px 14px rgb(68 191 214 / .35); }
.assistant-avatar svg { width: 1.2rem; height: 1.2rem; }
.assistant-reponse .assistant-corps { display: grid; gap: .7rem; min-width: 0; flex: 1; background: var(--surface); border: 1px solid var(--bord); border-radius: 4px 18px 18px 18px; padding: .8rem 1rem; }
.assistant-texte { margin: 0; line-height: 1.5; }
.assistant-tableau { overflow-x: auto; }
.assistant-puces { display: flex; flex-wrap: wrap; gap: .45rem; }
.puce { border: 1px solid var(--bord); background: var(--fond-2, transparent); color: var(--encre); border-radius: 999px; padding: .4rem .85rem; font-size: .88rem; cursor: pointer; transition: border-color .12s, background .12s; }
.puce:hover { border-color: var(--accent); background: var(--accent-doux); }
.assistant-resume { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.assistant-resume li { padding: .35rem .6rem; border-radius: 10px; border: 1px solid var(--bord); }
.assistant-resume li.a-voir { border-color: var(--accent); background: var(--accent-doux); }
.assistant-resume .lien-3d { text-decoration: none; font-weight: 500; color: var(--encre); }
.assistant-resume b { font-size: 1.1rem; color: var(--accent); }
.assistant-saisie { position: sticky; bottom: .6rem; display: flex; gap: .6rem; padding: .6rem; background: var(--surface); border: 1px solid var(--bord); border-radius: 16px; box-shadow: var(--ombre-2); }
.assistant-saisie input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font-size: 1rem; outline: none; }

/* Le bouton de l'assistant, à gauche de « Messages » : la même forme, une teinte à lui. */
.bouton-ia { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 2.4rem; padding: 0 .85rem;
             border-radius: 99px; border: 1px solid transparent; cursor: pointer; font-weight: 750; font-size: .88rem; letter-spacing: .03em; color: #fff;
             background: linear-gradient(135deg, var(--accent), #6b6bff); box-shadow: 0 3px 12px rgb(68 191 214 / .35); transition: transform .12s, box-shadow .12s; }
.bouton-ia:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgb(107 107 255 / .4); }
.bouton-ia .ico { width: 1.15rem; height: 1.15rem; }
.bouton-ia[aria-current="page"] { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { .bouton-ia .ia-mot { display: none; } .bouton-ia { width: 2.4rem; padding: 0; } }

.assistant-groupes { display: grid; gap: .7rem; }
.assistant-groupe { display: grid; gap: .3rem; }
.assistant-groupe > b { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }

/* « Demandez à l'IA » en tête d'Aujourd'hui. */
.carte-ia { display: grid; gap: .8rem; border: 1px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--accent), #6b6bff) border-box; }
.carte-ia-tete { display: flex; align-items: center; gap: .8rem; }
.carte-ia-tete b { font-size: 1.1rem; }
.carte-ia-icone { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #6b6bff); box-shadow: 0 4px 14px rgb(68 191 214 / .35); }
.carte-ia-icone svg { width: 1.4rem; height: 1.4rem; }
.carte-ia-saisie { position: static; box-shadow: none; background: var(--surface-2, transparent); }

/* L'IA sur chaque écran : un bandeau de questions en haut, et un tiroir qui s'ouvre de n'importe où. */
.bandeau-ia { display: flex; align-items: center; gap: .7rem; padding: .5rem .8rem; margin-bottom: 1rem; border-radius: 14px; border: 1px solid transparent;
              background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--accent), #6b6bff) border-box; }
.bandeau-ia-mot { flex: none; display: inline-flex; align-items: center; gap: .35rem; font-weight: 800; font-size: .8rem; letter-spacing: .06em; color: #fff; padding: .3rem .6rem; border-radius: 99px;
                  background: linear-gradient(135deg, var(--accent), #6b6bff); }
.bandeau-ia-mot .ico { width: .95rem; height: .95rem; }
.bandeau-ia-puces { display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; padding: .1rem 0; }
.bandeau-ia-puces .puce { flex: none; white-space: nowrap; }
.tiroir-ia { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); display: grid; grid-template-rows: auto auto 1fr; background: var(--fond, var(--surface));
             border-left: 1px solid var(--bord); box-shadow: -12px 0 40px rgb(0 0 0 / .35); animation: tiroir-entre .18s ease-out; }
.tiroir-ia[hidden] { display: none; }
@keyframes tiroir-entre { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.tiroir-ia-tete { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; border-bottom: 1px solid var(--bord); background: var(--surface); }
.tiroir-ia-titre { flex: 1; min-width: 0; display: grid; }
.tiroir-ia-titre .discret { font-size: .78rem; }
.tiroir-ia-sugg { padding: .6rem 1rem; display: grid; gap: .35rem; border-bottom: 1px solid var(--bord); background: var(--surface); }
.tiroir-ia-sugg > b { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.tiroir-ia .assistant { min-height: 0; grid-template-rows: 1fr auto; padding: .8rem 1rem; overflow: hidden; max-width: none; }
.tiroir-ia .assistant-fil { overflow-y: auto; }
.tiroir-ia .assistant-tableau { max-width: 100%; }
.tiroir-ia .assistant-saisie { position: static; }
@media print { .tiroir-ia, .bandeau-ia { display: none !important; } }

/* « L'Entrepôt intelligent » : une pastille de verre au liseré dégradé qui tourne, une étincelle qui pulse. */
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.intelligent { display: inline-flex; align-items: center; gap: .32em; margin: 0 .15rem; padding: .16em .7em .16em .5em; border: 1.5px solid transparent; border-radius: 999px;
               font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; line-height: 1.2; color: var(--encre);
               background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--angle), #44BFD6, #6b6bff, #ff7ad9, #6b6bff, #44BFD6) border-box;
               box-shadow: 0 0 14px rgb(107 107 255 / .28); animation: intelligent-tourne 4s linear infinite; }
.intelligent .ico { width: 1.1em; height: 1.1em; color: #ff7ad9; filter: drop-shadow(0 0 4px rgb(255 122 217 / .7)); animation: intelligent-pulse 2.2s ease-in-out infinite; }
@keyframes intelligent-tourne { to { --angle: 360deg; } }
@keyframes intelligent-pulse { 0%, 100% { transform: scale(.8) rotate(0); opacity: .75; } 50% { transform: scale(1.2) rotate(20deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .intelligent, .intelligent .ico { animation: none; } }

/* Les nouveautés, en tête d'Aujourd'hui : un message net, une pastille qui brille, un lien si besoin. */
.carte-nouveaute { display: grid; gap: .6rem; border-left: 5px solid var(--accent); background: linear-gradient(100deg, var(--accent-doux), var(--surface) 60%); }
.nouveaute-tete { display: flex; align-items: center; gap: .6rem; }
.nouveaute-pastille { font-size: .68rem; font-weight: 850; letter-spacing: .1em; color: #fff; padding: .18rem .6rem; border-radius: 99px;
                      background: linear-gradient(135deg, var(--accent), #6b6bff); box-shadow: 0 0 12px rgb(107 107 255 / .4); }
.nouveaute { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.nouveaute-texte { flex: 1; min-width: 14rem; }
.nouveaute-texte b { font-size: 1.05rem; }
.nouveaute-texte p { margin: .2rem 0 0; line-height: 1.45; color: var(--encre-2); }
.nouveautes-suite { display: grid; gap: .7rem; padding-top: .5rem; border-top: 1px solid var(--bord); }
.nouveaute-ligne { display: grid; gap: .3rem; }
@media print { .carte-nouveaute { display: none; } }
.carte-nouveaute > .lien-3d { justify-self: start; }
.nouveaute-ligne > .bouton.discret { justify-self: start; padding-left: 0; }

/* La visite en drone, habillée comme un film : bandes cinéma, carton-titre qui s'efface, légende au-dessus de la bande. */
.cine-3d { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.cine-3d[hidden] { display: none; }
.cine-bande { position: absolute; left: 0; right: 0; height: 9%; background: #000; animation: cine-bande 1.4s cubic-bezier(.2,.7,.2,1) both; }
.cine-haut { top: 0; transform-origin: top; }
.cine-bas { bottom: 0; transform-origin: bottom; }
@keyframes cine-bande { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.cine-titre { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: .3rem; color: #fff; text-align: center;
              text-shadow: 0 2px 18px rgb(0 0 0 / .75); animation: cine-titre 5.5s ease both; }
.cine-titre small { font-size: .72rem; font-weight: 800; letter-spacing: .32em; color: #9fe6f2; }
.cine-titre b { font-size: clamp(1.6rem, 4.5vw, 2.8rem); font-weight: 850; letter-spacing: .01em; }
.cine-titre span { font-size: .95rem; opacity: .85; letter-spacing: .04em; }
@keyframes cine-titre { 0% { opacity: 0; transform: translate(-50%, -40%); } 18% { opacity: 1; transform: translate(-50%, -50%); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -56%); } }
.en-visite .legende-visite { bottom: calc(9% + .6rem); }
@media (prefers-reduced-motion: reduce) { .cine-bande, .cine-titre { animation: none; } .cine-titre { display: none; } }

/* Le bord gauche du tiroir de l'IA : on le tire pour élargir. */
.tiroir-ia-poignee { position: absolute; top: 0; bottom: 0; left: -5px; width: 10px; cursor: col-resize; z-index: 3; touch-action: none; }
.tiroir-ia-poignee::after { content: ''; position: absolute; top: 50%; left: 3px; width: 4px; height: 56px; transform: translateY(-50%); border-radius: 4px;
                            background: var(--bord); transition: background .15s, height .15s; }
.tiroir-ia-poignee:hover::after, .tiroir-ia-poignee:focus-visible::after, .tiroir-ia.en-redimension .tiroir-ia-poignee::after { background: var(--accent); height: 96px; }
.tiroir-ia.en-redimension { user-select: none; transition: none; }
@media (max-width: 640px) { .tiroir-ia { width: 100vw !important; } .tiroir-ia-poignee { display: none; } }

/* Le sélecteur du mode IA, en haut : un interrupteur, allumé aux couleurs de l'IA. */
.interrupteur-ia { flex: none; display: inline-flex; align-items: center; gap: .4rem; height: 2.4rem; padding: 0 .7rem 0 .45rem; border-radius: 99px; cursor: pointer;
                   border: 1px solid var(--bord); background: var(--surface); color: var(--encre-2); font-weight: 750; font-size: .78rem; letter-spacing: .06em; }
.interrupteur-ia-piste { position: relative; width: 2.1rem; height: 1.2rem; border-radius: 99px; background: var(--bord); transition: background .2s; }
.interrupteur-ia-bouton { position: absolute; top: .15rem; left: .15rem; width: .9rem; height: .9rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .35);
                          transition: transform .2s cubic-bezier(.3,.7,.3,1); }
.interrupteur-ia.actif { color: var(--encre); border-color: rgb(107 107 255 / .5); }
.interrupteur-ia.actif .interrupteur-ia-piste { background: linear-gradient(135deg, var(--accent), #6b6bff); }
.interrupteur-ia.actif .interrupteur-ia-bouton { transform: translateX(.9rem); }
.interrupteur-ia:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { .interrupteur-ia-mot { display: none; } .interrupteur-ia { padding: 0 .45rem; } }

/* Les nouveautés qu'on glisse pour les ordonner (Administration) : une poignée à gauche, le message soulevé pendant le geste. */
.poignee-ordre { flex: none; display: grid; place-items: center; width: 2rem; height: 2.4rem; margin: -.3rem .2rem -.3rem -.4rem; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--encre-2); cursor: grab; touch-action: none; }
.poignee-ordre svg { width: 18px; height: 18px; stroke-width: 3; }
.poignee-ordre:hover, .poignee-ordre:focus-visible { background: var(--accent-doux); color: var(--accent); }
.liste-ordonnee > li { transition: transform .12s ease; }
.liste-ordonnee > li.en-glisse { position: relative; z-index: 2; transform: scale(1.015); }
.liste-ordonnee > li.en-glisse .item { box-shadow: 0 10px 28px rgb(0 0 0 / .18); background: var(--surface); outline: 2px solid var(--accent); outline-offset: -2px; }
.liste-ordonnee > li.en-glisse .poignee-ordre { cursor: grabbing; color: var(--accent); }

/* Le palettier : des jauges qui préviennent, et la vue de face d'une baie (N4 en haut, une case par position, deux au N4). */
.jauge.attention span { background: var(--attention); }
.jauge.critique span { background: var(--critique); }
.baie-face { display: grid; gap: .45rem; align-items: stretch; margin-top: .6rem; }
.baie-niveau { display: grid; place-items: center; font-weight: 700; color: var(--encre-2); padding-right: .3rem; border-right: 3px solid #e36c2c; }
.baie-position { display: flex; flex-direction: column; gap: .3rem; padding: .4rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--bord);
  border-bottom: 4px solid #e36c2c; min-width: 0; }
.baie-adresse { font-size: .72rem; color: var(--encre-3); }
.baie-palette, .baie-libre { display: grid; gap: .1rem; padding: .45rem .5rem; border-radius: 8px; text-align: left; min-height: 3.1rem; font-size: .82rem; min-width: 0; }
.baie-palette { border: 0; background: var(--marque); color: #fff; cursor: pointer; }
.baie-palette span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .9; }
.baie-palette:hover, .baie-palette:focus-visible { background: var(--marque-fonce); }
.baie-palette.trop { background: var(--critique); cursor: default; }
.baie-libre { border: 1px dashed var(--bord-2); color: var(--encre-3); place-items: center; }

/* ---- Le manutentionnaire à l'iPhone (manutention.js) : une chose par écran, en gros, pour être lue du chariot */
.manut { max-width: 620px; }
.manut-consigne { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-3); text-align: center; }
.manut-titre { margin: 0; font-size: 1.6rem; font-weight: 800; line-height: 1.15; text-align: center; text-wrap: balance; }
.manut-centre { display: flex; justify-content: center; }
.manut-tache, .manut-rang { display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 76px; padding: .75rem .9rem; text-align: left; background: var(--surface);
  border: 1px solid var(--bord-2); border-radius: 16px; color: var(--encre); font: inherit; cursor: pointer; }
.manut-tache:active, .manut-rang:active { transform: scale(.985); }
.manut-tache .nb { flex: none; min-width: 46px; height: 46px; padding: 0 .5rem; border-radius: 14px; background: var(--accent); color: var(--accent-encre); display: grid; place-items: center;
  font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.manut-tache .txt, .manut-rang .txt { flex: 1; min-width: 0; }
.manut-tache .txt b { display: block; font-size: 1.2rem; }
.manut-tache .txt span { display: block; color: var(--encre-2); font-size: .92rem; }
.manut-tache .va { flex: none; color: var(--encre-3); font-size: 1.7rem; line-height: 1; }
.manut-tache.faite { background: var(--ok-doux); border-color: transparent; }
.manut-tache.faite .nb { background: var(--ok); color: #fff; }
.manut-rang .txt b { display: block; font-size: 1.05rem; }
.manut-rang .txt .discret { display: block; font-size: .88rem; }
.manut-rang .pos { flex: none; text-align: right; max-width: 48%; }
.manut-rang .pos b { display: block; font-size: 1.4rem; font-weight: 800; line-height: 1.1; color: var(--accent); white-space: nowrap; }
.manut-rang .pos span { display: block; font-size: .78rem; color: var(--encre-2); }
.manut-rang .pos.sans span { color: var(--attention-encre); font-weight: 600; font-size: .88rem; }
.manut-sku { display: block; font-size: .78rem; font-weight: 600; color: var(--encre-3); }
.manut-adresse { text-align: center; }
.manut-ou { font-weight: 800; font-size: clamp(2.1rem, 12vw, 3.4rem); line-height: 1.05; color: var(--accent); white-space: nowrap; letter-spacing: 0; }
.manut-mots { margin-top: .3rem; font-weight: 600; }
.manut-rack { display: grid; gap: 4px; align-items: center; font-size: .72rem; font-weight: 700; color: var(--encre-3); }
.manut-rack .case { height: 26px; border-radius: 5px; border: 2px solid var(--bord-2); background: var(--surface); }
.manut-rack .case.prise { background-color: var(--surface-3); background-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--bord-2) 5px 6px); }
.manut-rack .case.entamee { background-image: linear-gradient(to top, var(--surface-3) 50%, transparent 50%); }
.manut-rack .case.ici { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
.manut-rack .niv { padding-right: .4rem; text-align: right; }
.manut-rack .pos { text-align: center; }
.manut-rack .legende { grid-column: 1 / -1; text-align: center; font-weight: 600; margin-top: .1rem; }
.bouton.manut-gros { min-height: 72px; font-size: 1.25rem; font-weight: 800; border-radius: 18px; width: 100%; }
.bouton.manut-vert { background: var(--ok); border-color: var(--ok); color: #fff; }
.bouton.manut-choix { justify-content: flex-start; text-align: left; font-weight: 700; }
.manut-bas { position: sticky; bottom: 1rem; z-index: 5; display: flex; flex-direction: column; gap: .5rem; padding-top: 1rem; background: linear-gradient(transparent, var(--page) 1rem); }
.manut-liens { display: flex; justify-content: center; align-items: center; gap: .3rem; flex-wrap: wrap; }
.manut-puces { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.manut-puces button { border: 1px solid var(--bord-2); background: var(--surface); color: var(--encre); border-radius: 999px; min-height: 40px; padding: 0 .9rem; font: inherit;
  font-weight: 600; font-size: .9rem; cursor: pointer; }
.manut-puces button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-encre); }
.manut-contenu { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.manut-contenu li { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.manut-contenu li > span { flex: none; font-size: .88rem; }
.manut-ligne { padding: .6rem 0; border-top: 1px solid var(--bord); }
.manut-ligne:first-of-type { border-top: 0; }
.manut-ligne.en-faute { outline: 2px solid var(--critique); outline-offset: 4px; border-radius: 6px; }
.manut-qte { width: 4.8rem; text-align: right; font-weight: 700; }
.manut-date { margin-top: .4rem; }
.manut-compte { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 2.6rem; font-weight: 800; text-align: center; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.manut-compte.vide { color: var(--bord-2); }
.manut-pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.manut-pave button { min-height: 52px; border: 1px solid var(--bord-2); border-radius: 14px; background: var(--surface); color: var(--encre); font: inherit; font-size: 1.5rem; font-weight: 700; cursor: pointer; }
.manut-pave button:active { background: var(--surface-3); }
.manut-pave button.ok { background: var(--accent); border-color: var(--accent); color: var(--accent-encre); }
.manut-pave button.ok[disabled] { opacity: .45; }
.manut-fin { display: flex; flex-direction: column; align-items: center; gap: .7rem; text-align: center; padding: 2rem 0 1rem; }
.manut-fin .rond { width: 88px; height: 88px; border-radius: 50%; background: var(--ok-doux); color: var(--ok-encre); display: grid; place-items: center; font-size: 2.6rem; font-weight: 800; }
/* Les onglets, et le rond du scanner qui les dépasse : la barre du bas se tient au-dessus. */
@media (max-width: 860px) { .manut-bas { bottom: calc(5.2rem + var(--bas)); } .manut { padding-bottom: 1.5rem; } }

/* ---- L'administration : le bouton d'enregistrement des réglages reste en vue */
.barre-enregistrer { position: sticky; bottom: 1rem; z-index: 5; padding-top: .8rem; background: linear-gradient(transparent, var(--page) .8rem); }
@media (max-width: 860px) { .barre-enregistrer { bottom: calc(5.2rem + var(--bas)); } }
.tuile.critique .valeur { color: var(--critique-encre); }

/* La barre de la 3D : ce qui ne sert pas à lire le plan est sous « ⋯ ». */
.boite-menu-3d { position: relative; flex: none; }
.bouton-plus-3d { min-width: 3rem; font-size: 1.3rem; line-height: 1; letter-spacing: .05em; }
.menu-3d { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 40; display: grid; gap: .25rem; width: min(17rem, calc(100vw - 2rem)); padding: .4rem;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--bord); box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.menu-3d[hidden] { display: none; }
.menu-3d .bouton { width: 100%; justify-content: flex-start; border-color: transparent; background: none; }
.menu-3d .bouton:hover:not(:disabled) { background: var(--accent-doux); }
@media (max-width: 900px) { .menu-3d { right: auto; left: 0; } }

/* Le menu : les groupes repliés (« Suivi », « Réglages »). */
.lateral .titre-nav.pliable { width: calc(100% - .4rem); cursor: pointer; font-family: inherit; text-align: left; text-transform: uppercase; border-top: 0; border-right: 0; border-bottom: 0; }
.lateral .titre-nav.pliable .pli-nom { flex: 1; }
.lateral .titre-nav.pliable .pli-nb { font-size: .7rem; font-weight: 700; padding: 0 .45rem; border-radius: 99px; background: rgba(255,255,255,.12); letter-spacing: 0; }
.lateral .titre-nav.pliable .pli-fleche { transition: transform .15s; font-size: .9rem; }
.lateral .titre-nav.pliable[aria-expanded="false"] .pli-fleche { transform: rotate(-90deg); }
.lateral .titre-nav.pliable[aria-expanded="false"] { margin-bottom: .2rem; }
.lateral .titre-nav.pliable + .groupe-nav + .titre-nav.pliable { margin-top: .5rem; }
.groupe-nav[hidden] { display: none; }

/* La recherche du haut, sur tous les écrans ; et l'écran « Trouver ». */
.trouver-haut { flex: 0 1 19rem; min-width: 11rem; display: flex; align-items: center; gap: .45rem; height: 2.5rem; padding: 0 .9rem; border: 1px solid var(--bord-2); border-radius: 99px;
  background: var(--surface); color: var(--encre-2); }
.trouver-haut:focus-within { border-color: var(--marque-vive); box-shadow: 0 0 0 3px var(--accent-doux); }
.trouver-haut .ico { flex: none; width: 1.05rem; height: 1.05rem; }
.trouver-haut input { flex: 1; min-width: 0; border: 0; background: none; color: var(--encre); font: inherit; font-size: .95rem; outline: none; padding: 0; }
@media (max-width: 1120px) { .signature { display: none; } }
@media (max-width: 860px) { .trouver-haut { display: none; } }
.trouver-barre { display: flex; gap: .6rem; align-items: stretch; }
.trouver-champ { flex: 1; min-width: 0; border: 1px solid var(--bord-2); border-radius: 14px; padding: .8rem 1rem; font-size: 1.1rem; background: var(--surface); color: var(--encre); }
.trouver-champ:focus { outline: none; border-color: var(--marque-vive); box-shadow: 0 0 0 3px var(--accent-doux); }
.trouver-iphone > summary { cursor: pointer; display: flex; align-items: center; gap: .5rem; font-weight: 650; list-style: none; }
.trouver-iphone > summary::-webkit-details-marker { display: none; }
.trouver-iphone > summary::after { content: '▾'; margin-left: auto; color: var(--encre-3); }
.trouver-iphone[open] > summary::after { transform: rotate(180deg); }

/* « À faire », en tête de l'accueil de chaque rôle : les tâches du manutentionnaire, sur deux colonnes au Mac. */
.a-faire { display: grid; gap: .6rem; }
.a-faire .manut-consigne { text-align: left; }
.taches-jour { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.manut-tache.critique .nb { background: var(--critique); color: #fff; }
.manut-tache.critique { border-color: color-mix(in srgb, var(--critique) 45%, var(--bord-2)); }
.manut-tache.attention .nb { background: var(--attention); color: #3b2a00; }
.titre-detail { margin: .6rem 0 0; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-3); }
.carte.montree { box-shadow: 0 0 0 3px var(--marque-vive); transition: box-shadow .2s; }

/* Un message qui porte un geste (« Annuler »). */
.message.avec-action { display: flex; align-items: center; gap: .8rem; }
.message-action { margin-left: auto; flex: none; border: 1.5px solid currentColor; background: none; color: inherit; border-radius: 99px; padding: .3rem .9rem; font: inherit; font-weight: 700; cursor: pointer; }
/* À la réception : une date approchée, d'un toucher. */
.puces-date { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.puces-date .puce { min-height: 34px; padding: .2rem .7rem; font-size: .85rem; }

/* Le scanner : le code lu se cerne un instant ; le zoom de l'objectif. */
.scanner .contour-lu { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .25s; }
.scanner .contour-lu.vu { opacity: 1; transition: none; }
.scanner .contour-lu polygon { fill: rgba(61,220,82,.22); stroke: #3ddc52; stroke-width: 4; stroke-linejoin: round; }
.scanner .zoom-scan { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3rem; }
.scanner .photo-scan { min-width: 4.2rem; }
.scanner .pave .ecoute-ligne { display: flex; align-items: center; gap: .6rem; margin: .1rem 0 .5rem; min-height: 44px; }
.scanner .pave .micro-scan { flex: none; width: 44px; height: 44px; border: 0; border-radius: 99px; background: rgba(255,255,255,.15); color: #fff; font-size: 1.2rem; cursor: pointer; }
.scanner .pave .ecoute { flex: 1; color: #9fb3b9; font-size: .92rem; line-height: 1.25; }
.scanner .pave .ecoute.en-cours { color: #8be3a0; }
.scanner .pave .ecoute.en-cours::before { content: '● '; animation: ecoute-pouls 1s ease-in-out infinite; }
@keyframes ecoute-pouls { 50% { opacity: .25; } }

/* Dans « Réglages » : l'affichage, les mesures et la sortie, qui étaient au pied du menu. */
.reglages-nav { display: grid; gap: .3rem; margin: .5rem .2rem .2rem; padding-top: .6rem; border-top: 1px solid rgba(255,255,255,.08); }
.reglages-nav-titre { font-size: .8rem; color: var(--lateral-encre-2); margin: .3rem .45rem 0; }
.reglages-nav .lien-nav { margin-top: .4rem; }

.trouver-choix { flex: 0 1 13rem; min-width: 8rem; border: 1px solid var(--bord-2); border-radius: 14px; padding: 0 .8rem; font-size: 1rem; background: var(--surface); color: var(--encre); }
@media (max-width: 640px) { .trouver-barre { flex-wrap: wrap; } .trouver-champ { flex: 1 1 100%; } .trouver-choix { flex: 1 1 8rem; } }

/* Le scanner : le code pressenti (avant l'appui) en pointillé ; la question de la date, après le compte. */
.scanner .contour-lu.pressenti polygon { fill: rgba(68,191,214,.12); stroke: #9fe6f5; stroke-width: 3; stroke-dasharray: 9 7; }
.scanner .pave .date-scan input { width: 100%; min-height: 54px; margin: .4rem 0; padding: .4rem .8rem; border: 0; border-radius: 10px; background: #fff; color: #111; font-size: 1.35rem; font-weight: 700; }
.scanner .pave .raccourcis { grid-template-columns: repeat(4, 1fr); margin-bottom: .1rem; }
.scanner .pave .raccourcis button { font-size: 1rem; min-height: 46px; }

/* Le point du matin, en tête de l'accueil. */
.carte-point { border-left: 4px solid var(--marque-vive); }
.carte-point.replie { padding: .5rem 1rem; border-left-width: 2px; }
.point-phrases { list-style: none; margin: .6rem 0 .2rem; padding: 0; display: grid; gap: .25rem; }
.point-phrases li { border-left: 3px solid var(--bord-2); padding-left: .7rem; }
.point-phrases li.critique { border-left-color: var(--critique); }
.point-phrases li.attention { border-left-color: var(--attention); }
.point-phrases li.ok { border-left-color: var(--ok); }
.point-phrase { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .35rem 0; border: 0; background: none; color: var(--encre); font: inherit; text-align: left; }
button.point-phrase { cursor: pointer; }
button.point-phrase:hover span:first-child { text-decoration: underline; }
.point-phrase span:first-child { flex: 1; }
.point-phrase .va { color: var(--encre-3); font-size: 1.3rem; }
/* Dicter une ligne d'arrivage. */
.dictee-champ { width: 100%; font-size: 1.2rem; padding: .7rem .9rem; border: 1px solid var(--bord-2); border-radius: 12px; background: var(--surface); color: var(--encre); resize: vertical; }
.dictee-ligne { display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; align-items: baseline; padding: .7rem .9rem; border: 1px dashed var(--bord-2); border-radius: 12px; }
.dictee-ligne.ok { border-style: solid; border-color: var(--ok); background: var(--ok-doux); }
.dictee-ligne b { font-size: 1.1rem; }

/* Le menu : le dernier groupe ouvert se lit jusqu'au bout, bandeau d'essai compris. */
.lateral { padding-bottom: 3rem; }

/* Le scanner : dicter la quantité ou la date, au micro du clavier. */
.scanner .pave .dicte-scan { width: 100%; min-height: 44px; margin: .2rem 0 .4rem; padding: .3rem .8rem; border: 1px solid #3a3a3a; border-radius: 10px; background: #1b1b1b; color: #fff; font-size: 16px; }
.scanner .pave .dicte-scan::placeholder { color: #9fb3b9; }

/* La 3D qui sert au travail : ce qu'il y a à faire aujourd'hui, sur le plan ; les raccourcis de vue. */
.travaux-3d { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr)); gap: .4rem; margin: .5rem 0; }
.travail-3d { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 1px solid var(--bord-2); border-radius: 12px; background: var(--surface); color: var(--encre); font: inherit; text-align: left; cursor: pointer; }
.travail-3d b { flex: none; min-width: 2rem; height: 2rem; padding: 0 .35rem; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3, var(--bord)); font-variant-numeric: tabular-nums; }
.travail-3d span { font-size: .88rem; line-height: 1.15; }
.travail-3d.critique b { background: var(--critique); color: #fff; }
.travail-3d.attention b { background: var(--attention); color: #3b2a00; }
.travail-3d.choisi { border-color: var(--marque-vive); box-shadow: 0 0 0 2px var(--accent-doux); }
.liste-travail-3d .item { padding: .45rem .2rem; }
.liste-travail-3d .va { color: var(--encre-3); font-size: 1.2rem; }
.raccourcis-3d { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.raccourcis-3d .puce { min-height: 34px; padding: .2rem .8rem; font-size: .88rem; }

.manut-depuis { margin: 0; padding: .6rem .8rem; border-radius: 12px; background: var(--attention-doux); color: var(--attention-encre); text-align: center; font-size: 1.05rem; }
.manut-depuis b { font-size: 1.3rem; }

/* Administration : pousser le bac à sable à la démonstration. */
.carte-livraison { border-left: 4px solid var(--marque-vive); }
.changements { margin: .4rem 0 .8rem; padding-left: 1.3rem; display: grid; gap: .3rem; }
.changements li span { color: var(--encre-2); }

.reglages-nav-case { display: flex; align-items: center; gap: .5rem; padding: .5rem .2rem; font-size: .92rem; cursor: pointer; }

.modale .ecoute-ligne { display: flex; align-items: center; gap: .6rem; min-height: 44px; }
.modale .micro-scan { flex: none; width: 44px; height: 44px; border: 1px solid var(--bord-2); border-radius: 99px; background: var(--surface); font-size: 1.2rem; cursor: pointer; }
.modale .ecoute { flex: 1; font-size: .92rem; line-height: 1.25; }
.modale .ecoute.en-cours { color: var(--ok-encre); }
.modale .ecoute.en-cours::before { content: '● '; animation: ecoute-pouls 1s ease-in-out infinite; }

/* La barre du haut sur un écran moyen (Bernard, 2026-10-03 : à 1 400 px, « Messages » sortait de l'écran depuis les
   interrupteurs IA et FR/EN). Elle cède par paliers : la signature, puis les mots de Messages (l'icône et son chiffre
   restent ; le nom de qui nous nomme aussi) et le titre de la personne, puis les mots des interrupteurs. */
/* Le nom et son badge « intelligent » restent : c'est là que l'interrupteur IA se voit (Bernard, 2026-10-03 : « le
   sélecteur IA ne déclenche pas intelligent » — caché avec la signature, il ne changeait plus rien en haut). */
@media (max-width: 1700px) { .signature > :not(.sig-version) { display: none; } }
@media (max-width: 1500px) {
  .bouton-chat:not(.alerte) { width: 2.4rem; padding: 0; }
  .bouton-chat:not(.alerte) .chat-mot { display: none; }
  .qui-texte span { display: none; }
  .barre { gap: .55rem; }
}
@media (max-width: 1250px) {
  .interrupteur-ia:not(.interrupteur-langue) .interrupteur-ia-mot { display: none; }
  .interrupteur-langue .langue-mot:not(.allume) { display: none; }
}
/* Le titre de l'écran garde toujours un peu de place : c'est la recherche qui rétrécit avant lui. */
.barre h1 { min-width: 6.5rem; }
@media (max-width: 1500px) { .trouver-haut { min-width: 8.5rem; } }

/* « Toutes les palettes » / « Tout cocher » : en tête de la liste des palettes à envoyer (3D, Envoyer). */
.tout-envoi { display: flex; align-items: center; gap: .55rem; padding: .45rem .2rem; font-weight: 650; cursor: pointer; }
.tout-envoi input { width: 1.2rem; height: 1.2rem; }

/* Les préférences de la personne (langue, mode IA), dans le menu sous son nom. */
.qui-reglage { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .35rem .7rem; font-size: .92rem; }
.qui-reglage .interrupteur-ia { height: 2.1rem; }

/* « Mot de passe oublié ? », sous le bouton d'entrée ; et, dans Comptes, le bouton du mot de passe provisoire à côté du compte. */
.lien-oubli { align-self: center; background: none; border: 0; padding: .3rem .5rem; color: var(--accent); font: inherit; font-size: .92rem; cursor: pointer; }
.lien-oubli:hover { text-decoration: underline; }
.compte-ligne { display: flex; align-items: center; gap: .6rem; }
.compte-ligne .item { flex: 1; min-width: 0; }
.compte-ligne > .bouton { flex: none; }
.secret { padding: .5rem .7rem; border: 1px dashed var(--bord-2); border-radius: 8px; font-size: 1.1rem; user-select: all; }

/* ------------------------------------------------------------------ la visite guidée (visite.js)
   Un voile qui arrête les touchers, un halo qui laisse voir le repère (le reste s'assombrit par son ombre), et la bulle. */
.visite { position: fixed; inset: 0; z-index: 400; }
.visite-halo { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgb(4 10 14 / .68), 0 0 0 3px var(--marque-vive), 0 0 24px 4px rgb(68 191 214 / .45);
  transition: left .28s ease, top .28s ease, width .28s ease, height .28s ease; pointer-events: none; }
.visite-halo.centre { left: 50%; top: 50%; width: 0; height: 0; box-shadow: 0 0 0 9999px rgb(4 10 14 / .68); }
.visite-bulle { position: fixed; width: min(23rem, calc(100vw - 1.5rem)); padding: 1rem 1.1rem 1rem; border-radius: 16px; background: var(--surface); color: var(--encre);
  border: 1px solid var(--bord-2); box-shadow: 0 18px 50px rgb(0 0 0 / .45); transition: left .28s ease, top .28s ease; }
.visite-bulle.centre { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(26rem, calc(100vw - 1.5rem)); padding: 1.4rem 1.4rem 1.2rem; text-align: center; }
.visite-bulle.centre .visite-pied { justify-content: center; flex-direction: column; gap: .9rem; }
.visite-tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; }
.visite-compte { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.visite-passer { background: none; border: 0; padding: .2rem .1rem; font: inherit; font-size: .82rem; color: var(--encre-2); cursor: pointer; }
.visite-passer:hover { color: var(--encre); text-decoration: underline; }
.visite-titre { margin: 0 0 .35rem; font-size: 1.15rem; line-height: 1.25; }
.visite-bulle.centre .visite-titre { font-size: 1.4rem; margin-bottom: .5rem; }
.visite-texte { margin: 0; font-size: .97rem; line-height: 1.5; color: var(--encre-2); }
.visite-pied { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.visite-pied .rangee { gap: .5rem; flex-wrap: nowrap; }
.visite-pas { display: flex; gap: .3rem; }
.visite-pas span { width: .45rem; height: .45rem; border-radius: 50%; background: var(--bord-2); }
.visite-pas span.vu { background: var(--accent); opacity: .45; }
.visite-pas span.ici { background: var(--accent); width: 1.1rem; border-radius: 99px; }
.visite-fleche { position: absolute; width: 14px; height: 14px; background: var(--surface); border: 1px solid var(--bord-2); transform: rotate(45deg); margin: -7px 0 0 -7px; }
.visite-fleche.bas { top: 0; border-right: 0; border-bottom: 0; }
.visite-fleche.haut { top: 100%; border-left: 0; border-top: 0; }
.visite-fleche.droite { left: 0; border-right: 0; border-top: 0; }
.visite-fleche.gauche { left: 100%; border-left: 0; border-bottom: 0; }
.visite-fleche[hidden] { display: none; }
.visite :focus-visible { outline: 2px solid var(--marque-vive); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .visite-halo, .visite-bulle { transition: none; } }

/* Un lien dans le menu de la personne (le simulateur) : comme ses boutons. */
a.qui-choix { text-decoration: none; box-sizing: border-box; }

/* Une action principale par écran : les autres boutons d'action restent à la couleur de l'accent, en contour. */
.bouton.primaire.seconde { background: transparent; color: var(--accent); border-color: var(--accent); }
.bouton.primaire.seconde:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); filter: none; }
.bouton.choisi { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* La visite change d'écran : la bulle et le halo s'effacent le temps que l'écran se dessine, le voile reste. */
.visite.attente .visite-bulle { visibility: hidden; }
.visite.attente .visite-halo { left: 50%; top: 50%; width: 0; height: 0; box-shadow: 0 0 0 9999px rgb(4 10 14 / .68); }
.visite[hidden] { display: none; }
.visite-bulle.centre .visite-pied .rangee { justify-content: center; flex-wrap: wrap; }

/* Envoyer à ANV : dans une palette cochée par son produit, la ligne de ce produit ressort. */
.contenu-palette li.du-produit > span:first-child { font-weight: 700; color: var(--accent); }

/* Le plan : l'état des produits de chaque section, et les sections sans l'état choisi qui s'estompent. */
.etats-section { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; }
.etats-section .pastille { font-size: .68rem; padding: .08rem .4rem; }
.section-tuile.estompe { opacity: .3; }

/* La visite par chapitres : la bienvenue et la fin sont plus larges, avec leurs chapitres ou leurs premiers gestes. */
.visite-bulle.large.centre { width: min(34rem, calc(100vw - 1.5rem)); }
.visite-compte { display: flex; align-items: baseline; gap: .5rem; }
.visite-rang { color: var(--encre-2); font-weight: 600; letter-spacing: .04em; }
.visite-plus { margin-top: .9rem; }
.visite-plus[hidden] { display: none; }
.visite-chapitres { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.visite-chapitres .puce { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; }
.visite-chapitres .puce b { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--accent); color: var(--accent-encre); font-size: .72rem; }
.visite-gestes { display: grid; gap: .45rem; }
.visite-pas button { width: .55rem; height: .55rem; padding: 0; border: 0; border-radius: 50%; background: var(--bord-2); cursor: pointer; }
.visite-pas button.vu { background: var(--accent); opacity: .45; }
.visite-pas button.ici { background: var(--accent); width: 1.3rem; border-radius: 99px; }
.visite-pas button:hover { opacity: 1; background: var(--accent); }

/* La question de la date après un scan : le calendrier a son nom, les raccourcis disent qu'ils estiment. */
.date-scan { display: block; }
.date-scan-titre { display: block; font-size: .82rem; font-weight: 600; color: rgb(255 255 255 / .82); margin: .15rem 0 .3rem; }
