/* Tâche Libre — « Bureau » (décembre 2026). Chargé en dernier, par-dessus app, plus, agenda, verre et raffine.
   Un bureau rangé : une colonne d'encre à gauche, un plan de travail clair, des feuilles blanches, des chemises de couleur
   par type d'expéditeur, le bleu stylo pour ce qui engage, le jaune surligneur pour l'essentiel lu par l'IA.
   Pour revenir au design précédent : retirer la ligne bureau.css de index.html. */

/* ================= Jetons ================= */
:root {
  --police: "Geist", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --titre: var(--police);

  --bureau: #eef0f4;          /* plan de travail */
  --bureau-2: #e4e7ee;        /* rainures (pistes, onglets) */
  --papier: #ffffff;
  --papier-2: #f6f7fa;        /* remplissage discret dans une feuille */
  --encre: #12152b;
  --encre-2: #474d66;
  --encre-3: #646a82;
  --trait: rgba(18, 21, 43, .09);
  --trait-fort: rgba(18, 21, 43, .15);
  --rail: #0b1238;            /* colonne de gauche : le bleu nuit du panel admin du site */
  --rail-survol: rgba(255, 255, 255, .07);
  --rail-texte: rgba(255, 255, 255, .7);
  --rail-faible: rgba(255, 255, 255, .45);

  --stylo: #2b3de0;           /* ce qui engage : valider, envoyer, l'action principale */
  --stylo-fonce: #1f2fc2;
  --stylo-doux: #eceefe;
  --surligneur: rgba(255, 210, 48, .5);
  --rouge: #d93a31;  --rouge-doux: #fde7e5;
  --vert: #16865a;   --vert-doux: #ddf3e8;
  --ambre: #a8620a;  --ambre-doux: #fff1d6;

  /* Chemises : une teinte par type d'expéditeur (fond, encre) */
  --ch-ciel: #e1edff;      --ch-ciel-e: #1c4fa6;
  --ch-lilas: #eee6ff;     --ch-lilas-e: #5a34b6;
  --ch-eau: #ddf3e8;       --ch-eau-e: #12704a;
  --ch-paille: #fff0cc;    --ch-paille-e: #865600;
  --ch-abricot: #ffe6d6;   --ch-abricot-e: #a2451a;
  --ch-rose: #fde4ee;      --ch-rose-e: #9f2a5d;
  --ch-gris: #eceef3;      --ch-gris-e: #4f5670;
  --ch-rouge: #ffe3e0;     --ch-rouge-e: #b0241a;
  --ch-stylo: #e6e9ff;     --ch-stylo-e: #2433b8;

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 24px;
  --ombre-1: 0 1px 2px rgba(18, 21, 43, .05), 0 2px 8px -2px rgba(18, 21, 43, .06);
  --ombre-2: 0 1px 2px rgba(18, 21, 43, .05), 0 14px 34px -18px rgba(18, 21, 43, .22);
  --ombre-3: 0 2px 6px rgba(18, 21, 43, .06), 0 30px 70px -28px rgba(18, 21, 43, .38);
  --ombre-feuille: var(--ombre-2);
  --carte: var(--ombre-1);

  /* Mouvement : courbes fortes, durées courtes */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-tiroir: cubic-bezier(.32, .72, 0, 1);
  --courbe: var(--ease-out);

  /* Ce que le design précédent appelait verre : du papier, sans flou */
  --verre: #fff; --verre-fort: #fff; --verre-leger: rgba(255, 255, 255, .7);
  --flou: none;
  --reflet: linear-gradient(transparent, transparent);
  --ombre-verre: var(--ombre-2);
  --ombre-douce: var(--ombre-1);
  --scene: var(--papier-2);
  --halo: 0 8px 20px -10px rgba(43, 61, 224, .7);

  --hauteur-titre: 56px;
  --colonne: 244px;
  --boutons-fenetre: 156px;  /* réduire, agrandir, fermer (Windows) */
  color-scheme: light;
}

/* ================= Fond, texte, éléments du navigateur ================= */
body {
  background: var(--bureau); color: var(--encre);
  font: 14.5px/1.5 var(--police);
  font-feature-settings: normal; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.aurore, body::after { display: none !important; }
button, input, textarea, select { font-family: inherit; }
input, textarea { caret-color: var(--stylo); }
::selection { background: rgba(43, 61, 224, .18); color: inherit; }
:focus-visible { outline: 2px solid var(--stylo); outline-offset: 2px; border-radius: 8px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--stylo); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(18, 21, 43, .16); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(18, 21, 43, .3); }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-corner { background: transparent; }
.petit { color: var(--encre-3); }
strong, b { font-weight: 650; }
a { color: var(--stylo); text-underline-offset: 3px; }

/* ================= La colonne d'encre (navigation) ================= */
.barre-titre {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: var(--colonne); height: auto;
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
  padding: 16px 12px 12px; overflow: hidden auto;
  background: radial-gradient(120% 40% at 0% 0%, rgba(43, 61, 224, .35), rgba(43, 61, 224, 0) 70%), var(--rail); color: var(--rail-texte);
  backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none;
  -webkit-app-region: drag; scrollbar-width: none;
}
.barre-titre::-webkit-scrollbar { display: none; }
/* Le logo, comme sur le panel admin du site : le nom en grand (Poppins 800, la lettre du logo),
   la vraie coche en filigrane blanc derrière, sur le bleu nuit avec une lueur dans l'angle */
.marque { position: relative; isolation: isolate; display: grid; justify-items: center; gap: 8px; min-width: 0; padding: 4px 4px 18px; flex: none; }
.marque .logo-symbole {
  position: absolute; z-index: 0; left: 50%; top: 36px; width: auto; height: 82px; padding: 0; translate: -50% -50%;
  border-radius: 0; background: none; box-shadow: none; filter: brightness(0) invert(1); opacity: .3; pointer-events: none;
  transition: opacity .3s ease, transform .5s var(--ease-out);
}
.marque .nom { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; height: 64px; color: #fff; font: 800 27px/1 "Poppins", var(--police); letter-spacing: -.05em; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .marque:hover .logo-symbole { opacity: .42; transform: rotate(-6deg) scale(1.06); } }
.marque .client { position: relative; z-index: 1; padding: 0; border: 0; color: var(--rail-faible); font-size: 12.5px; line-height: 1.35; text-align: center; white-space: normal; }
.marque .client:empty { display: none; }
/* Sélecteur d'entreprise (administrateur) : sombre, net, sans anneau bleu resté collé après un clic */
.barre-titre .selecteur-entreprise {
  position: relative; z-index: 1; width: 100%; max-width: none; height: 40px; margin: 2px 0 0; padding: 0 34px 0 38px !important; border: 0; border-radius: 12px;
  -webkit-app-region: no-drag; color: #fff; font: 600 13.5px/40px var(--police); letter-spacing: -.01em; text-overflow: ellipsis; cursor: pointer;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9c3ff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21V6.5A1.5 1.5 0 0 1 5.5 5H13v16M13 9h5.5A1.5 1.5 0 0 1 20 10.5V21M2.5 21h19M7.5 9h2M7.5 13h2M7.5 17h2M16 13h1M16 17h1'/%3E%3C/svg%3E") 12px 50% / 17px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.7' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") calc(100% - 11px) 50% / 16px no-repeat,
    rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  transition: background-color .15s ease, box-shadow .15s ease;
}
.barre-titre .selecteur-entreprise:hover { background-color: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.barre-titre .selecteur-entreprise:focus, .barre-titre .selecteur-entreprise:focus-visible { outline: none; border: 0; background-color: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.barre-titre .selecteur-entreprise:focus-visible { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 0 0 3px rgba(185, 195, 255, .35); }
.selecteur-entreprise option { color: var(--encre); background: #fff; font-weight: 500; }

/* Onglets principaux, empilés ; la pastille blanche glisse jusqu'à l'onglet ouvert */
.onglets {
  position: relative; flex: none; display: flex; flex-direction: column; gap: 2px;
  margin: 0; padding: 0; background: none; border-radius: 0; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none; -webkit-app-region: no-drag;
}
.onglets a, .menu-plus a {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 10px 0 12px; border-radius: 13px;
  color: var(--rail-texte); text-decoration: none; font-size: 14px; font-weight: 550; letter-spacing: -.01em;
  transition: color .18s ease, background-color .18s ease;
}
.onglets a svg, .menu-plus a svg { width: 19px; height: 19px; flex: none; opacity: 1; padding: 0; border-radius: 0; background: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.onglets a span, .menu-plus a span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; font-size: 14px; }
.onglets a:hover, .menu-plus a:hover { color: #fff; background: var(--rail-survol); }
.onglets a.actif, .onglets a.actif:hover { color: var(--encre); background: transparent; }
.curseur {
  position: absolute; z-index: 0; left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 0;
  border-radius: 13px; background: #fff; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .7);
  transition: transform .32s var(--ease-out), height .32s var(--ease-out), opacity .2s ease;
}
.onglets b, .menu-plus a b, .volet-menu b, .sous-onglets b {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; background: #ff5a4f; color: #fff; box-shadow: none;
  font-size: 11.5px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
:is(.onglets, .menu-plus a, .volet-menu, .sous-onglets) b:empty { display: none; }
/* Entrée qui réunit plusieurs pages : une petite flèche */
:is(.onglets, .menu-plus) a[data-multi]::after { content: ""; flex: none; width: 6px; height: 6px; margin: 0 4px 0 auto; border: solid currentColor; border-width: 1.7px 1.7px 0 0; rotate: 45deg; opacity: .4; transition: opacity .18s ease; }
:is(.onglets, .menu-plus) a[data-multi]:has(b:not(:empty))::after { margin-left: 0; }
:is(.onglets, .menu-plus) a[data-multi]:hover::after { opacity: .9; }
/* Son volet, à côté du menu */
.volet-menu {
  position: fixed; inset: auto; margin: 0; padding: 6px; min-width: 196px; border: 0; border-radius: 16px;
  background: var(--papier); color: var(--encre); box-shadow: 0 0 0 1px var(--trait), var(--ombre-3);
}
.volet-menu:popover-open { display: grid; gap: 2px; animation: menu-in .14s var(--ease-out); transform-origin: left top; }
.volet-menu p { display: none; margin: 0; padding: 6px 12px 4px; color: var(--encre-3); font-size: 12.5px; font-weight: 600; }
.volet-menu a {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 11px;
  color: var(--encre-2); font-size: 14px; font-weight: 550; letter-spacing: -.01em; text-decoration: none; white-space: nowrap;
}
.volet-menu a:hover { background: var(--bureau); color: var(--encre); }
.volet-menu a[aria-current] { background: var(--stylo-doux); color: var(--stylo); }
.volet-menu svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Les autres pages (autrefois dans « Plus ») : toujours visibles, sous un filet */
.barre-titre .menu-plus, .barre-titre .menu-plus[hidden] {
  position: static !important; display: flex !important; flex-direction: column; flex: 1 0 auto; gap: 2px;
  width: auto; margin: 10px 0 0; padding: 10px 0 0; top: auto !important; left: auto !important;
  border-top: 1px solid rgba(255, 255, 255, .08); border-radius: 0;
  background: none; box-shadow: none; -webkit-app-region: no-drag; animation: none;
}
.menu-plus a { display: flex; grid-template-columns: none; }
.menu-plus a[hidden] { display: none; }
.menu-plus a small { display: none; }
.menu-plus a.actif, .menu-plus a.actif:hover { color: var(--encre); background: #fff; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .7); }
.menu-plus a:focus-visible { outline: 2px solid #aab2ff; outline-offset: -2px; background: var(--rail-survol); }

/* Animations (seulement si Windows les a coupées) et taille de l'affichage, en bas de la colonne */
.choix-animations {
  margin-top: auto; padding: 12px 4px 4px; border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer;
  color: var(--rail-faible); font-size: 12px; font-weight: 550;
}
.choix-animations[hidden] { display: none; }
.choix-animations .interrupteur input { background: rgba(255, 255, 255, .16); }
.choix-animations .interrupteur input:checked { background: var(--stylo); }
.menu-plus-zoom {
  margin-top: auto; padding: 12px 4px 0; border-top: 1px solid rgba(255, 255, 255, .08);
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
.choix-animations:not([hidden]) + .menu-plus-zoom { margin-top: 0; border-top: 0; padding-top: 6px; }
.menu-plus-zoom > span { color: var(--rail-faible); font-size: 12px; font-weight: 550; }
.zoom-btns { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 4px; }
.zoom-btns button {
  min-width: 30px; height: 28px; padding: 0 8px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .07); color: #fff; font: 600 13px/1 var(--police);
  transition: background-color .15s ease, transform .12s var(--ease-out);
}
.zoom-btns button:hover { background: rgba(255, 255, 255, .14); }
.zoom-btns button:active { transform: scale(.95); }
#zoom-reset { min-width: 54px; font-size: 12px; font-variant-numeric: tabular-nums; }

/* ================= Bande du haut (déplacer la fenêtre) ================= */
.zone-fenetre {
  position: fixed; z-index: 20; top: 0; left: var(--colonne); right: 0; height: var(--hauteur-titre);
  display: flex; align-items: center; gap: 12px; padding: 0 calc(var(--boutons-fenetre) + 6px) 0 28px;
  background: var(--bureau); -webkit-app-region: drag; pointer-events: auto;
}
body.non-connecte .zone-fenetre { visibility: hidden; }
/* Pages de la rubrique ouverte, en onglets */
.sous-onglets { flex: none; display: flex; gap: 3px; margin-left: -10px; -webkit-app-region: no-drag; }
.sous-onglets[hidden] { display: none; }
.sous-onglets a {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 15px; border-radius: 999px;
  color: var(--encre-3); font-size: 14px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}
.sous-onglets a:hover { color: var(--encre); background: rgba(18, 21, 43, .05); }
.sous-onglets a[aria-current] { color: var(--encre); background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait); }
.sous-onglets b { margin-left: 0; min-width: 19px; height: 19px; font-size: 11px; }
/* À droite, avant « À jour ». Ce qui n'a pas la place passe à la ligne, donc disparaît en entier */
.salut { flex: 1 1 0; min-width: 0; height: 20px; margin: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; gap: 0 8px; overflow: hidden; white-space: nowrap; line-height: 20px; }
.salut::before { content: ""; height: 20px; }
.salut strong { font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; color: var(--encre); }
.salut span { color: var(--encre-3); font-size: 13.5px; }
.salut span::first-letter { text-transform: uppercase; }

/* État de la synchronisation et compte : en haut à droite, avant les boutons Windows */
.etat-synchro {
  flex: 0 1 auto; min-width: 36px; max-width: 380px; height: 36px; margin-left: auto;
  display: flex; align-items: center; gap: 8px; padding: 0 14px 0 12px; border-radius: 999px; border: 0;
  background: var(--papier); color: var(--encre-2); box-shadow: inset 0 0 0 1px var(--trait);
  font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  -webkit-app-region: no-drag; transition: box-shadow .15s ease, color .15s ease;
}
.etat-synchro:hover { color: var(--encre); background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.etat-synchro #texte-synchro { overflow: hidden; text-overflow: ellipsis; }
.point { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #b4b9c9; box-shadow: none; }
.point.ok { background: var(--vert); box-shadow: 0 0 0 3px var(--vert-doux); }
.point.erreur { background: var(--rouge); box-shadow: 0 0 0 3px var(--rouge-doux); }
.point.travail { background: var(--stylo); animation: battement 1s ease-in-out infinite alternate; }
@keyframes battement { from { box-shadow: 0 0 0 0 rgba(43, 61, 224, .35); } to { box-shadow: 0 0 0 5px rgba(43, 61, 224, 0); } }
.avatar-compte {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--encre); color: #fff; font: 700 12.5px/1 var(--police); letter-spacing: .01em;
  box-shadow: 0 0 0 3px var(--bureau), 0 0 0 4px var(--trait); -webkit-app-region: no-drag;
  transition: transform .14s var(--ease-out), box-shadow .15s ease;
}
.avatar-compte:hover { box-shadow: 0 0 0 3px var(--bureau), 0 0 0 4px var(--stylo); }
.avatar-compte:active { transform: scale(.95); }
.menu-compte {
  position: fixed; z-index: 40; top: 54px; right: calc(var(--boutons-fenetre) + 6px); left: auto;
  min-width: 250px; padding: 6px; border-radius: 16px; background: var(--papier);
  box-shadow: 0 0 0 1px var(--trait), var(--ombre-3);
  transform-origin: top right; animation: menu-in .18s var(--ease-out);
}
.menu-tete { padding: 10px 12px 10px; border-bottom: 1px solid var(--trait); margin-bottom: 4px; }
.menu-tete strong { display: block; font-size: 14px; color: var(--encre); }
.menu-tete span { display: block; font-size: 12.5px; color: var(--encre-3); }
.menu-compte button { padding: 9px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--encre); transition: background-color .12s ease; }
.menu-compte button:hover { background: var(--papier-2); }
.menu-compte button[data-menu="deconnexion"] { color: var(--rouge); }

/* ================= Zone de travail ================= */
main {
  position: fixed; z-index: 1; top: var(--hauteur-titre); left: var(--colonne); right: 0; bottom: 0;
  height: auto; margin: 0;
}
.page { height: 100%; overflow: auto; animation: apparition .22s var(--ease-out); }
@keyframes apparition { from { opacity: 0; transform: translateY(6px); } }
/* Pages alignées à gauche, dans l'axe de la salutation : le contenu ne flotte pas au milieu des grands écrans */
.page-large { padding: 6px 40px 48px 28px; }
.page-large > * { max-width: 1180px; margin-left: 0; margin-right: auto; }
.page-tete { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
h1, .page-tete h1, #agenda-titre { font-family: var(--police); font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -.035em; color: var(--encre); margin: 6px 0 0; }
.page-large > .chapeau, .chapeau { color: var(--encre-2); font-size: 14.5px; line-height: 1.55; }
/* Le texte d'introduction garde le bord gauche du contenu, sur 80 caractères au plus */
.page-large > .chapeau { max-width: min(1180px, 80ch); margin: -4px auto 22px 0; }
.bloc .chapeau { max-width: 80ch; }
.page-tete input[type=search] { width: min(360px, 100%); }

/* ================= Commandes ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 17px; border-radius: 999px; white-space: nowrap; max-width: 100%;
  border: 0; background: var(--papier); color: var(--encre);
  box-shadow: inset 0 0 0 1px var(--trait-fort);
  font: 600 13.5px/1 var(--police); letter-spacing: -.01em; cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease, color .15s ease, transform .12s var(--ease-out);
}
.btn:hover { background: var(--papier-2); box-shadow: inset 0 0 0 1px rgba(18, 21, 43, .22); border-color: transparent; }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: progress; transform: none; }
.btn.signer { background: var(--stylo); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, var(--halo); padding: 0 20px; font-size: 14px; border-radius: 999px; }
.btn.signer:hover { background: var(--stylo-fonce); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 10px 24px -10px rgba(43, 61, 224, .8); }
.btn.encre { background: var(--encre); color: #fff; box-shadow: none; }
.btn.encre:hover { background: #262a4a; box-shadow: none; }
.btn.fantome { background: transparent; box-shadow: none; color: var(--encre-2); }
.btn.fantome:hover { background: rgba(18, 21, 43, .06); color: var(--encre); box-shadow: none; }
.btn.mini { height: 32px; padding: 0 13px; font-size: 12.5px; border-radius: 999px; }
.btn.large { height: 46px; padding: 0 24px; font-size: 15px; }
.btn.rouge, .zone-danger .btn { color: var(--rouge); }
kbd { margin-left: 4px; padding: 3px 5px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .18); color: inherit; opacity: 1; font: 600 11px/1 var(--police); }

/* Sélecteur en pilules (filtres, vues, onglets d'une page) */
.filtres, .onglets-page {
  display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 2px; width: fit-content; max-width: 100%;
  padding: 4px; border-radius: 999px; background: var(--bureau-2); box-shadow: none;
  overflow-x: auto; scrollbar-width: none;
}
.filtres::-webkit-scrollbar, .onglets-page::-webkit-scrollbar { display: none; }
.filtres button, .onglets-page button {
  flex: none; height: 30px; padding: 0 13px; border: 0; border-radius: 999px; background: transparent;
  color: var(--encre-2); font: 600 13px/1 var(--police); letter-spacing: -.01em; white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.filtres button:hover, .onglets-page button:hover { background: rgba(255, 255, 255, .65); color: var(--encre); }
.filtres button.actif, .filtres button.actif:hover, .onglets-page button.actif, .onglets-page button.actif:hover {
  background: var(--encre); color: #fff; box-shadow: 0 6px 14px -8px rgba(18, 21, 43, .7);
}

/* Champs */
.champ > span { font-size: 13px; font-weight: 600; color: var(--encre-2); margin-bottom: 7px; }
/* Valeurs par défaut sans poids (:where) : un champ qui a déjà son propre style le garde */
:where(input[type=search], input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time], input[type=number], input[type=url], input:not([type]), select, textarea) {
  border: 1px solid var(--trait-fort); border-radius: 12px; background-color: var(--papier); color: var(--encre);
  transition: border-color .15s ease, box-shadow .15s ease;
}
:where(input[type=search], input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time], input[type=number], input[type=url], input:not([type]), select, textarea):focus {
  outline: none; border-color: var(--stylo); box-shadow: 0 0 0 4px rgba(43, 61, 224, .14);
}
.champ input, .champ select, .champ textarea, .memoire, .regle-texte, .coffre-contenu, .devis-demande select {
  border: 1px solid var(--trait-fort); border-radius: 12px; background-color: var(--papier); color: var(--encre);
  box-shadow: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.champ input, .champ select { height: 42px; padding: 0 13px; }
.champ select { padding-right: 36px; }
.champ textarea { padding: 11px 13px; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #80869b; opacity: 1; }
.champ input:focus, .champ select:focus, .champ textarea:focus, .memoire:focus, .regle-texte:focus, .coffre-contenu:focus {
  outline: none; border-color: var(--stylo); box-shadow: 0 0 0 4px rgba(43, 61, 224, .14); background-color: var(--papier);
}
.champ small { color: var(--encre-3); font-size: 12.5px; }
:where(select) {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646a82' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-position: calc(100% - 11px) 50%; background-size: 16px; background-repeat: no-repeat;
}
.champ select, .filtre-boite, .attribution select, .etq-ajout select, .tete-sugg select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646a82' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-position: calc(100% - 11px) 50%; background-size: 16px; background-repeat: no-repeat; padding-right: 34px;
}
select[multiple] { padding-right: 12px; background-image: none; }
input[type=search] {
  height: 40px; padding: 0 16px 0 40px; border-radius: 999px; backdrop-filter: none;
  background: var(--papier) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646a82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 14px 50% / 17px no-repeat;
}
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.case { gap: 9px; font-size: 13.5px; color: var(--encre); }
.erreur-form { color: var(--rouge); font-size: 13px; font-weight: 550; }
.deux-champs { gap: 0 14px; }

/* Interrupteur (autorisations, automatisations) */
.interrupteur input { width: 38px; height: 22px; background: #cfd3de; transition: background-color .2s ease; }
.interrupteur input::after { top: 3px; left: 3px; width: 16px; height: 16px; box-shadow: 0 1px 3px rgba(18, 21, 43, .3); transition: transform .22s var(--ease-out); }
.interrupteur input:checked { background: var(--stylo); }
.interrupteur input:checked::after { transform: translateX(16px); }

/* Bouton de dictée : un micro dessiné, plus d'émoji */
.micro {
  position: relative; flex: none; width: 40px; min-width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  font-size: 0; color: var(--encre-2); background: var(--papier-2); box-shadow: inset 0 0 0 1px var(--trait);
  cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .12s var(--ease-out);
}
.micro::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2.5' width='6' height='12' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2.5' width='6' height='12' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.micro:hover { color: var(--stylo); background: var(--stylo-doux); }
.micro:active { transform: scale(.94); }
.micro.ecoute { color: #fff; background: var(--rouge); box-shadow: none; animation: micro-ecoute 1.1s ease-in-out infinite; }
@keyframes micro-ecoute { 50% { box-shadow: 0 0 0 6px rgba(217, 58, 49, .18); } }
#form-chat .micro { align-self: center; height: 40px; }

/* ================= Pastilles, chemises, initiales ================= */
.chip, .statut, .statut-devis, .statut-demande, .etat-rdv, .origine-prix, .badge-role, .type-contact, .confie, .statut-abs {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font: 600 12px/1 var(--police); letter-spacing: -.005em; white-space: nowrap;
}
.chip { background: var(--ch-gris); color: var(--ch-gris-e); }
.chip::before, .etat-rdv::before { display: none; }
.chip.urgent { background: var(--ch-rouge); color: var(--ch-rouge-e); }
.chip.ETUDIANT, .initiales.ETUDIANT { background: var(--ch-ciel); color: var(--ch-ciel-e); }
.chip.CANDIDAT, .initiales.CANDIDAT { background: var(--ch-lilas); color: var(--ch-lilas-e); }
.chip.ENSEIGNANT, .initiales.ENSEIGNANT, .chip.CLIENT, .initiales.CLIENT { background: var(--ch-eau); color: var(--ch-eau-e); }
.chip.SERVICE, .initiales.SERVICE, .chip.FOURNISSEUR, .initiales.FOURNISSEUR { background: var(--ch-paille); color: var(--ch-paille-e); }
.chip.ETABLISSEMENT, .initiales.ETABLISSEMENT, .chip.FACTURATION, .initiales.FACTURATION { background: var(--ch-abricot); color: var(--ch-abricot-e); }
.chip.ADMINISTRATIF, .initiales.ADMINISTRATIF { background: var(--ch-rose); color: var(--ch-rose-e); }
.chip.NOTIFICATIONS, .initiales.NOTIFICATIONS { background: var(--ch-ciel); color: var(--ch-ciel-e); }
.chip.NEWSLETTERS, .initiales.NEWSLETTERS { background: var(--ch-lilas); color: var(--ch-lilas-e); }
.chip.AUTRE, .initiales.AUTRE { background: var(--ch-gris); color: var(--ch-gris-e); }
.chip.URGENCE, .initiales.URGENCE { background: var(--ch-rouge); color: var(--ch-rouge-e); }
.chip.DEVIS, .initiales.DEVIS { background: var(--ch-stylo); color: var(--ch-stylo-e); }
.initiales {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 13px;
  background: var(--ch-gris); color: var(--ch-gris-e); font: 700 13px/1 var(--police); letter-spacing: 0;
}
.initiales.grand { width: 56px; height: 56px; border-radius: 17px; font-size: 18px; }
.confie { height: 24px; padding: 0 10px; background: rgba(18, 21, 43, .06); color: var(--encre-2); }
.avatar { color: #fff; font-weight: 700; letter-spacing: .01em; box-shadow: none; }

.statut { background: var(--ch-gris); color: var(--ch-gris-e); }
.statut.en_attente { background: var(--ambre-doux); color: var(--ambre); }
.statut.validee { background: var(--vert-doux); color: var(--vert); }
.statut.refusee, .statut.historique { background: var(--ch-gris); color: var(--ch-gris-e); }
.statut-demande.validee, .statut-devis.valide { background: var(--vert-doux); color: var(--vert); }
.statut-demande.en_attente { background: var(--ambre-doux); color: var(--ambre); }

/* ================= À valider : la bannette ================= */
.page-validation { display: grid; grid-template-columns: clamp(310px, 26vw, 420px) minmax(0, 1fr); overflow: hidden; }
.file { display: flex; flex-direction: column; min-height: 0; padding: 4px 0 0 28px; }
.file-tete { padding: 4px 10px 12px 0; }
/* Filtres de la bannette : des pastilles qui passent à la ligne au lieu d'être coupées */
.file-tete .filtres { width: 100%; display: flex; flex-wrap: wrap; gap: 5px; padding: 0; background: none; border-radius: 0; overflow: visible; }
.file-tete .filtres button { flex: none; height: 30px; padding: 0 11px; font-size: 12.5px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.file-tete .filtres button:hover { background: var(--papier); box-shadow: inset 0 0 0 1px rgba(18, 21, 43, .28); }
.file-tete .filtres button.actif, .file-tete .filtres button.actif:hover { background: var(--encre); box-shadow: 0 6px 14px -8px rgba(18, 21, 43, .7); }
/* Bannette étroite (écrans de 1280 à 1366 px de large) : les cinq filtres restent sur une ligne */
.file-tete { container-type: inline-size; }
@container (max-width: 332px) {
  .file-tete .filtres { gap: 4px; }
  .file-tete .filtres button { padding: 0 8px; }
}
@container (max-width: 302px) {
  .file-tete .filtres { gap: 3px; }
  .file-tete .filtres button { padding: 0 7px; font-size: 12px; }
}
.filtre-boite { width: 100%; height: 38px; margin-top: 10px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 550; border: 1px solid var(--trait-fort); background-color: var(--papier); color: var(--encre); }
.file-liste { gap: 8px; padding: 2px 10px 24px 2px; scroll-padding: 8px; }
.element {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 2px 12px; align-items: start;
  padding: 14px 14px 14px 14px; border: 0; border-radius: 18px; text-align: left; cursor: pointer;
  background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait);
  transition: box-shadow .18s ease, background-color .18s ease;
}
.element .initiales { grid-row: 1 / span 3; }
.element .qui { display: block; font-size: 14px; font-weight: 650; line-height: 1.35; letter-spacing: -.015em; color: var(--encre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.element .quand { font-size: 12px; line-height: 1.6; color: var(--encre-3); font-variant-numeric: tabular-nums; }
.element .apercu { grid-column: 2 / -1; font-size: 13px; line-height: 1.45; color: var(--encre-2); }
.element .nature { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; }
.element:hover { background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort), 0 6px 18px -12px rgba(18, 21, 43, .35); }
.element.actif, .element.actif:hover { background: var(--papier); box-shadow: inset 0 0 0 2px var(--stylo), 0 16px 32px -20px rgba(43, 61, 224, .65); }
.element.actif::before { display: none; }
.file-vide { margin: 6px 10px 0 0; padding: 26px 18px; border-radius: 18px; text-align: center; color: var(--encre-3); font-size: 13.5px; background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px var(--trait); }

/* ================= À valider : la feuille ================= */
.feuille-zone { overflow: auto; padding: 4px 32px 0 20px; }
.feuille {
  max-width: 1000px; margin: 0 auto 28px; padding: 32px 36px 0; border-radius: var(--r-xl);
  background: var(--papier); box-shadow: 0 0 0 1px var(--trait), var(--ombre-2);
  animation: arrivee .3s var(--ease-out);
}
@keyframes arrivee { from { opacity: 0; transform: translateY(10px) scale(.992); } }
.feuille.stable { animation: none; }
.f-tete { display: flex; align-items: center; gap: 16px; }
.feuille .f-qui h2 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.035em; color: var(--encre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-qui p { margin: 5px 0 0; color: var(--encre-2); font-size: 14.5px; }
.f-qui p strong { color: var(--encre); font-weight: 650; }
.f-meta { gap: 8px; font-size: 12.5px; color: var(--encre-3); }
.f-meta > span:last-child::first-letter { text-transform: uppercase; }

/* L'essentiel, surligné par l'IA */
.f-bref { margin: 26px 0 0; padding: 0 0 22px; border-radius: 0; background: none; border-bottom: 1px solid var(--trait); }
.f-bref h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 650 12.5px/1.4 var(--police); letter-spacing: 0; color: var(--stylo); }
.f-bref h3::before { content: ""; width: 16px; height: 16px; background: url(/logo-symbole.png) center / contain no-repeat; }
.f-resume {
  display: inline; margin: 0; max-width: none; color: var(--encre);
  font-size: 19px; line-height: 1.6; font-weight: 550; letter-spacing: -.018em;
  background-image: linear-gradient(var(--surligneur), var(--surligneur)); background-repeat: no-repeat;
  background-size: 100% .55em; background-position: 0 92%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 3px;
  animation: surligne .55s var(--ease-out) .12s both;
}
@keyframes surligne { from { background-size: 0% .55em; } }
.feuille.stable .f-resume { animation: none; }
.f-bref h3.attention { margin: 22px 0 8px; padding: 0; border: 0; color: var(--ambre); }
.f-bref h3.attention::before { width: 8px; height: 8px; margin: 0 4px; border-radius: 50%; background: #e59a14; box-shadow: 0 0 0 4px rgba(229, 154, 20, .18); }
.f-bref .vigilance { margin: 0; gap: 6px; }
.f-bref .vigilance li { position: relative; padding: 0 0 0 18px; background: none; color: var(--encre-2); font-size: 14px; line-height: 1.5; border-radius: 0; }
.f-bref .vigilance li::before { content: ""; position: absolute; left: 5px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: #e59a14; }

/* Étiquetage, attribution, message reçu */
.f-etiquettes { margin: 18px 0 0; padding: 16px 18px; border-radius: 18px; background: var(--papier-2); box-shadow: inset 0 0 0 1px var(--trait); }
.f-etiquettes h3 { font-size: 14px; font-weight: 650; }
.etq-chip { height: 28px; padding: 0 6px 0 12px; background: var(--stylo-doux); color: var(--stylo-fonce); font-weight: 600; }
.etq-x { background: rgba(43, 61, 224, .12); }
.etq-x:hover { background: rgba(43, 61, 224, .24); }
.etq-ajout select, .etq-remarque input { height: 38px; border-radius: 999px; }
.f-suite { margin: 16px 2px 18px; gap: 10px 22px; color: var(--encre-2); }
.attribution select { height: 36px; border-radius: 999px; padding-left: 14px; font-weight: 600; font-size: 13px; }
.origine { margin-bottom: 24px; border-radius: 16px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); border: 0; overflow: hidden; }
.origine summary { padding: 13px 16px; font: 650 13.5px/1.4 var(--police); color: var(--encre); transition: background-color .15s ease; }
.origine summary:hover { background: var(--papier-2); }
.origine summary::after { color: var(--stylo); font-weight: 600; }
.origine pre { padding: 2px 16px 16px; font: 13.5px/1.65 var(--police); color: var(--encre-2); }

/* Réponse préparée */
.f-reponse { position: relative; }
.redaction-tete { margin-bottom: 10px; gap: 12px; }
.redaction-tete h3 { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.redaction-tete span { font-size: 12.5px; color: var(--encre-3); }
.redaction {
  min-height: 240px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--trait-fort);
  background: var(--papier); font: 15px/1.68 var(--police); color: var(--encre); box-shadow: none;
}
.redaction:focus { border-color: var(--stylo); box-shadow: 0 0 0 4px rgba(43, 61, 224, .14); background: var(--papier); }
.redaction.reecrit { animation: reecrit .7s var(--ease-out); }
@keyframes reecrit { from { background-color: #f3f4ff; } }
.note-signature { position: relative; margin: 8px 0 0; padding-left: 22px; font-size: 12.5px; color: var(--encre-3); }
.note-signature::before {
  content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.reformuler { gap: 6px; margin-top: 14px; }
.reformuler span { margin-right: 4px; font: 600 12.5px/1 var(--police); color: var(--encre-3); }
.reformuler button {
  height: 32px; padding: 0 13px; border: 0; border-radius: 999px; background: var(--papier-2); box-shadow: inset 0 0 0 1px var(--trait);
  color: var(--encre-2); font: 600 12.5px/1 var(--police); cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .12s var(--ease-out);
}
.reformuler button:hover { background: var(--stylo-doux); color: var(--stylo-fonce); box-shadow: inset 0 0 0 1px rgba(43, 61, 224, .22); }
.reformuler button:active { transform: scale(.96); }
.consigne-libre { gap: 10px; margin-top: 12px; }
.consigne-libre input[type="text"] { height: 40px; padding: 0 16px; border-radius: 999px; }
.consigne-libre .retenir { font-size: 12.5px; color: var(--encre-3); }
/* L'IA travaille : une ligne lumineuse parcourt le haut de la réponse */
.feuille.occupee .f-reponse::before {
  content: ""; position: absolute; z-index: 2; left: 1px; right: 1px; top: 39px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--stylo), transparent); background-size: 40% 100%; background-repeat: no-repeat;
  animation: travail 1.1s var(--ease-in-out) infinite;
}
@keyframes travail { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.feuille.occupee .redaction { color: var(--encre-3); }

.rappel { padding: 18px 20px; border-radius: 16px; background: var(--papier-2); box-shadow: inset 0 0 0 1px var(--trait); font-size: 15px; }
.outils-feuille { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.fiche { margin-top: 22px; padding: 20px 22px; border-radius: 18px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); border: 0; }
.fiche .infos { background: var(--papier-2); border-radius: 12px; }
.fiche th, .fiche strong, .fiche h4 { font-family: var(--police); }

/* Barre de signature, collée en bas de la feuille */
.barre-signature {
  margin: 28px -36px 0; padding: 14px 36px 16px; gap: 10px;
  background: var(--papier); border-top: 1px solid var(--trait); border-radius: 0 0 var(--r-xl) var(--r-xl);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.barre-signature .info { font-size: 12.5px; color: var(--encre-3); }
.barre-signature .info strong { color: var(--encre-2); font-weight: 600; }
.barre-signature .btn.signer { height: 44px; padding: 0 22px; font-size: 14.5px; }
.erreur-envoi { border-radius: 14px; }

/* Validée : le tampon se pose, puis la feuille est rangée */
.feuille.signee { animation: depart .38s var(--ease-in-out) forwards; }
@keyframes depart { 0%, 32% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(-34px) scale(.985); } }
.feuille.signee::after {
  content: ""; position: absolute; z-index: 5; top: 92px; right: 40px; width: 92px; height: 92px; border-radius: 50%;
  border: 3px solid var(--vert); background: rgba(255, 255, 255, .92)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316865a' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 46px no-repeat;
  box-shadow: inset 0 0 0 5px rgba(22, 134, 90, .12);
  animation: tampon .16s var(--ease-out) both;
}
@keyframes tampon { from { opacity: 0; transform: rotate(-14deg) scale(1.35); } to { opacity: 1; transform: rotate(-14deg) scale(1); } }
.feuille.refusee { animation: chute .3s var(--ease-in-out) forwards; }
@keyframes chute { to { opacity: 0; transform: translateY(18px) scale(.99); } }

/* Rien d'ouvert */
.accueil-vide { margin-top: 10vh; }
.accueil-vide h2 { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.accueil-vide .chiffres { gap: 12px; margin-top: 28px; }
.accueil-vide .chiffres div { min-width: 140px; padding: 16px 18px; border-radius: 18px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait); font-size: 12.5px; color: var(--encre-3); }
.accueil-vide .chiffres strong { font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.logo-accueil { width: 56px; height: 56px; padding: 11px; border-radius: 18px; background: var(--papier); box-shadow: var(--ombre-1); }

/* Documents établis (laissez-passer…) */
.f-document, .doc-carte { border-radius: 18px; }
.doc-carte { background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.rdv-propose { border-radius: 16px; background: var(--stylo-doux); box-shadow: inset 0 0 0 1px rgba(43, 61, 224, .18); }
/* Icônes dessinées (plus d'émojis) : règle du carnet appliquée, modèle Word utilisé */
.doc-regle, .doc-modeles-liste { position: relative; padding-left: 22px; }
.doc-regle::before, .doc-modeles-liste::before {
  content: ""; position: absolute; left: 2px; top: .2em; width: 15px; height: 15px; background: var(--stylo);
  -webkit-mask: var(--icone) center / contain no-repeat; mask: var(--icone) center / contain no-repeat;
}
.doc-regle { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 17v5M9 3h6l-1 6 3 3v2H7v-2l3-3z'/%3E%3C/svg%3E"); }
.doc-modeles-liste { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2.5H6.5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2.5V8h5.5'/%3E%3C/svg%3E"); }

/* ================= Blocs (pages larges) ================= */
.bloc, .tableau-lignes, .contact, .kpi, .entreprise-carte, .vide-page, .carte-import, .membre-carte, .devis-demande, .devis-editeur, .regle, .entreprise-groupe, .coffre-note {
  background: var(--papier); border: 0; border-radius: var(--r-l);
  box-shadow: inset 0 0 0 1px var(--trait), var(--ombre-1);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.bloc { padding: 20px 22px; margin-bottom: 16px; }
.bloc:empty { display: none; }
.bloc h3, .tete-bloc h3, .groupe-tete h2 { font-family: var(--police); font-size: 16px; font-weight: 700; letter-spacing: -.02em; color: var(--encre); }
.tete-bloc { gap: 12px; }
.deux-colonnes { gap: 16px; }
.reglages { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.reglages .bloc { margin-bottom: 0; }
.colonne-droite { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); gap: 16px; align-items: start; }

/* ================= Reçus ================= */
.barre-recus { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.groupe { margin-bottom: 24px; }
.groupe-tete { margin: 0 0 10px 4px; }
.groupe-tete > span:last-child { height: 22px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--bureau-2); color: var(--encre-2); font: 650 12px/1 var(--police); }
.tableau-lignes { overflow: hidden; }
.rangee { border-bottom: 1px solid var(--trait); transition: background-color .15s ease; }
.rangee:last-child { border-bottom: 0; }
.rangee:hover { background: var(--papier-2); }
.rangee .titre { font-family: var(--police); font-size: 14.5px; font-weight: 650; letter-spacing: -.015em; }
.r-source { font: 500 12.5px var(--police); color: var(--encre-3); }
.rangee .sous { color: var(--encre-2); }
.rangee .date { color: var(--encre-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.deplie { background: var(--papier-2); }
.carte-import { padding: 18px 20px; }

/* ================= Annuaire ================= */
/* Les types sur une ligne, puis l'affichage à gauche et les créations à droite */
#page-repertoire .barre-recus { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px 8px; }
#filtres-contacts { grid-column: 1 / -1; }
#vue-contacts { grid-column: 1; margin-left: 0; }
#btn-nouvelle-fiche-entreprise { grid-column: 3; margin-left: 0; }
#btn-nouveau-contact { grid-column: 4; }
.grille-contacts { gap: 14px; }
.contact { padding: 18px; transition: box-shadow .18s ease; }
.contact:hover { box-shadow: inset 0 0 0 1px var(--trait-fort), var(--ombre-2); }
.contact h4 { font-size: 15px; font-weight: 700; letter-spacing: -.015em; }
.avatar { border-radius: 14px; }
.avatar.petit { border-radius: 10px; }
.entreprise-groupe { padding: 20px 22px 16px; }
.entreprise-groupe h4 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.entreprise-groupe li { border-radius: 14px; background: var(--papier-2); box-shadow: inset 0 0 0 1px var(--trait); transition: background-color .15s ease, box-shadow .15s ease; }
.entreprise-groupe li:hover { background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort), var(--ombre-1); }
.vide-groupe { box-shadow: none; }
.fc-tete .avatar { border-radius: 17px; }
.fc-chiffres li { border-radius: 14px; background: var(--papier-2); }
.fc-champs div { border-radius: 12px; }
.fc-prochain { border-radius: 16px; background: var(--stylo); }
.titre-seuls { font-size: 15px; font-weight: 700; color: var(--encre); }

/* ================= Calendrier ================= */
.page-agenda { padding: 4px 28px 22px; }
.agenda-tete { margin-bottom: 12px; }
.agenda-nav { gap: 6px; }
.agenda-nav h1 { font-size: 26px; margin-left: 12px; }
.agenda-nav .btn.mini { width: 36px; height: 36px; padding: 0; font-size: 18px; border-radius: 50%; }
/* Flèches précédent / suivant dessinées (le texte « ‹ › » reste pour les lecteurs d'écran) */
#ag-prec, #ag-suiv { position: relative; font-size: 0; color: var(--encre); }
#ag-prec::before, #ag-suiv::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 6-6 6 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 6-6 6 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
#ag-suiv::before { transform: scaleX(-1); }
.agenda-nav #ag-auj { width: auto; padding: 0 15px; font-size: 13px; border-radius: 999px; }
.agenda-vues { gap: 8px; flex-wrap: wrap; }
.puce-personne { height: 32px; padding: 0 13px 0 10px; border: 0; border-radius: 999px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); font-size: 13px; font-weight: 600; color: var(--encre-2); transition: box-shadow .15s ease, background-color .15s ease; }
.puce-personne.actif { color: var(--encre); background: color-mix(in srgb, var(--c) 10%, #fff); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 70%, #fff); }
.lien-mini { font-weight: 600; font-size: 13px; }
.semaine { border-radius: var(--r-xl); background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait), var(--ombre-1); border: 0; backdrop-filter: none; }
.jours { background: transparent; border-bottom: 1px solid var(--trait); }
.jours > div { color: var(--encre-3); font-size: 12px; font-weight: 600; }
.jours div strong { color: var(--encre); font-size: 22px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.jours div.aujourdhui { color: var(--stylo); }
.jours div.aujourdhui strong { width: 38px; height: 38px; line-height: 38px; color: #fff; background: var(--stylo); box-shadow: 0 8px 18px -8px rgba(43, 61, 224, .8); }
.heure { color: var(--encre-3); font-size: 11.5px; font-weight: 550; font-variant-numeric: tabular-nums; }
.colonne-jour { border-left: 1px solid rgba(18, 21, 43, .06); }
.colonne-jour .case-heure { border-top: 1px solid rgba(18, 21, 43, .06); }
.colonne-jour .case-heure::after { border-top: 1px dashed rgba(18, 21, 43, .04); }
.colonne-jour.aujourdhui { background: rgba(43, 61, 224, .035); }
.colonne-jour .case-heure:hover { background: rgba(43, 61, 224, .06); }
.hors-horaires { background: rgba(18, 21, 43, .025); }
.maintenant { height: 2px; background: var(--rouge); box-shadow: none; }
.maintenant::before { background: var(--rouge); box-shadow: 0 0 0 3px rgba(217, 58, 49, .18); }
/* Rendez-vous : pastilles de la couleur de la personne, à plat */
.evenement {
  border: 0; outline: none; border-radius: 11px; padding: 6px 9px; color: color-mix(in srgb, var(--c) 78%, #000);
  background: color-mix(in srgb, var(--c) 15%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 26%, transparent);
  transition: box-shadow .15s ease, transform .12s var(--ease-out);
}
.evenement:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), 0 10px 22px -14px color-mix(in srgb, var(--c) 80%, #000); }
.evenement strong { color: color-mix(in srgb, var(--c) 85%, #000); font-weight: 650; letter-spacing: -.01em; }
.evenement span, .evenement em { color: color-mix(in srgb, var(--c) 55%, var(--encre-2)); opacity: 1; }
.evenement .lien-demande { color: color-mix(in srgb, var(--c) 80%, #000); }
.evenement.interne, .evenement.externe { background: color-mix(in srgb, var(--c) 9%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); padding-left: 9px; }
.evenement .nature-ext { background: color-mix(in srgb, var(--c) 85%, #000); border-radius: 6px; }
.evenement.en-deplacement { box-shadow: 0 0 0 2px #fff, 0 24px 48px -18px color-mix(in srgb, var(--c) 80%, #000); transform: scale(1.01); }
.evenement.absence, .pilule.absence { color: var(--encre-2); background: repeating-linear-gradient(135deg, #fff 0 7px, rgba(18, 21, 43, .04) 7px 14px); box-shadow: inset 0 0 0 1px var(--trait); }
.case-mois { border-color: rgba(18, 21, 43, .06); transition: background-color .15s ease; }
.case-mois:hover { background: var(--papier-2); }
.case-mois.autre-mois { background: rgba(18, 21, 43, .02); }
.case-mois.aujourdhui .num { background: var(--stylo); color: #fff; box-shadow: none; }
.pilule { border-radius: 7px; color: color-mix(in srgb, var(--c) 82%, #000); background: color-mix(in srgb, var(--c) 16%, #fff); box-shadow: none; }
.puce-creneau { border-radius: 999px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.puce-creneau.actif, .puce-creneau:has(input:checked) { background: var(--stylo); color: #fff; box-shadow: var(--halo); }
.sugg-creneaux { border-radius: 16px; background: var(--papier-2); box-shadow: inset 0 0 0 1px var(--trait); }

/* ================= Assistant ================= */
.page-chat { background: none; }
.fil-chat { padding-top: 12px; }
.message { border-radius: 20px; font-size: 14.5px; line-height: 1.6; }
.message.moi { background: var(--encre); color: #fff; border-radius: 20px 20px 6px 20px; box-shadow: var(--ombre-1); }
.message.ia { background: var(--papier); color: var(--encre); border-radius: 20px 20px 20px 6px; box-shadow: inset 0 0 0 1px var(--trait), var(--ombre-1); backdrop-filter: none; }
.chat-vide h2 { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.suggestions button {
  height: 36px; padding: 0 15px; border: 0; border-radius: 999px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort);
  color: var(--encre-2); font: 550 13px/1 var(--police); cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .12s var(--ease-out);
}
.suggestions button:hover { color: var(--stylo-fonce); background: var(--stylo-doux); box-shadow: inset 0 0 0 1px rgba(43, 61, 224, .24); }
.suggestions button:active { transform: scale(.97); }
.saisie-chat { border: 0; border-radius: 26px; padding: 8px 8px 8px 18px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort), var(--ombre-2); backdrop-filter: none; transition: box-shadow .18s ease; }
.saisie-chat:focus-within { box-shadow: inset 0 0 0 1.5px var(--stylo), 0 0 0 4px rgba(43, 61, 224, .12), var(--ombre-2); }
.saisie-chat textarea { font: 15px/1.5 var(--police); border: 0 !important; box-shadow: none !important; background: transparent !important; }
.saisie-chat .btn.encre { height: 40px; padding: 0 18px; }

/* ================= Activité ================= */
.bandeau-valeur {
  border-radius: var(--r-xl); color: #fff; background: var(--stylo);
  box-shadow: 0 26px 50px -30px rgba(43, 61, 224, .9);
}
.bandeau-valeur .grand { font-size: 58px; font-weight: 750; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.bandeau-valeur .explication { color: rgba(255, 255, 255, .82); }
.bandeau-valeur .explication strong { color: #fff; }
.kpis { gap: 14px; }
.kpi { padding: 20px 22px; }
.kpi .valeur { font-size: 34px; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--encre); }
.kpi .libelle { font-size: 13px; color: var(--encre-2); }
.categorie .piste, .jauge { background: var(--bureau-2); border-radius: 999px; }
.categorie .rempli, .jauge div { border-radius: 999px; background: var(--stylo); }
.categorie .rempli.ETUDIANT { background: #5f93f0; }
.categorie .rempli.CANDIDAT { background: #9a7cf4; }
.categorie .rempli.ENSEIGNANT, .categorie .rempli.CLIENT { background: #3fb784; }
.categorie .rempli.SERVICE, .categorie .rempli.FOURNISSEUR { background: #e8b02e; }
.categorie .rempli.ETABLISSEMENT, .categorie .rempli.FACTURATION { background: #f08a52; }
.categorie .rempli.ADMINISTRATIF { background: #e46a9c; }
.categorie .rempli.URGENCE { background: var(--rouge); }
.categorie .rempli.AUTRE { background: #9aa0b4; }
.categorie .n, .conso-liste strong, .usage-tete strong { font-variant-numeric: tabular-nums; }
.chiffres-rapport > div { background: var(--papier); backdrop-filter: none; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--trait), var(--ombre-1); }

/* ================= Connaissances ================= */
.onglets-page { margin-bottom: 16px; }
.coffre { gap: 16px; }
.coffre-liste { overflow-x: hidden; }
.coffre-liste input[type="search"] {
  width: 100%; height: 40px; padding: 0 16px 0 40px; border-radius: 999px; border: 1px solid var(--trait-fort);
  background: var(--papier) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646a82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 14px 50% / 17px no-repeat;
}
.coffre-liste h4 { margin: 16px 6px 6px; font-size: 12.5px; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--encre-3); }
.coffre-item { border-radius: 14px; transition: background-color .15s ease, box-shadow .15s ease; }
.coffre-item:hover { background: rgba(255, 255, 255, .7); }
.coffre-item.actif { background: var(--papier); box-shadow: inset 0 0 0 2px var(--stylo), var(--ombre-1); }
.coffre-note { padding: 22px 24px; }
.coffre-titre { font-size: 20px; font-weight: 700; letter-spacing: -.025em; border-bottom-color: var(--trait); }
.coffre-contenu { border-radius: 14px; }

/* ================= Équipe, suivi, améliorations, administration, devis ================= */
.membre-carte { padding: 18px 20px; }
.badge-role { background: var(--ch-gris); color: var(--ch-gris-e); }
.badge-role.chef { background: var(--stylo-doux); color: var(--stylo-fonce); }
.entreprise-carte { padding: 20px 22px; }
.tuile { border-radius: 16px; transition: box-shadow .15s ease, background-color .15s ease; }
.tuile:has(input:checked) { box-shadow: inset 0 0 0 2px var(--stylo); background: var(--stylo-doux); }
.regle { padding: 16px 18px; }
.regle .origine { height: 22px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 999px; }
.devis-liste li[data-devis-ouvrir] { border-radius: 14px; }
.devis-liste li.ouvert { box-shadow: inset 0 0 0 2px var(--stylo); }
.carnet-attente { border-radius: 16px; }
.etat-relie { border-radius: 14px; }

/* ================= Listes déroulantes dessinées =================
   Chromium 135 et plus (Electron 39) : la liste qui s'ouvre se dessine comme le reste de l'application
   (panneau blanc arrondi, options aérées, choix en cours en bleu doux). Ailleurs : la liste standard de Windows. */
@supports (appearance: base-select) {
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select):not([multiple]):not([size]),
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select):not([multiple]):not([size])::picker(select) {
    appearance: base-select;
  }
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select):not([multiple]):not([size]) {
    display: inline-flex; align-items: center; overflow: hidden; white-space: nowrap; text-align: left;
  }
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select)::picker-icon { display: none; } /* la flèche est déjà dessinée */
  .attribution select, .etq-ajout select { min-width: 230px; } /* la largeur ne saute pas quand le choix change */
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select)::picker(select) {
    min-inline-size: max(anchor-size(self-inline), 220px); max-block-size: min(380px, 62vh); overflow-y: auto;
    margin-block: 6px; padding: 6px; border: 0; border-radius: 16px;
    background: var(--papier); color: var(--encre);
    box-shadow: 0 0 0 1px var(--trait), 0 26px 56px -22px rgba(18, 21, 43, .42);
    scrollbar-width: thin; animation: liste-in .18s var(--ease-out);
  }
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select) option {
    display: flex; align-items: center; gap: 10px; min-block-size: 38px; padding: 0 12px; border-radius: 10px;
    background: transparent; color: var(--encre); font: 500 13.5px/1.35 var(--police); letter-spacing: -.005em; white-space: nowrap; cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
  }
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select) option:hover,
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select) option:focus-visible {
    background: var(--papier-2); outline: none;
  }
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select) option:checked {
    background: var(--stylo-doux); color: var(--stylo-fonce); font-weight: 650;
  }
  /* Le choix en cours : une coche dessinée, à droite */
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select) option::checkmark {
    order: 1; margin-inline-start: auto; content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select) option:not(:checked)::checkmark { visibility: hidden; }
  :is(.barre-titre .selecteur-entreprise, .filtre-boite, .attribution select, .etq-ajout select, .champ select, .tete-sugg select, .devis-demande select) optgroup { font: 650 12px/1.4 var(--police); color: var(--encre-3); padding: 8px 6px 2px; }
}
@keyframes liste-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } }

/* ================= Fenêtres, messages, menus ================= */
.modale {
  width: min(580px, calc(100vw - 32px)); border: 0; border-radius: 26px; padding: 0;
  background: var(--papier); box-shadow: 0 0 0 1px var(--trait), 0 40px 90px -30px rgba(18, 21, 43, .55);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.modale[open] { animation: modale-in .26s var(--ease-out); }
@keyframes modale-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.modale::backdrop { background: rgba(18, 21, 43, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: voile-in .22s ease; }
@keyframes voile-in { from { opacity: 0; } }
.modale form { padding: 28px 30px 24px; }
.modale h2 { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.modale .actions { gap: 8px; margin-top: 22px; }
.modale fieldset { border-radius: 16px; border-color: var(--trait-fort); }

/* En haut à droite, sous le compte : jamais sur la barre de signature */
#toasts { left: auto; right: 22px; top: calc(var(--hauteur-titre) + 6px); bottom: auto; transform: none; align-items: flex-end; z-index: 60; }
.toast {
  position: relative; display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 44px));
  padding: 12px 18px 12px 14px; border-radius: 16px; background: var(--encre); color: #fff;
  font: 550 13.5px/1.45 var(--police); box-shadow: 0 18px 40px -16px rgba(18, 21, 43, .6);
  backdrop-filter: none; animation: toast-in .36s var(--ease-tiroir);
}
.toast::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #aab2ff; box-shadow: 0 0 0 4px rgba(170, 178, 255, .18); }
.toast.ok { background: var(--encre); }
.toast.ok::before { background: #4fd08f; box-shadow: 0 0 0 4px rgba(79, 208, 143, .2); }
.toast.erreur, .toast.urgent { background: #a8241c; }
.toast.erreur::before, .toast.urgent::before { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }

/* ================= Connexion ================= */
.ecran-connexion { background: var(--bureau); }
.ecran-connexion::before { content: ""; position: fixed; inset: 0 auto 0 0; width: 76px; background: radial-gradient(160% 40% at 0% 0%, rgba(43, 61, 224, .35), rgba(43, 61, 224, 0) 70%), var(--rail); }
.ecran-connexion::after { content: ""; position: fixed; left: 20px; top: 20px; width: 36px; height: 36px; background: url(/logo-symbole.png) center / contain no-repeat; filter: brightness(0) invert(1); }
.carte-connexion {
  width: min(420px, calc(100vw - 120px)); padding: 38px 36px 32px; border-radius: 28px;
  background: var(--papier); box-shadow: 0 0 0 1px var(--trait), var(--ombre-3); backdrop-filter: none;
  animation: modale-in .4s var(--ease-out);
}
.carte-connexion h1 { font-size: 30px; margin: 22px 0 6px; }
.logo-connexion { height: 34px; }
.carte-connexion .btn.signer { width: 100%; height: 48px; margin-top: 8px; font-size: 15px; }

/* ================= Petites largeurs (ou affichage agrandi) ================= */
@media (max-width: 1365px) { :root { --colonne: 228px; } }
@media (max-width: 1240px) {
  .etat-synchro { max-width: 230px; }
}
/* Colonne réduite aux icônes ; le libellé apparaît au survol */
@media (max-width: 1180px) {
  :root { --colonne: 76px; }
  .barre-titre { padding: 14px 10px 12px; overflow: visible; }
  .marque { padding: 4px 0 16px; }
  .marque .nom, .marque .client { display: none; }
  /* Colonne étroite : la coche du logo, pleine, en blanc */
  .marque .logo-symbole { position: static; translate: none; height: 32px; opacity: 1; }
  .barre-titre .selecteur-entreprise { width: 46px; padding: 0 !important; color: transparent; background-position: 50% 50%, 200% 50%, 0 0; }
  .onglets a, .menu-plus a { justify-content: center; padding: 0; height: 44px; }
  .onglets a svg, .menu-plus a svg { width: 21px; height: 21px; }
  .onglets a span, .menu-plus a span {
    position: absolute; left: calc(100% + 12px); top: 50%; z-index: 50; transform: translateY(-50%);
    padding: 7px 11px; border-radius: 10px; background: var(--encre); color: #fff; box-shadow: var(--ombre-2);
    font-size: 13px; pointer-events: none; opacity: 0; transition: opacity .12s ease;
  }
  .onglets a:hover span, .menu-plus a:hover span, .onglets a:focus-visible span, .menu-plus a:focus-visible span { opacity: 1; transition-delay: .25s; }
  :is(.onglets, .menu-plus) a[data-multi]::after { display: none; }
  body.volet-ouvert :is(.onglets, .menu-plus) a[data-multi] span { opacity: 0 !important; }
  .volet-menu p { display: block; }
  .onglets b, .menu-plus a b { position: absolute; top: 5px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; }
  .menu-plus-zoom { justify-items: center; gap: 6px; padding: 10px 0 0; }
  .menu-plus-zoom > span { display: none; }
  .zoom-btns { grid-template-columns: 24px 24px; justify-content: center; gap: 4px; }
  .zoom-btns button { width: 24px; min-width: 24px; padding: 0; }
  #zoom-reset { display: none; } /* Ctrl 0 remet la taille automatique */
  .choix-animations { justify-content: center; padding: 10px 0 4px; }
  .choix-animations > span:first-child { display: none; }
  .page-validation { grid-template-columns: clamp(270px, 30vw, 340px) minmax(0, 1fr); }
  .feuille { max-width: none; }
}
@media (max-width: 1100px) {
  .salut span { display: none; }
  .feuille { padding: 26px 26px 0; }
  .barre-signature { margin: 24px -26px 0; padding: 14px 26px 16px; }
  .page-large { padding: 6px 26px 40px; }
}
@media (max-width: 980px) {
  .etat-synchro #texte-synchro { display: none; }
  .etat-synchro { padding: 0 14px; }
  .page-validation { grid-template-columns: 250px minmax(0, 1fr); }
  .file { padding-left: 14px; }
  .barre-signature { flex-wrap: wrap; row-gap: 8px; }
  .barre-signature .info { flex-basis: 100%; }
  .feuille-zone { padding: 4px 14px 0 10px; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
/* Très étroit : la bannette passe en bandeau horizontal au-dessus de la feuille */
@media (max-width: 820px) {
  :root { --colonne: 64px; }
  .salut { display: none; }
  .page-validation { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .file { padding: 0 0 0 14px; }
  .file-tete { padding-right: 14px; }
  .file-liste { flex-direction: row; overflow: auto hidden; padding: 2px 14px 12px 2px; }
  .file-liste .element { flex: 0 0 260px; }
  .f-tete { flex-wrap: wrap; }
  .feuille .f-qui h2 { white-space: normal; }
  .consigne-libre { grid-template-columns: 1fr; }
  .page-large { padding: 4px 16px 32px; }
  .page-agenda { padding: 4px 12px 16px; }
}

/* ================= Mouvement réduit : fondus seulement ================= */
@media (prefers-reduced-motion: reduce) {
  body:not(.animations-toujours) .page { animation: fondu .16s ease both !important; }
  body:not(.animations-toujours) .feuille { animation: fondu .16s ease both !important; }
  body:not(.animations-toujours) .feuille.stable { animation: none !important; }
  body:not(.animations-toujours) .modale[open] { animation: fondu .16s ease both !important; }
  body:not(.animations-toujours) .toast { animation: fondu .2s ease both !important; }
  body:not(.animations-toujours) .f-resume { animation: none !important; background-size: 100% .55em; }
  body:not(.animations-toujours) .feuille.signee { animation: fondu-sortie .2s ease forwards !important; }
  body:not(.animations-toujours) .feuille.signee::after { animation: none !important; }
  body:not(.animations-toujours) .file-liste.entree .element { animation: none !important; }
  body:not(.animations-toujours) select::picker(select) { animation: none !important; }
}
@keyframes fondu { from { opacity: 0; } }
@keyframes fondu-sortie { to { opacity: 0; } }

/* ================= Entrées ================= */
/* La bannette, à l'arrivée sur la page seulement (classe posée par l'écran pendant 700 ms) */
.file-liste.entree .element { animation: carte-in .28s var(--ease-out) both; }
.file-liste.entree .element:nth-child(2) { animation-delay: 30ms; }
.file-liste.entree .element:nth-child(3) { animation-delay: 55ms; }
.file-liste.entree .element:nth-child(4) { animation-delay: 75ms; }
.file-liste.entree .element:nth-child(5) { animation-delay: 90ms; }
.file-liste.entree .element:nth-child(6) { animation-delay: 102ms; }
.file-liste.entree .element:nth-child(n+7) { animation-delay: 112ms; }
@keyframes carte-in { from { opacity: 0; transform: translateY(8px); } }
/* Survols qui bougent : seulement avec une vraie souris */
@media (hover: hover) and (pointer: fine) {
  .contact:hover { transform: translateY(-1px); }
  .contact { transition: box-shadow .18s ease, transform .18s var(--ease-out); }
}

/* ================= Pièces jointes des e-mails reçus ================= */
.pieces-jointes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; }
.pieces-jointes .pj-titre { flex-basis: 100%; font: 650 12.5px/1.3 var(--police); color: var(--encre-3); }
.pj-piece {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 38px; padding: 0 14px 0 11px;
  border: 0; border-radius: 12px; background: var(--papier); color: var(--encre); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--trait-fort); font: 550 13px/1 var(--police);
  transition: box-shadow .15s ease, transform .12s var(--ease-out);
}
.pj-piece:hover { box-shadow: inset 0 0 0 1px var(--stylo), 0 6px 16px -10px rgba(43, 61, 224, .6); }
.pj-piece:active { transform: scale(.97); }
.pj-piece span { min-width: 0; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-piece small { flex: none; color: var(--encre-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.pj-piece svg, .pieces-jointes .btn svg, .r-pj svg, .chip-pj svg {
  width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.pj-piece svg { color: var(--stylo); }
.pieces-jointes .btn { display: inline-flex; align-items: center; gap: 7px; }
.r-pj { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; color: var(--encre-3); font-size: 12px; font-weight: 600; vertical-align: middle; }
.r-pj svg { width: 13px; height: 13px; }
.chip.chip-pj { display: inline-flex; align-items: center; gap: 4px; background: var(--ch-gris); color: var(--ch-gris-e); }
.chip-pj svg { width: 12px; height: 12px; }
.apercu-piece { display: block; max-width: min(820px, 80vw); max-height: 70vh; margin: 0 auto; border-radius: 12px; background: #fff; box-shadow: var(--ombre-1); }
.deplie .pieces-jointes { margin: 10px 0 4px; }
/* Aperçu d'un PDF ou d'une image (pièce jointe, document rempli) : une fenêtre assez large pour lire la page sans défiler de côté. */
.modale:has(.apercu-pdf), .modale:has(.apercu-piece) { width: min(920px, calc(100vw - 48px)); }
.modale .apercu-pdf { width: 100%; height: min(64vh, 860px); border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--trait); }
.modale .apercu-piece { max-width: 100%; max-height: 64vh; }
.feuille .pieces-jointes { margin: 16px 0 8px; }

/* ================= Assistant : fichiers joints et fichiers produits ================= */
.trombone-chat::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5 12.4 20a5 5 0 0 1-7.1-7.1l8.6-8.6a3.3 3.3 0 0 1 4.7 4.7l-8.6 8.6a1.7 1.7 0 0 1-2.4-2.4l7.9-7.9'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5 12.4 20a5 5 0 0 1-7.1-7.1l8.6-8.6a3.3 3.3 0 0 1 4.7 4.7l-8.6 8.6a1.7 1.7 0 0 1-2.4-2.4l7.9-7.9'/%3E%3C/svg%3E");
}
#form-chat .trombone-chat { margin-left: -10px; }
.pj-chat { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.pj-attente {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 34px; padding: 0 4px 0 11px; border-radius: 11px;
  background: var(--papier); color: var(--encre); box-shadow: inset 0 0 0 1px var(--trait-fort); font: 550 13px/1 var(--police);
}
.pj-attente > span { min-width: 0; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-attente.charge { color: var(--encre-3); }
.pj-attente.erreur { color: var(--rouge); box-shadow: inset 0 0 0 1px var(--rouge); }
.pj-attente button { width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--encre-3); font-size: 17px; line-height: 1; cursor: pointer; }
.pj-attente button:hover { background: var(--papier-2); color: var(--encre); }
.fichiers-chat { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fc-fichier { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px; border-radius: 9px; background: rgba(255, 255, 255, .14); font: 550 12.5px/1.3 var(--police); }
.fc-fichier span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fichiers-chat.produits { flex-direction: column; align-items: stretch; }
.fc-produit {
  display: flex; align-items: center; gap: 11px; width: 100%; max-width: 440px; padding: 10px 12px; border: 0; border-radius: 13px; text-align: left;
  background: var(--papier-2); color: var(--encre); cursor: pointer; box-shadow: inset 0 0 0 1px var(--trait-fort);
  transition: box-shadow .15s ease, transform .12s var(--ease-out);
}
.fc-produit:hover { box-shadow: inset 0 0 0 1px var(--stylo), 0 6px 16px -10px rgba(43, 61, 224, .6); }
.fc-produit:active { transform: scale(.98); }
.fc-produit > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fc-produit b { font: 650 13.5px/1.3 var(--police); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-produit small { font: 12px/1.35 var(--police); color: var(--encre-3); }
.fc-produit svg:first-child { color: var(--stylo); }
.pj-attente svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fichiers-chat svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fc-fichier svg { width: 14px; height: 14px; }
.page-chat.depot .saisie-chat { box-shadow: inset 0 0 0 2px var(--stylo), 0 0 0 6px rgba(43, 61, 224, .12), var(--ombre-2); }
.page-chat.depot .fil-chat { outline: 2px dashed var(--stylo); outline-offset: -12px; border-radius: 18px; }

/* ================= Questions de Tâche Libre : ce que seule l'équipe sait, en un clic ================= */
.chip.chip-q { background: var(--stylo-doux); color: var(--stylo); }
.f-questions {
  margin: 22px 0 0; padding: 16px 18px 14px; border-radius: 16px;
  background: var(--stylo-doux); box-shadow: inset 0 0 0 1px rgba(43, 61, 224, .18);
}
.f-questions.faites { background: var(--papier-2); box-shadow: inset 0 0 0 1px var(--trait); }
.f-questions h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 650 12.5px/1.4 var(--police); color: var(--stylo); }
.f-questions h3::before { content: ""; width: 16px; height: 16px; background: url(/logo-symbole.png) center / contain no-repeat; }
.f-questions.faites h3 { color: var(--encre-3); }
.question-ia + .question-ia { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(43, 61, 224, .14); }
.f-questions.faites .question-ia + .question-ia { border-top-color: var(--trait); }
.q-texte { margin: 0 0 10px; font: 600 15px/1.45 var(--police); color: var(--encre); }
/* Question sur un document (laissez-passer…) : le document visé, au-dessus de la question. */
.q-doc { margin: 0 0 3px; font: 600 12px/1.4 var(--police); color: var(--stylo); }
.q-choix { display: flex; flex-wrap: wrap; gap: 8px; }
.q-choix .btn { height: 36px; padding: 0 14px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); color: var(--encre); font-weight: 600; }
.q-choix .btn:hover { box-shadow: inset 0 0 0 1px var(--stylo); color: var(--stylo); }
.q-choix .btn.suppose { box-shadow: inset 0 0 0 1.5px var(--stylo); }
.q-choix .btn.fantome { background: transparent; box-shadow: none; color: var(--encre-3); font-weight: 550; }
.q-choix .btn:disabled, .q-libre .btn:disabled { opacity: .55; cursor: progress; }
.q-libre { display: flex; gap: 8px; margin: 10px 0 0; }
.q-libre input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); font: 14px var(--police); color: var(--encre); }
.q-libre input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--stylo); }
.q-libre .btn { height: 36px; }
.q-note { margin: 8px 0 0; font: 12.5px/1.45 var(--police); color: var(--encre-3); }
.q-reponse { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; font: 14px/1.45 var(--police); color: var(--encre-2); }
.q-retenu { padding: 2px 9px; border-radius: 999px; background: var(--ch-vert, #e3f5ea); color: var(--ch-vert-e, #1d6b3c); font: 600 12px/1.6 var(--police); }
.q-reponse .lien { margin-left: auto; border: 0; background: none; padding: 0; color: var(--stylo); font: 600 13px var(--police); cursor: pointer; }
.q-reponse .lien:hover { text-decoration: underline; }
.q-libre[hidden] { display: none; }

/* ================= Assistant : conversations gardées ================= */
.chat-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px max(32px, calc(50% - 400px)) 4px; }
.chat-tete .choix-conv { flex: 1 1 260px; min-width: 0; }
.chat-tete .cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat-tete select { width: 100%; height: 38px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); font: 550 14px var(--police); color: var(--encre); }
.chat-tete select:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--stylo); }
.chat-tete .btn { height: 38px; }
.souvenirs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.souvenirs li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--papier-2); box-shadow: inset 0 0 0 1px var(--trait); font: 14px/1.45 var(--police); }
.souvenirs li span { flex: 1; }

/* ================= « À valider » : santé et questions de démarrage ================= */
.aide-equipe { display: grid; gap: 10px; margin: 0 0 12px; }
.sante-alerte { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--ch-rouge, #fdecea); color: var(--ch-rouge-e, #9b1c1c); font: 13.5px/1.45 var(--police); }
.sante-alerte strong { font-weight: 650; }
.question-equipe { padding: 14px 14px 10px; border-radius: 16px; background: var(--stylo-doux); box-shadow: inset 0 0 0 1px rgba(43, 61, 224, .18); }
.qe-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 6px; font: 650 12.5px/1.4 var(--police); color: var(--stylo); }
.qe-tete small { font-weight: 550; color: var(--encre-3); }
.qe-texte { margin: 0 0 10px; font: 600 14.5px/1.45 var(--police); color: var(--encre); }
.qe-choix { display: flex; flex-wrap: wrap; gap: 6px; }
.qe-choix .btn { height: auto; min-height: 34px; padding: 6px 12px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); color: var(--encre); font-weight: 600; text-align: left; white-space: normal; }
.qe-choix .btn:hover { box-shadow: inset 0 0 0 1px var(--stylo); color: var(--stylo); }
.qe-libre { display: flex; gap: 6px; margin: 8px 0 0; }
.qe-libre[hidden] { display: none; }
.qe-libre input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait-fort); font: 13.5px var(--police); }
.qe-libre .btn { height: 34px; }
.qe-pied { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 0; }
.qe-pied .lien { border: 0; background: none; padding: 0; color: var(--encre-3); font: 600 12.5px var(--police); cursor: pointer; }
.qe-pied .lien:hover { color: var(--stylo); }

/* Limite d'utilisation : rien ne s'affiche tant qu'elle est loin ; une note sobre quand elle approche ou est atteinte. */
.limite-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--bureau-2); color: var(--encre-2); font-size: 14px; line-height: 1.45; }
.limite-note.pleine { color: var(--encre); box-shadow: inset 3px 0 0 var(--stylo); }

/* Nouveau message : sous les filtres, sur toute la largeur de la colonne */
.file-tete .nouveau-mail { width: 100%; margin-top: 8px; height: 34px; justify-content: center; }

/* Nouveau message : contacts proposés sous « À », réécriture par l'IA */
.nm-a-zone { position: relative; }
.champ-destinataire > label { display: block; font-size: 13px; font-weight: 600; color: var(--encre-2); margin-bottom: 7px; }
.suggestions-contacts { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: 4px; list-style: none; background: var(--papier); border: 1px solid var(--trait-fort); border-radius: var(--r-s); box-shadow: 0 10px 28px rgba(18, 21, 43, .14); max-height: 260px; overflow: auto; }
.suggestions-contacts li { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1.35; }
.suggestions-contacts li .societe { color: var(--encre-3); font-size: 12.5px; align-self: center; }
.suggestions-contacts li .adresse { grid-column: 1 / -1; color: var(--encre-2); font-size: 12.5px; }
.suggestions-contacts li[aria-selected="true"], .suggestions-contacts li[data-k]:hover { background: var(--stylo-doux); }
.suggestions-contacts li.aucun { display: block; cursor: default; color: var(--encre-3); font-size: 13px; }
.nm-reformuler button:disabled, .nm-consigne button:disabled { opacity: .55; cursor: progress; }
.nm-consigne { display: flex; gap: 8px; margin-top: 8px; }
.nm-consigne input { flex: 1; min-width: 0; }
.nm-etat:empty { display: none; }
/* ================= Lecteur de fichiers ================= */
.lecteur { width: min(1120px, calc(100vw - 40px)); height: calc(100dvh - 84px); margin: 64px auto 20px; max-width: none; max-height: none; padding: 0; border: 0; border-radius: 22px; overflow: hidden; background: var(--papier); color: var(--encre); box-shadow: 0 40px 90px -30px rgba(18, 21, 43, .55); }
/* Le haut de la fenêtre sert à la déplacer : sans ceci, il avale les clics des fenêtres ouvertes par-dessus. */
dialog, dialog * { -webkit-app-region: no-drag; }
.lecteur[open] { display: flex; flex-direction: column; animation: modale-in .2s var(--ease-out); }
.lecteur::backdrop { background: rgba(18, 21, 43, .5); }
.lecteur-tete { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.lecteur-nom { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.lecteur-rang { font-size: 13px; color: var(--encre-2); white-space: nowrap; }
.lecteur-boutons a { text-decoration: none; }
.lecteur-boutons { display: flex; gap: 8px; margin-left: auto; }
.lecteur-corps { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; background: #eef0f4; outline: none; }
.lecteur-page { width: 100%; height: 100%; border: 0; background: #fff; }
.lecteur-image { max-width: 100%; max-height: 100%; cursor: zoom-in; }
.lecteur-corps.agrandi { display: block; }
.lecteur-corps.agrandi .lecteur-image { max-width: none; max-height: none; min-width: 100%; cursor: zoom-out; }
.lecteur-media { width: min(860px, 92%); max-height: 94%; }
.lecteur-message { max-width: 46ch; padding: 24px; text-align: center; color: var(--encre-2); }
.lecteur-corps.attend .lecteur-message { animation: lecteur-attend 1.2s ease-in-out infinite alternate; }
@keyframes lecteur-attend { to { opacity: .4; } }
.lecteur-note { margin: 0; padding: 10px 16px; font-size: 13px; color: var(--encre-2); }
@media (max-width: 640px) { .lecteur { width: 100vw; height: calc(100dvh - 56px); margin: 56px 0 0; border-radius: 0; } .lecteur-nom { flex-basis: 100%; } .lecteur-boutons { margin-left: 0; flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .lecteur[open], .lecteur-corps.attend .lecteur-message { animation: none; } }

/* ================= Boîte mail ================= */
/* Dossiers, liste, lecture. Sans message ouvert, la liste prend toute la place. */
.page-boite { position: relative; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 18px; padding: 4px 22px 16px 24px; overflow: hidden; }
.page-boite.bm-lecture-ouverte { grid-template-columns: 236px clamp(300px, 22vw, 420px) minmax(0, 1fr); }
.page-boite[hidden], #bm-lecture[hidden], #bm-defaire[hidden], #bm-lot[hidden], .bm-outils .filtres[hidden], .bm-dest[hidden], .bm-details[hidden], .bm-r-ligne[hidden], .bm-lien[hidden], .bm-menu button[hidden] { display: none; }
.bm-cote, .bm-milieu, #bm-lecture { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.bm-i { flex: none; display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Les neuf couleurs d'étiquettes : fond (--f), encre (--e), point (--p) */
[data-c="rouge"] { --f: var(--ch-rouge); --e: var(--ch-rouge-e); --p: #e0443c; }
[data-c="abricot"] { --f: var(--ch-abricot); --e: var(--ch-abricot-e); --p: #ee8434; }
[data-c="paille"] { --f: var(--ch-paille); --e: var(--ch-paille-e); --p: #d9a514; }
[data-c="eau"] { --f: var(--ch-eau); --e: var(--ch-eau-e); --p: #2c9f6b; }
[data-c="ciel"] { --f: var(--ch-ciel); --e: var(--ch-ciel-e); --p: #2f9bd3; }
[data-c="stylo"] { --f: var(--ch-stylo); --e: var(--ch-stylo-e); --p: #2b3de0; }
[data-c="lilas"] { --f: var(--ch-lilas); --e: var(--ch-lilas-e); --p: #8a5cf0; }
[data-c="rose"] { --f: var(--ch-rose); --e: var(--ch-rose-e); --p: #d94a96; }
[data-c="gris"] { --f: var(--ch-gris); --e: var(--ch-gris-e); --p: #8a8fa3; }
.bm-etq { display: inline-block; flex: none; max-width: 180px; height: 21px; padding: 0 8px; border-radius: 6px; background: var(--f); color: var(--e); font: 600 11.5px/21px var(--police); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-pt { flex: none; width: 12px; height: 12px; margin: 0 3px; border-radius: 4px; background: var(--p); }
.bm-pt.chip { height: 12px; padding: 0; border-radius: 50%; background: currentColor; }

/* Bouton à icône : le nom apparaît quand la place le permet */
.bm-b { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none; min-width: 36px; height: 36px; padding: 0 9px; border: 0; border-radius: var(--r-s); background: none; color: var(--encre-2); font: 600 13px/1 var(--police); letter-spacing: -.01em; white-space: nowrap; cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .12s var(--ease-out); }
.bm-b > span { display: none; }
.bm-b:hover { background: rgba(18, 21, 43, .07); color: var(--encre); }
.bm-b:active { transform: scale(.95); }
.bm-b:disabled { opacity: .38; cursor: default; background: none; transform: none; }
.bm-b[aria-expanded="true"] { background: var(--stylo-doux); color: var(--stylo-fonce); }
.bm-b[data-action="supprimer"]:hover { background: var(--rouge-doux); color: var(--rouge); }
.bm-b.principal { padding: 0 16px 0 13px; border-radius: 999px; background: var(--stylo); color: #fff; }
.bm-b.principal > span { display: inline; }
.bm-b.principal:hover { background: var(--stylo-fonce); color: #fff; }
.bm-b.principal:disabled { opacity: .5; background: var(--stylo); }
.bm-sep { flex: none; width: 1px; height: 20px; margin: 0 5px; background: var(--trait-fort); }
.bm-lien { border: 0; padding: 0; background: none; color: var(--stylo); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(43, 61, 224, .35); text-underline-offset: 3px; }
.bm-lien:hover { text-decoration-color: currentColor; }

/* ----- Colonne de gauche ----- */
.bm-cote { gap: 10px; }
#bm-ecrire { flex: none; justify-content: center; height: 44px; }
#bm-boite { flex: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 8px 10px; border: 0; border-radius: var(--r-m); background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait); color: var(--encre); font: inherit; text-align: left; cursor: pointer; transition: box-shadow .15s ease; }
#bm-boite:hover:not(:disabled), #bm-boite[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--trait-fort), var(--ombre-1); }
#bm-boite:disabled { cursor: default; }
#bm-boite > .bm-i { width: 16px; height: 16px; color: var(--encre-3); }
#bm-boite .initiales, .bm-menu-boites .initiales { width: 34px; height: 34px; border-radius: 10px; background: var(--ch-stylo); color: var(--ch-stylo-e); font-size: 12px; }
.bm-boite-nom { flex: 1; min-width: 0; }
.bm-boite-nom strong, .bm-boite-nom small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-boite-nom strong { font-size: 13.5px; line-height: 1.35; }
.bm-boite-nom small { font-size: 12px; line-height: 1.35; color: var(--encre-3); }
#bm-dossiers { flex: 1; min-height: 0; margin-right: -10px; padding: 0 4px 8px 0; overflow-y: auto; scrollbar-gutter: stable; }
.bm-d { position: relative; display: flex; border-radius: var(--r-s); }
.bm-d + .bm-d { margin-top: 1px; }
.bm-d-nom { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; min-height: 36px; padding: 6px 10px 6px calc(10px + var(--n, 0) * 14px); border: 0; border-radius: var(--r-s); background: none; color: var(--encre-2); font: 500 14px/1.3 var(--police); text-align: left; cursor: pointer; transition: background-color .12s ease, color .12s ease; }
.bm-d-nom .bm-i { color: var(--encre-3); }
.bm-d-nom span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-d-nom b { font: 650 12.5px/1 var(--police); color: var(--stylo); font-variant-numeric: tabular-nums; }
.bm-d-nom:hover { background: var(--bureau-2); color: var(--encre); }
.bm-d.actif .bm-d-nom { background: var(--papier); color: var(--encre); font-weight: 650; box-shadow: var(--ombre-1); }
.bm-d.actif .bm-d-nom .bm-i { color: var(--stylo); }
.bm-d-nom.recoit { background: var(--stylo-doux); color: var(--stylo-fonce); box-shadow: inset 0 0 0 2px var(--stylo); }
.bm-glisse .bm-d-nom:not([data-recoit]) { opacity: .45; }
.bm-d-plus { position: absolute; right: 4px; top: 4px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--encre-2); cursor: pointer; opacity: 0; }
.bm-d:hover .bm-d-plus, .bm-d-plus:focus-visible, .bm-d-plus[aria-expanded="true"] { opacity: 1; }
.bm-d-plus:hover, .bm-d-plus[aria-expanded="true"] { background: rgba(18, 21, 43, .1); color: var(--encre); }
.bm-d:has(.bm-d-plus):hover .bm-d-nom { padding-right: 36px; } .bm-d:has(.bm-d-plus):hover b { visibility: hidden; }
@media (hover: none) { .bm-d-plus { opacity: 1; } }
.bm-d-titre { display: flex; align-items: center; justify-content: space-between; min-height: 30px; margin: 14px 0 2px; padding-left: 10px; }
.bm-d-titre h3 { margin: 0; font: 600 12.5px/1 var(--police); color: var(--encre-3); letter-spacing: 0; }
.bm-d-titre button { display: grid; place-items: center; width: 28px; height: 28px; margin-right: 4px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--encre-3); cursor: pointer; }
.bm-d-titre button:hover { background: var(--bureau-2); color: var(--encre); }
.bm-d-voir { margin: 4px 0 0 10px; border: 0; background: none; color: var(--encre-3); font: 600 12.5px/1.6 var(--police); cursor: pointer; }
.bm-d-voir:hover { color: var(--stylo); }
.bm-note, .bm-panne { margin: 8px 10px; font-size: 13px; color: var(--encre-3); }
.bm-panne { padding: 10px 12px; border-radius: var(--r-s); background: var(--ambre-doux); color: var(--ambre); }

/* ----- Liste ----- */
.bm-milieu { container: bm-milieu / inline-size; }
.bm-tete { flex: none; display: flex; align-items: center; gap: 10px 14px; min-height: 44px; }
.bm-tete-nom { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.bm-tete h1 { margin: 0; font-size: 21px; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bm-compte { flex: none; font-size: 13px; color: var(--encre-3); font-variant-numeric: tabular-nums; }
#bm-recherche { flex: 0 1 400px; margin: 0; } #bm-recherche input { width: 100%; }
#bm-actualiser.tourne .bm-i { animation: bm-tour .8s linear infinite; }
@keyframes bm-tour { to { transform: rotate(360deg); } }
.bm-outils { flex: none; display: flex; align-items: center; gap: 8px 12px; min-height: 38px; margin: 10px 0 8px; padding-left: 16px; }
.bm-outils > input, .bm-ligne > input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--stylo); cursor: pointer; }
#bm-ou { margin-left: auto; }
#bm-lot { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; }
#bm-lot strong { flex: none; margin-right: 8px; font-size: 13.5px; }
#bm-lot .bm-fin { margin-left: auto; }
#bm-liste { container: bm-liste / inline-size; flex: 1; min-height: 0; overflow-y: auto; background: var(--papier); border-radius: var(--r-m); box-shadow: var(--ombre-1); }
#bm-liste ul { list-style: none; margin: 0; padding: 0 0 6px; }
.bm-jour { padding: 16px 18px 7px; font: 600 12.5px/1 var(--police); color: var(--encre-3); border-bottom: 1px solid var(--trait); }
.bm-bandeau { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin: 0; padding: 11px 18px; border-bottom: 1px solid var(--trait); background: var(--papier-2); font-size: 13px; color: var(--encre-2); }
.bm-bandeau .bm-lien { color: var(--rouge); text-decoration-color: rgba(217, 58, 49, .35); }
.bm-ligne { position: relative; display: flex; align-items: center; border-bottom: 1px solid var(--trait); color: var(--encre-2); }
.bm-ligne > input { margin-left: 16px; }
.bm-etoile { flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin-left: 5px; padding: 0; border: 0; border-radius: var(--r-s); background: none; color: #a9aec0; cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .12s var(--ease-out); }
.bm-etoile:hover { background: rgba(18, 21, 43, .07); color: var(--encre-2); } .bm-etoile:active { transform: scale(.88); }
.bm-etoile.oui { color: #c98a00; } .bm-etoile.oui .bm-i { fill: #f6c443; }
.bm-corps { flex: 1; min-width: 0; display: grid; grid-template-columns: clamp(150px, 17cqi, 230px) minmax(0, 1fr) auto 86px; align-items: center; gap: 0 14px; min-height: 46px; padding: 4px 18px 4px 8px; border: 0; background: none; color: inherit; font: 400 14px/1.4 var(--police); letter-spacing: -.005em; text-align: left; cursor: pointer; }
.bm-corps:focus-visible { outline-offset: -2px; }
.bm-qui, .bm-objet, .bm-extrait { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-qui { color: var(--encre); }
.bm-sujet { min-width: 0; display: flex; align-items: center; gap: 10px; }
.bm-objet { flex: 0 1 auto; color: var(--encre); } .bm-extrait { flex: 1 1 40px; color: var(--encre-3); }
.bm-marques { flex: none; display: flex; align-items: center; gap: 5px; max-width: 46%; overflow: hidden; } .bm-marques:empty { display: none; }
.bm-marques :is(.chip, .bm-etq) { display: block; flex: 0 1 auto; min-width: 30px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-marques .chip { height: 21px; padding: 0 9px; font-size: 11.5px; line-height: 21px; }
.bm-marques .bm-de-boite { max-width: 116px; flex-shrink: 3; }
.chip.bm-attente { background: var(--surligneur); color: var(--encre); }
.bm-signes { display: flex; gap: 8px; color: var(--encre-3); } .bm-signes i { display: block; } .bm-signes .bm-i { width: 16px; height: 16px; }
.bm-corps time { justify-self: end; font-size: 12.5px; color: var(--encre-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bm-ligne.nonlu :is(.bm-qui, .bm-objet, time) { font-weight: 680; color: var(--encre); }
.bm-ligne.nonlu::before { content: ""; position: absolute; left: 5px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--stylo); }
.bm-ligne:hover { background: var(--papier-2); }
.bm-ligne.coche, .bm-ligne.actif { background: var(--stylo-doux); }
.bm-ligne:is(.coche, .actif) :is(.chip, .bm-etq) { background: var(--papier); }
.bm-ligne.actif { box-shadow: inset 3px 0 0 var(--stylo); } .bm-ligne.actif.nonlu::before { left: 7px; }
.bm-ligne.attend { opacity: .55; pointer-events: none; }
.bm-rapide { position: absolute; right: 10px; top: 50%; display: none; gap: 1px; padding: 1px; border-radius: var(--r-s); background: var(--papier); box-shadow: 0 0 0 1px var(--trait), var(--ombre-1); translate: 0 -50%; }
.bm-rapide .bm-b { min-width: 34px; height: 34px; padding: 0 8px; }
.bm-rapide [data-vite="supprimer"]:hover { background: var(--rouge-doux); color: var(--rouge); }
@media (hover: hover) { .bm-ligne:hover .bm-rapide { display: flex; } .bm-glisse .bm-ligne .bm-rapide { display: none; } }
.bm-suite { display: block; margin: 14px auto 18px; }
.bm-vide { padding: 64px 24px; margin: auto; text-align: center; color: var(--encre-3); font-size: 14px; }
.bm-vide strong { display: block; font-size: 15px; font-weight: 600; color: var(--encre-2); } .bm-vide p { max-width: 46ch; margin: 6px auto 0; } .bm-vide .btn { margin-top: 14px; }
.bm-vignette { position: fixed; left: -999px; top: 0; max-width: 320px; padding: 8px 14px; border-radius: 10px; background: var(--encre); color: #fff; font: 600 13px/1.3 var(--police); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Chargement */
.bm-squelette { list-style: none; margin: 0; padding: 8px 0; animation: bm-pouls 1.3s ease-in-out infinite alternate; }
.bm-squelette li { display: flex; align-items: center; gap: 22px; height: 46px; padding: 0 22px; } .bm-squelette i { height: 11px; border-radius: 6px; background: var(--bureau-2); }
.bm-squelette i:nth-child(1) { width: 16%; } .bm-squelette i:nth-child(2) { flex: 1; max-width: 62%; } .bm-squelette i:nth-child(3) { width: 48px; margin-left: auto; }
#bm-dossiers .bm-squelette li { height: 36px; padding: 0 10px; gap: 10px; } #bm-dossiers .bm-squelette i { background: #d9dde6; } #bm-dossiers .bm-squelette i:nth-child(1) { width: 18px; height: 18px; } #bm-dossiers .bm-squelette i:nth-child(3) { display: none; }
@keyframes bm-pouls { to { opacity: .45; } }

/* Liste étroite (un message est ouvert à côté) : trois lignes par message */
@container bm-liste (max-width: 620px) {
  .bm-jour { padding: 14px 14px 7px; }
  .bm-ligne { align-items: flex-start; } .bm-ligne > input { margin: 15px 0 0 14px; }
  .bm-corps { grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; padding: 11px 2px 11px 10px; }
  .bm-sujet { display: contents; }
  .bm-qui { grid-area: 1 / 1; } .bm-corps time { grid-area: 1 / 2; padding-right: 10px; }
  .bm-objet { grid-area: 2 / 1 / auto / -1; font-size: 13.5px; } .bm-signes { grid-area: 1 / 2; display: none; }
  .bm-extrait { grid-area: 3 / 1 / auto / -1; padding-right: 10px; font-size: 13px; } .bm-extrait:empty { display: none; }
  .bm-marques { grid-area: 4 / 1 / auto / -1; max-width: none; flex-wrap: wrap; margin-top: 5px; padding-right: 8px; }
  .bm-etoile { position: absolute; right: 5px; top: 30px; width: 30px; height: 30px; } .bm-etoile .bm-i { width: 16px; height: 16px; }
  .bm-objet { padding-right: 38px; }
  .bm-ligne.nonlu::before { top: 20px; left: 4px; margin: 0; }
  .bm-rapide { top: 4px; right: 6px; translate: none; } .bm-rapide .bm-b { min-width: 30px; height: 30px; padding: 0 6px; } .bm-rapide .bm-i { width: 16px; height: 16px; }
  .bm-squelette li { height: 74px; }
}
@container bm-milieu (max-width: 620px) {
  .bm-tete { flex-wrap: wrap; } #bm-recherche { order: 3; flex: 1 0 100%; } #bm-compte { display: none; }
  .bm-outils { flex-wrap: wrap; padding-left: 14px; } #bm-ou { margin-left: 0; }
  #bm-lot { flex-wrap: wrap; } #bm-lot .bm-b { min-width: 32px; height: 32px; padding: 0 7px; } #bm-lot strong { margin-right: 4px; } #bm-lot .bm-sep { margin: 0 2px; }
}
/* Liste large et de la place : les boutons du lot portent leur nom */
@container bm-milieu (min-width: 900px) { #bm-lot .bm-b:not(.bm-fin) > span { display: inline; } #bm-lot .bm-b { padding: 0 11px 0 9px; } }
@container bm-milieu (max-width: 1010px) { #bm-lot .bm-b:is([data-action="lu"], [data-action="nonlu"]) > span { display: none; } }

/* ----- Lecture ----- */
#bm-lecture { container: bm-lecture / inline-size; position: relative; background: var(--papier); border-radius: var(--r-l); box-shadow: var(--ombre-2); overflow: hidden; }
.bm-barre { flex: none; display: flex; align-items: center; gap: 2px; min-height: 54px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--trait); }
.bm-groupe { flex: none; display: flex; align-items: center; gap: 1px; } .bm-ranger { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.bm-bout { margin-left: auto; padding-left: 6px; }
.bm-retour { display: none; }
.bm-fermer { margin-left: 5px; background: var(--papier-2); box-shadow: inset 0 0 0 1px var(--trait-fort); color: var(--encre); } .bm-fermer:hover { background: var(--bureau-2); }
.bm-lire { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.bm-entete { padding: 20px 26px 16px; border-bottom: 1px solid var(--trait); }
.bm-entete h2 { margin: 0; font: 680 22px/1.3 var(--police); letter-spacing: -.02em; overflow-wrap: anywhere; }
.bm-m-marques { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 16px; }
.bm-m-marques .chip { height: 24px; } .bm-m-marques .bm-cat { gap: 3px; padding-right: 6px; border: 0; cursor: pointer; } .bm-cat .bm-i { width: 13px; height: 13px; stroke-width: 2.2; opacity: .7; } .bm-cat:hover, .bm-cat[aria-expanded="true"] { box-shadow: inset 0 0 0 1px currentColor; } .bm-m-marques .bm-etq { display: inline-flex; align-items: center; gap: 2px; max-width: 260px; height: 24px; padding: 0 3px 0 9px; font: 600 12px/24px var(--police); }
.bm-etq button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 5px; background: none; color: inherit; cursor: pointer; opacity: .65; } .bm-etq button:hover { opacity: 1; background: rgba(18, 21, 43, .1); } .bm-etq .bm-i { width: 12px; height: 12px; stroke-width: 2.4; }
.bm-ajout-etq { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 6px; border: 0; border-radius: 6px; background: none; box-shadow: inset 0 0 0 1px var(--trait-fort); color: var(--encre-3); font: 600 12px/1 var(--police); cursor: pointer; } .bm-ajout-etq:hover, .bm-ajout-etq[aria-expanded="true"] { color: var(--stylo-fonce); background: var(--stylo-doux); box-shadow: none; } .bm-ajout-etq .bm-i { width: 13px; height: 13px; stroke-width: 2.2; }
.bm-gens { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; }
.bm-gens-qui { flex: 1; min-width: 0; overflow-wrap: anywhere; } .bm-gens p { margin: 0; } .bm-a { font-size: 13px; color: var(--encre-3); } .bm-a .bm-lien { margin-left: 4px; font-weight: 550; }
.bm-gens time { flex: none; padding-top: 2px; font-size: 13px; color: var(--encre-3); } .bm-adresse { font-size: 13px; color: var(--encre-3); } .bm-gens .bm-etoile { margin: -5px -6px 0 0; }
.bm-details { display: grid; gap: 5px; margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r-s); background: var(--papier-2); font-size: 13px; } .bm-details div { display: flex; gap: 12px; } .bm-details dt { flex: 0 0 92px; color: var(--encre-3); } .bm-details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.bm-info { margin: 14px 0 0; padding: 10px 14px; border-radius: var(--r-s); background: var(--papier-2); font-size: 13px; color: var(--encre-2); } .bm-info.alerte { background: var(--ambre-doux); color: var(--ambre); }
.bm-pieces { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.bm-piece { display: flex; align-items: center; gap: 9px; max-width: 100%; min-height: 40px; padding: 8px 14px 8px 11px; border: 1px solid var(--trait-fort); border-radius: var(--r-s); background: var(--papier); color: var(--encre); font: 550 13.5px/1.3 var(--police); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; } .bm-piece:hover { border-color: var(--stylo); background: var(--stylo-doux); }
.bm-piece .bm-i { color: var(--stylo); } .bm-piece span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bm-piece small { flex: none; color: var(--encre-3); font-weight: 400; }
.bm-cadre { display: block; width: 100%; height: 320px; border: 0; background: #fff; }
.bm-texte { padding: 22px 26px 28px; font-size: 15px; line-height: 1.62; max-width: 92ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.bm-m-attente { display: grid; gap: 14px; padding: 26px; animation: bm-pouls 1.1s ease-in-out infinite alternate; } .bm-m-attente i { height: 12px; border-radius: 6px; background: var(--bureau-2); } .bm-m-attente i:nth-child(2) { width: 88%; } .bm-m-attente i:nth-child(3) { width: 94%; } .bm-m-attente i:nth-child(4) { width: 46%; }
.bm-m-pied { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 26px 34px; } .bm-m-pied .bm-i { width: 16px; height: 16px; }
.bm-dest { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); margin: 0; padding: 5px 10px; border-radius: 8px; background: var(--encre); color: #fff; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
@container bm-lecture (max-width: 530px) { .bm-b.principal { padding: 0 9px; } .bm-b.principal > span { display: none; } }
@container bm-lecture (max-width: 455px) { .bm-barre .muet { display: none; } }
@container bm-lecture (max-width: 639px) { .bm-barre { padding: 8px; } .bm-barre .bm-sep { margin: 0 2px; } .bm-barre .bm-b { min-width: 33px; padding: 0 7px; } .bm-entete { padding: 18px 20px 14px; } .bm-texte { padding: 18px 20px 24px; } .bm-m-pied { padding-inline: 20px; } .bm-gens { flex-wrap: wrap; row-gap: 2px; } .bm-gens time { order: 3; flex: 1 0 100%; padding-left: 52px; } }
@container bm-lecture (min-width: 640px) { .bm-fermer > span { display: inline; } .bm-fermer { padding: 0 13px 0 10px; } }
@container bm-lecture (min-width: 835px) { .bm-b.nomme > span { display: inline; } .bm-b.nomme { padding: 0 12px 0 10px; } }
@container bm-lecture (min-width: 975px) { .bm-barre .n2 > span { display: inline; } .bm-barre .n2 { padding: 0 11px 0 9px; } }
@container bm-lecture (min-width: 1050px) { .bm-barre .n3 > span { display: inline; } .bm-barre .n3 { padding: 0 11px 0 9px; } }
@container bm-lecture (min-width: 1230px) { .bm-barre .bm-b:not(.muet) > span { display: inline; } .bm-barre .bm-b:not(.muet):not(.principal) { padding: 0 11px 0 9px; } }
.bm-sans .bm-cote, .bm-sans #bm-lecture, .bm-sans .bm-tete, .bm-sans .bm-outils { display: none; }
.page-boite.bm-sans { grid-template-columns: minmax(0, 1fr); }

/* Annuler la dernière action */
#bm-defaire { position: absolute; z-index: 6; left: 50%; bottom: 26px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 48px); padding: 6px 8px 6px 18px; border-radius: 14px; background: var(--encre); color: #fff; font: 550 13.5px/1.4 var(--police); box-shadow: 0 18px 40px -16px rgba(18, 21, 43, .6); translate: -50% 0; animation: fondu .16s ease; }
#bm-defaire button { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: #c8d0ff; font: 650 13.5px/1 var(--police); cursor: pointer; } #bm-defaire button:hover { background: rgba(255, 255, 255, .12); } #bm-defaire [data-defaire-fermer] { padding: 0 8px; color: rgba(255, 255, 255, .7); } #bm-defaire .bm-i { width: 15px; height: 15px; }
#bm-defaire > span { margin-right: 6px; }
/* Pendant qu'on écrit, la barre se range à gauche : elle ne cache jamais « Envoyer » */
.page-boite:has(.bm-redac:not(.reduit)) #bm-defaire { left: 16px; translate: none; max-width: calc(100% - 690px); }
.page-boite:has(.bm-redac.grand) #bm-defaire { left: 50%; top: 10px; bottom: auto; translate: -50% 0; max-width: calc(100% - 400px); }

/* ----- Menus et bulles ----- */
.bm-menu, .bm-menu *, .bm-bulle { -webkit-app-region: no-drag; }
.bm-menu { position: fixed; inset: auto; margin: 0; min-width: 232px; max-width: min(380px, calc(100vw - 24px)); max-height: min(470px, calc(100dvh - 84px)); padding: 6px; border: 0; border-radius: 16px; overflow-y: auto; background: var(--papier); color: var(--encre); box-shadow: 0 0 0 1px var(--trait), 0 26px 56px -22px rgba(18, 21, 43, .42); animation: bm-menu-in .15s var(--ease-out); }
@keyframes bm-menu-in { from { opacity: 0; transform: scale(.97); } }
.bm-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 12px 6px calc(12px + var(--n, 0) * 14px); border: 0; border-radius: 10px; background: none; color: var(--encre); font: 500 13.5px/1.35 var(--police); text-align: left; cursor: pointer; }
.bm-menu button:hover, .bm-menu button:focus-visible { background: var(--papier-2); outline: none; } .bm-menu button:focus-visible { box-shadow: inset 0 0 0 2px var(--stylo); }
.bm-menu button > .bm-i { width: 17px; height: 17px; color: var(--encre-3); } .bm-menu button.rouge, .bm-menu button.rouge > .bm-i { color: var(--rouge); } .bm-menu button.rouge:hover { background: var(--rouge-doux); }
.bm-menu button > span:not(.initiales) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bm-menu button > b { font-size: 12.5px; color: var(--stylo); }
.bm-menu [aria-checked] > .bm-i:last-child { color: var(--stylo); stroke-width: 2.4; visibility: hidden; } .bm-menu [aria-checked="true"] > .bm-i:last-child, .bm-menu [aria-checked="mixed"] > .bm-i:last-child { visibility: visible; } .bm-menu [aria-checked="mixed"] > .bm-i:last-child { opacity: .4; }
.bm-menu hr { margin: 6px 8px; border: 0; border-top: 1px solid var(--trait); } .bm-menu-titre { margin: 0; padding: 6px 12px 4px; font: 600 12.5px/1.3 var(--police); color: var(--encre-3); }
.bm-menu-filtre { width: 100%; height: 36px; margin-bottom: 4px; padding: 0 12px; font-size: 13.5px; }
.bm-menu-boites button { min-height: 50px; }
.bm-bulle { position: fixed; inset: auto; margin: 0; max-width: 340px; padding: 6px 10px; border: 0; border-radius: 8px; background: var(--encre); color: #fff; font: 550 12.5px/1.3 var(--police); pointer-events: none; overflow: visible; }
.bm-champ { margin-top: 18px; }
.bm-couleurs { margin-top: 16px; } .bm-couleurs > span { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 600; color: var(--encre-2); }
.bm-couleurs label { position: relative; display: inline-block; margin: 0 8px 4px 0; cursor: pointer; } .bm-couleurs input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bm-couleurs i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--p); color: #fff; } .bm-couleurs i .bm-i { visibility: hidden; stroke-width: 2.6; } .bm-couleurs :checked + i .bm-i { visibility: visible; } .bm-couleurs :checked + i { box-shadow: 0 0 0 2px var(--papier), 0 0 0 4px var(--p); } .bm-couleurs :focus-visible + i { box-shadow: 0 0 0 2px var(--papier), 0 0 0 4px var(--stylo); }
.bm-suppr { margin-top: 18px; }

/* ----- Écrire : un volet en bas à droite, à côté du message qu'on lit ----- */
.bm-redac { position: absolute; z-index: 5; right: 22px; bottom: 0; width: min(640px, calc(100% - 44px)); height: min(640px, calc(100% - 10px)); display: flex; border-radius: 18px 18px 0 0; overflow: hidden; background: var(--papier); box-shadow: 0 0 0 1px var(--trait-fort), 0 -6px 60px -14px rgba(18, 21, 43, .4); transition: opacity .18s ease, transform .24s var(--ease-tiroir); }
@starting-style { .bm-redac { opacity: 0; transform: translateY(28px); } }
.bm-redac.grand { left: 22px; right: 22px; width: auto; height: calc(100% - 10px); }
.bm-redac.recoit { box-shadow: 0 0 0 2px var(--stylo), 0 -6px 60px -14px rgba(18, 21, 43, .4); }
.bm-redac form { flex: 1; min-width: 0; display: flex; flex-direction: column; margin: 0; }
.bm-r-tete { flex: none; display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 8px 0 20px; background: var(--encre); color: #fff; } .bm-r-tete h2 { flex: 1; margin: 0; font: 650 14.5px/1 var(--police); letter-spacing: -.01em; } .bm-r-tete .bm-b { color: rgba(255, 255, 255, .75); } .bm-r-tete .bm-b:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.bm-redac.reduit { width: 320px; height: auto; cursor: pointer; } .bm-redac.reduit form > :not(.bm-r-tete) { display: none; }
.bm-r-corps { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 2px 20px 8px; overflow-y: auto; }
.bm-r-ligne { flex: none; display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--trait); font-size: 14px; } .bm-r-ligne:focus-within { border-bottom-color: var(--stylo); }
.bm-r-ligne > span, .bm-r-ligne > label { flex: 0 0 44px; font-size: 13px; color: var(--encre-3); } .bm-r-ligne .nm-a-zone { flex: 1; min-width: 0; }
.bm-r-ligne :is(input, select) { flex: 1; min-width: 0; width: 100%; height: 42px; padding: 0; border: 0; border-radius: 0; background-color: transparent; box-shadow: none; font: 400 14px/1.4 var(--police); color: var(--encre); } .bm-r-ligne :is(input, select):focus { border: 0; box-shadow: none; outline: none; } .bm-r-ligne select { padding-right: 30px; text-overflow: ellipsis; } .bm-r-ligne .bm-lien { font-size: 13px; }
.bm-redac textarea { flex: 1 0 130px; width: 100%; padding: 14px 0 8px; border: 0; border-radius: 0; background: none; box-shadow: none; resize: none; font: 400 14.5px/1.6 var(--police); color: var(--encre); } .bm-redac textarea:focus { border: 0; box-shadow: none; outline: none; }
.bm-citer { flex: none; display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; color: var(--encre-2); } .bm-citer input { width: 16px; height: 16px; accent-color: var(--stylo); }
.bm-jointes { flex: none; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; } .bm-jointes:empty { display: none; } .bm-jointes li { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 8px; background: var(--papier-2); font-size: 13px; } .bm-jointes span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bm-jointes small { color: var(--encre-3); } .bm-jointes button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--encre-2); cursor: pointer; } .bm-jointes button:hover { background: rgba(18, 21, 43, .09); } .bm-jointes .bm-i { width: 15px; height: 15px; }
.bm-r-ia { flex: none; padding: 9px 20px; border-top: 1px solid var(--trait); } .bm-r-ia .reformuler { margin: 0; } .bm-r-ia .nm-etat { margin: 6px 0 0; }
.bm-redac .erreur-form { flex: none; margin: 0; padding: 0 20px; } .bm-redac .erreur-form:empty { display: none; }
.bm-r-pied { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px 16px; } .bm-r-pied .bm-i { width: 16px; height: 16px; } .bm-r-pied [data-e="brouillon"] { margin-left: auto; }

/* ----- Tailles de fenêtre ----- */
@media (max-width: 1500px) { .page-boite { grid-template-columns: 214px minmax(0, 1fr); gap: 14px; padding: 4px 14px 14px 16px; } .page-boite.bm-lecture-ouverte { grid-template-columns: 214px clamp(290px, 22vw, 340px) minmax(0, 1fr); } .bm-redac { right: 14px; } .bm-redac.grand { left: 16px; right: 14px; } }
/* Fenêtre étroite : le message ouvert remplace la liste, « Retour » la ramène */
@media (max-width: 1180px) {
  .page-boite, .page-boite.bm-lecture-ouverte { grid-template-columns: 214px minmax(0, 1fr); }
  .page-boite.bm-lecture-ouverte .bm-milieu { display: none; }
  .bm-retour { display: inline-flex; margin-right: 4px; } .bm-retour > span { display: inline !important; } .bm-fermer { display: none; }
  @container bm-lecture (max-width: 560px) { .bm-retour > span { display: none !important; } }
}
@media (max-width: 1180px) { .page-boite:has(.bm-redac:not(.reduit)) #bm-defaire { left: 16px; top: 8px; bottom: auto; max-width: calc(100% - 190px); } }
@media (max-width: 760px) {
  .page-boite, .page-boite.bm-lecture-ouverte { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
  .bm-cote { flex-flow: row wrap; gap: 8px; } #bm-boite { flex: 1; width: auto; } #bm-dossiers { flex: 1 0 100%; display: flex; gap: 2px; margin: 0; padding: 0; overflow: auto hidden; scrollbar-gutter: auto; } #bm-dossiers .bm-d { flex: none; } .bm-d-titre, .bm-d-plus, .bm-d-voir { display: none; }
  .page-boite.bm-lecture-ouverte .bm-cote { display: none; } .page-boite.bm-lecture-ouverte { grid-template-rows: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { body:not(.animations-toujours) :is(.bm-menu, .bm-squelette, .bm-m-attente, #bm-actualiser.tourne .bm-i) { animation: none; } body:not(.animations-toujours) .bm-redac { transition: opacity .16s ease; transform: none; } }

/* Signature montrée sous le message en cours d'écriture */
.bm-signature{flex:none;margin:0 0 10px;padding:10px 12px;border-left:3px solid #c9cfe0;color:#4a5168;font-size:13px;line-height:1.45}
.bm-signature[hidden]{display:none}
.bm-signature small{display:block;margin-bottom:4px;color:#6b7288}
.bm-signature div{white-space:pre-line;overflow-wrap:anywhere;max-height:110px;overflow:auto}
.bm-signature.sans{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;border-left-color:#c77700;color:#7a4a00}
.bm-signature.sans[hidden]{display:none}

.bm-de .bm-desabo { margin-left: 6px; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
