/* Portail Swiss IT Nexus — système de design, tour 6 (24 septembre 2026).

   Un bulletin de santé de l'entreprise, pas un gabarit d'administration :
   fond groupé teinté d'encre, plaques blanches arrondies, chrome en verre
   dépoli, rouge de marque pour l'action principale et l'endroit où l'on
   est, vert et rouge sémantiques pour la donnée seulement.

   Contrat : bar.md, tour 6 (R1 à R7). Deux ombres en jetons, verre sur trois
   surfaces, dégradé dans les graphiques seulement, six tailles, zéro
   italique, animations de 150 à 700 ms jouées une fois.

   Les noms de classes sont ceux de toujours : les vues ne changent pas pour
   changer d'habit. */

/* L'attribut `hidden` gagne contre nos propres classes : la règle du
   navigateur est dans sa feuille par défaut et perd contre la moindre des
   nôtres. Sans ce !important, « Lecture en cours » s'affichait avant tout envoi. */
[hidden] { display: none !important; }

/* ================================================================ JETONS */
body.portail, body.pconnexion, body.perreur {
  /* Six tailles (R4). Le portail est une application : il redéfinit leurs
     valeurs pour lui seul, le site garde les siennes. */
  --fs-display: 34px;
  --fs-h2: 24px;
  --fs-lead: 17px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-label: 12px;

  /* Encre en trois pas. --ink-45 est foncé d'un cran par rapport au site :
     à 13 px sur le fond groupé, l'ancien gris tombait sous 4,5:1. */
  --ink-45: #5F6F88;
  --fond: #F3F5F8;
  --plaque: #FFFFFF;
  --plaque-2: #F7F8FA;
  --creux: #EEF1F5;
  --trait: rgba(11, 37, 69, .08);
  --trait-fort: rgba(11, 37, 69, .15);
  --vert: #0F7A48;
  --rouge-donnee: #B80716;

  /* R1 : deux élévations, teintées d'encre, décalées vers le bas. */
  --ombre-1: 0 1px 2px rgba(11, 37, 69, .04), 0 6px 16px -8px rgba(11, 37, 69, .10);
  --ombre-2: 0 2px 6px rgba(11, 37, 69, .05), 0 16px 24px -12px rgba(11, 37, 69, .12);

  /* R2 : le verre, pour les trois surfaces qui flottent. */
  --verre: rgba(250, 251, 253, .78);
  --flou: saturate(180%) blur(20px);

  --rayon: 18px;
  --rayon-m: 12px;
  --rayon-s: 10px;
  --anneau: 0 0 0 3px rgba(11, 37, 69, .16);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --t: 200ms var(--ease);

  --barre-onglets: 64px;
  --sure-bas: env(safe-area-inset-bottom, 0px);
  --sure-haut: env(safe-area-inset-top, 0px);

  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink-70);
  background: var(--fond);
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 900px) {
  body.portail, body.pconnexion, body.perreur {
    --fs-display: 30px;
    --fs-h2: 22px;
  }
}

/* ============================================================ SURFACES DU NAVIGATEUR
   La sélection, le curseur, les barres de défilement, l'anneau de focus :
   ce qu'on n'a pas dessiné porte quand même le design. */
.portail ::selection, .pconnexion ::selection { background: rgba(225, 9, 27, .16); color: var(--ink); }
.portail input, .portail textarea, .pconnexion input { caret-color: var(--red); }
.portail input[type="checkbox"], .portail input[type="radio"] { accent-color: var(--ink); }
.portail :focus-visible, .pconnexion :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.portail * { scrollbar-width: thin; scrollbar-color: rgba(11, 37, 69, .22) transparent; }
.portail ::-webkit-scrollbar { width: 10px; height: 10px; }
.portail ::-webkit-scrollbar-thumb { background: rgba(11, 37, 69, .18); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
.portail a { text-underline-offset: 3px; }

/* ============================================================ TYPOGRAPHIE
   Casse de phrase, pas de capitales espacées (R5). Les chiffres s'alignent. */
.portail h1, .portail .h1, .portail h2, .portail .h2, .pconnexion h1, .pconnexion h2 {
  font-weight: 700; letter-spacing: -.022em; line-height: 1.15; color: var(--ink);
}
.portail .h2, .pconnexion .h2 { font-size: var(--fs-h2); }
.portail h3, .portail .h3 { font-size: var(--fs-lead); font-weight: 650; letter-spacing: -.012em; line-height: 1.3; color: var(--ink); }
.portail .lead, .pconnexion .lead, .perreur .lead { font-size: var(--fs-lead); line-height: 1.45; color: var(--ink-70); }
.portail .small, .pconnexion .small, .perreur .small { font-size: var(--fs-small); color: var(--ink-45); line-height: 1.45; }
.portail .label, .pconnexion .label, .perreur .label, .portail h4 {
  font-size: var(--fs-label); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-45);
}
.portail .label-red { color: var(--red); }
.portail .big { font-size: var(--fs-h2); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--ink); }
.portail table, .portail .pkpi-val, .portail .pmontant, .portail b { font-variant-numeric: tabular-nums; }

/* ================================================================ BOUTONS */
.portail .btn, .pconnexion .btn, .perreur .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 18px; border-radius: var(--rayon-s); border: 1px solid transparent;
  font-family: inherit; font-size: var(--fs-body); font-weight: 600; letter-spacing: -.005em; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t), transform 120ms var(--ease);
}
.portail .btn:hover, .pconnexion .btn:hover, .perreur .btn:hover { transform: none; }
.portail .btn:active, .pconnexion .btn:active { transform: scale(.98); }
.portail .btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portail .btn-pri, .pconnexion .btn-pri, .perreur .btn-pri { background: var(--red); color: #fff; box-shadow: 0 1px 2px rgba(11, 37, 69, .10); }
.portail .btn-pri:hover, .pconnexion .btn-pri:hover, .perreur .btn-pri:hover { background: var(--red-press); }
.portail .btn-sec, .perreur .btn-sec { background: var(--plaque); color: var(--ink); border-color: var(--trait-fort); box-shadow: 0 1px 2px rgba(11, 37, 69, .05); }
.portail .btn-sec:hover, .perreur .btn-sec:hover { border-color: rgba(11, 37, 69, .28); background: var(--plaque-2); }
.portail .btn[disabled], .portail .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.portail .pbtn-mini { min-height: 30px; padding: 5px 11px; font-size: var(--fs-small); border-radius: 8px; }
.portail .pbtn-large, .pconnexion .pbtn-large { width: 100%; min-height: 46px; }
.portail .pbtn-danger { color: var(--rouge-donnee); border-color: rgba(184, 7, 22, .35); background: var(--plaque); }
.portail .pbtn-danger:hover { background: var(--plaque-2); border-color: var(--rouge-donnee); color: var(--rouge-donnee); }

/* ================================================================ OSSATURE */
body.portail {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
}

/* ---- barre latérale : verre dépoli (R2) ------------------------------ */
.pnav {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 6px;
  height: 100vh; height: 100dvh; overflow-y: auto;
  padding: 18px 14px 14px;
  background: var(--verre);
  -webkit-backdrop-filter: var(--flou); backdrop-filter: var(--flou);
  border-right: 1px solid var(--trait);
}
.pnav-marque {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 10px 16px;
  font-size: var(--fs-body); font-weight: 700; letter-spacing: -.01em; color: var(--ink);
}
.pnav-marque img { width: 32px; height: 32px; border-radius: 8px; }
.pnav-poignee { display: none; }

.pnav-liens { display: flex; flex-direction: column; gap: 1px; }
.pnav-titre {
  margin: 14px 10px 5px;
  font-size: var(--fs-label); font-weight: 600; color: var(--ink-45);
}
.pnav-liens a {
  position: relative; display: flex; align-items: center; gap: 11px;
  min-height: 36px; padding: 7px 10px; border-radius: var(--rayon-s);
  font-size: var(--fs-body); font-weight: 500; color: var(--ink-70);
  transition: background var(--t), color var(--t);
}
.pnav-liens a svg {
  width: 19px; height: 19px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  color: var(--ink-45); transition: color var(--t);
}
.pnav-liens a:hover { background: rgba(11, 37, 69, .05); color: var(--ink); }
.pnav-liens a:hover svg { color: var(--ink); }
/* L'endroit où l'on est : rouge plein, l'une des deux apparitions (R7). */
.pnav-liens a.on { background: var(--red); color: #fff; font-weight: 600; }
.pnav-liens a.on svg { color: #fff; }
.pnav-liens a.off { color: var(--ink-45); cursor: not-allowed; pointer-events: none; opacity: .6; }
.pnav-compte {
  margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px;
  background: rgba(11, 37, 69, .08); color: var(--ink);
  font-size: var(--fs-label); font-weight: 600; text-align: center;
}
.pnav-liens a.on .pnav-compte { background: rgba(255, 255, 255, .22); color: #fff; }

.pnav-bas { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 10px; }
.pnav-admin a { min-height: 32px; font-size: var(--fs-small); }
.pnav-admin a svg { width: 16px; height: 16px; }

.pnav-pied {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; padding: 8px; border-radius: var(--rayon-m);
  background: var(--plaque); box-shadow: var(--ombre-1);
}
.pnav-moi {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 4px; border-radius: var(--rayon-s); transition: background var(--t);
}
.pnav-moi:hover, .pnav-moi.on { background: var(--plaque-2); }
.pnav-initiales {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: var(--fs-small); font-weight: 700; letter-spacing: .02em;
}
.pnav-qui { display: block; font-size: var(--fs-small); font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnav-role { display: block; font-size: var(--fs-label); color: var(--ink-45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnav-pied form { margin: 0; }
.pnav-sortie {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: var(--rayon-s); background: none; cursor: pointer; color: var(--ink-45);
  font-family: inherit; font-size: var(--fs-small); transition: background var(--t), color var(--t);
}
.pnav-sortie svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pnav-sortie:hover { background: var(--plaque-2); color: var(--rouge-donnee); }

/* ---- contenu ---------------------------------------------------------- */
.pmain { min-width: 0; width: 100%; max-width: 1240px; padding: 36px 44px 88px; }

/* ---- barre haute et barre d'onglets : téléphone seulement --------------- */
.ptop, .ptabs, .pvoile { display: none; }

/* ============================================================ EN-TÊTE DE PAGE */
.ptete {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 24px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.ptete h1, .ptete .h2 { font-size: var(--fs-display); letter-spacing: -.028em; line-height: 1.1; }
.ptete .small { margin-top: 6px; font-size: var(--fs-body); }
/* Le lien de retour au-dessus du titre : une flèche dessinée et un mot, pas
   un surtitre (R5). Il ramène à la liste d’où l’on vient. */
.ptete .label { margin-bottom: 6px; }
.ptete .label a { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-body); font-weight: 500; color: var(--ink-70); transition: color var(--t); }
.ptete .label a::before { content: ""; width: 7px; height: 7px; margin: 0 3px 0 2px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.ptete .label a:hover { color: var(--ink); }
.ptete-cmd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ptete-cmd .pchoix { margin: 0; }

/* ================================================================ MESSAGES */
.pmsg {
  position: relative; display: block;
  margin-bottom: 20px; padding: 13px 16px 13px 34px; border-radius: var(--rayon-m);
  background: var(--plaque); box-shadow: var(--ombre-1);
  font-size: var(--fs-body); color: var(--ink);
  animation: pentre 320ms var(--ease) backwards;
}
/* La pastille est posée à part : un <b> dans le texte reste dans la phrase. */
.pmsg::before {
  content: ""; position: absolute; left: 16px; top: 20px; width: 8px; height: 8px; border-radius: 999px; background: var(--ink-45);
}
.pmsg-ok::before { background: var(--vert); }
.pmsg-err::before { background: var(--rouge-donnee); }
.pmsg-err { color: var(--ink); }
.pnote { margin-top: 16px; max-width: 74ch; color: var(--ink-45); }
.pdiscret { opacity: .72; }
.pdiscret a { color: var(--ink-70); }

/* ================================================================ PLAQUES
   Une plaque blanche par sujet. Jamais de plaque dans une plaque : ce qui
   est posé dedans perd son cadre et son ombre. */
.psection, .pcarte, .pbloc-large, .pbloc, .pvide, .ptable-boite, .pplan-boite, .pecr, .pconseil, .pplan-alertes, .pfacture {
  background: var(--plaque); border-radius: var(--rayon); box-shadow: var(--ombre-1);
}
.psection { margin-top: 20px; padding: 22px 24px; min-width: 0; }
.psection-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 6px; }
.psection-tete .small { max-width: 60ch; }
.psection-tete a.small {
  display: inline-flex; align-items: center; gap: 4px; color: var(--ink-70); font-weight: 500;
  transition: color var(--t);
}
.psection-tete a.small::after { content: "›"; font-size: var(--fs-lead); line-height: 1; transform: translateY(-1px); }
.psection-tete a.small:hover { color: var(--ink); }
.psection .ptable-boite, .pbloc-large .ptable-boite, .pbloc .ptable-boite,
.psection .pcarte, .psection .pbloc, .psection .pecr {
  box-shadow: none; border-radius: 0; background: transparent;
}
.psection .ptable-boite { margin: 8px -24px -22px; }
.psection .ptable-boite .ptable th:first-child, .psection .ptable-boite .ptable td:first-child { padding-left: 24px; }
.psection .ptable-boite .ptable th:last-child, .psection .ptable-boite .ptable td:last-child { padding-right: 24px; }

.pcartes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pcartes-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pcarte {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0;
  padding: 20px 22px; transition: box-shadow var(--t), transform var(--t);
}
a.pcarte:hover { box-shadow: var(--ombre-2); transform: translateY(-2px); }
.pcarte .btn { margin-top: auto; }
.pcarte .big { margin: 2px 0; }
.pcarte-att { color: var(--ink-45); }
.pcarte-att .lead { font-size: var(--fs-body); color: var(--ink-70); }
.pcarte-marge { box-shadow: var(--ombre-1), inset 0 0 0 1px var(--trait-fort); }

.pbloc-large { margin-top: 20px; padding: 22px 24px; min-width: 0; }
.pdeux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.pdeux .pbloc-large, .pdeux > .psection { margin-top: 20px; }
.pdeux-tiers { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pdeux-tiers > .psection { margin-top: 20px; }

/* ================================================================ LISTES */
.pliste { list-style: none; padding: 0; margin: 12px 0 0; }
.pliste li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; min-width: 0; padding: 12px 0; border-top: 1px solid var(--trait); }
.pliste li:first-child { border-top: 0; }
.pliste li > * { min-width: 0; overflow-wrap: anywhere; }
.pliste li .pnul { margin-left: auto; }

/* La liste d'actions : des rangées qu'on touche, pas des lignes qu'on lit. */
.pactions-liste { list-style: none; padding: 0; margin: 8px -12px 0; }
.pactions-liste li {
  position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: var(--rayon-m); transition: background var(--t);
}
.pactions-liste li + li::before { content: ""; position: absolute; top: 0; left: 62px; right: 12px; height: 1px; background: var(--trait); }
.pactions-liste li:hover { background: var(--plaque-2); }
.pactions-liste li:hover::before, .pactions-liste li:hover + li::before { opacity: 0; }
.pactions-liste .pico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--creux); color: var(--ink-70); }
.pactions-liste .pico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pactions-liste .pico-att { background: var(--creux); color: var(--rouge-donnee); }
.pactions-liste .plien-fort { display: block; font-weight: 600; color: var(--ink); }
.pactions-liste .plien-fort::after { content: ""; position: absolute; inset: 0; border-radius: var(--rayon-m); }
.pactions-liste .small { display: block; margin-top: 1px; }
.pactions-liste .pmontant { font-weight: 650; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pactions-liste .pmontant-att { color: var(--rouge-donnee); }
.pactions-liste .pmontant-nul { color: var(--ink-45); font-weight: 500; }

/* Les plus gros postes : la longueur de la barre porte la hiérarchie,
   pas la couleur (apport de l'atlas céleste). */
.pbarres {
  list-style: none; padding: 0; margin: 12px 0 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 140px) max-content;
  column-gap: 14px; row-gap: 12px; align-items: center;
}
.pbarres li { display: contents; }
.pbarres-nom { font-size: var(--fs-body); color: var(--ink); overflow-wrap: anywhere; }
.pbarres-piste { height: 8px; background: var(--creux); border-radius: 999px; overflow: hidden; }
.pbarres-part { display: block; height: 100%; min-width: 4px; background: var(--ink); border-radius: 999px; transform-origin: left center; }
.pbarres-val { font-size: var(--fs-body); font-weight: 650; color: var(--ink); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.pbarres-nu { grid-template-columns: minmax(0, 1fr) max-content; margin-top: 10px; }

.pdef { display: grid; grid-template-columns: minmax(0, 1fr) max-content; column-gap: 12px; row-gap: 10px; margin: 14px 0 0; }
.pdef dt { font-size: var(--fs-body); color: var(--ink-70); }
.pdef dd { margin: 0; font-size: var(--fs-body); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

/* ================================================================ TABLEAUX */
.ptable-boite { overflow-x: auto; min-width: 0; }
.ptable { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.ptable th {
  text-align: left; padding: 12px 16px;
  font-size: var(--fs-small); font-weight: 600; color: var(--ink-45);
  border-bottom: 1px solid var(--trait); white-space: nowrap;
}
.ptable td { padding: 13px 16px; border-top: 1px solid var(--trait); vertical-align: top; color: var(--ink-70); }
.ptable tbody tr:first-child td { border-top: 0; }
.ptable tbody tr { transition: background var(--t); }
.ptable tbody tr:hover { background: var(--plaque-2); }
.ptable td .small { display: block; margin-top: 2px; }
.ptable .pdroite { text-align: right; font-variant-numeric: tabular-nums; }
.ptable tfoot td { border-top: 1px solid var(--trait-fort); font-weight: 700; color: var(--ink); background: var(--plaque-2); }
.ptable .ptable-jour td {
  padding: 16px 16px 6px; border-top: 1px solid var(--trait); background: var(--plaque-2);
  font-size: var(--fs-small); font-weight: 600; color: var(--ink-45);
}
.ptable tbody .ptable-jour:first-child td { border-top: 0; }
.ptable .ptable-jour span { float: right; font-weight: 500; }
.plien-fort { font-weight: 600; color: var(--ink); transition: color var(--t); }
.plien-fort:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--trait-fort); }
.pnul { color: var(--ink-45); }
.pdroite { text-align: right; }
.pcentre { text-align: center; }
.pfort { font-weight: 700; color: var(--ink); }
.pretard { color: var(--rouge-donnee); font-weight: 600; }
.psorti td { color: var(--ink-45); }
.pdevise { font-size: var(--fs-small); font-weight: 500; color: var(--ink-45); margin-left: 6px; }
.pnum { color: var(--ink-45); font-variant-numeric: tabular-nums; }

/* ---- pastilles d'état --------------------------------------------------- */
.ppuce {
  display: inline-flex; align-items: center; gap: 5px; margin: 0 4px 4px 0; padding: 3px 9px;
  border-radius: 999px; background: var(--creux); color: var(--ink-70);
  font-size: var(--fs-label); font-weight: 600; white-space: nowrap; line-height: 1.35;
}
.ppuce-ok { color: var(--ink-45); }
.ppuce-off { background: transparent; box-shadow: inset 0 0 0 1px var(--trait-fort); color: var(--ink-45); }
.ppuce-proche { background: rgba(11, 37, 69, .10); color: var(--ink); }
.ppuce-fort, .ppuce-employe { background: var(--ink); color: #fff; }
.ppuce-att { background: var(--creux); color: var(--rouge-donnee); }
.ppuce-client { background: rgba(11, 37, 69, .10); color: var(--ink); }
.ppuce-fournisseur { background: var(--creux); color: var(--ink-70); }

/* ---- état vide : il enseigne, il ne constate pas ------------------------ */
.pvide { padding: 48px 32px; text-align: center; }
.pvide .lead { color: var(--ink); font-weight: 600; }
.pvide .small { margin: 8px auto 22px; max-width: 48ch; }

/* ---- segments : filtres, onglets, bascules ------------------------------
   Le contrôle segmenté d'iOS : un rail creux, l'option choisie posée dessus. */
.pfiltres, .pfiltres-roles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.pfiltres a, .pfiltre {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 14px;
  border-radius: 999px; background: var(--plaque); box-shadow: inset 0 0 0 1px var(--trait);
  font-size: var(--fs-small); font-weight: 500; color: var(--ink-70);
  transition: background var(--t), color var(--t), box-shadow var(--t);
}
.pfiltre span { font-size: var(--fs-label); color: var(--ink-45); }
.pfiltres a:hover, .pfiltre:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.pfiltres a.on, .pfiltre.on { background: var(--ink); color: #fff; box-shadow: none; font-weight: 600; }
.pfiltre.on span { color: rgba(255, 255, 255, .72); }
.pfiltre-att.on { background: var(--ink); }

.ponglets, .pbascule-vue {
  display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 22px;
  border-radius: var(--rayon-m); background: var(--creux); max-width: 100%; overflow-x: auto;
}
.ponglets a, .pbascule-vue a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 6px 16px;
  border-radius: 9px; white-space: nowrap;
  font-size: var(--fs-small); font-weight: 500; color: var(--ink-70);
  transition: background var(--t), color var(--t), box-shadow var(--t);
}
.ponglets a:hover, .pbascule-vue a:hover { color: var(--ink); }
.ponglets a.on, .pbascule-vue a.on { background: var(--plaque); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(11, 37, 69, .12); }

.pmois-nav { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--rayon-m); background: var(--plaque); box-shadow: var(--ombre-1); }
.pmois-nav a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--ink-70); transition: background var(--t), color var(--t); }
.pmois-nav a:hover { background: var(--plaque-2); color: var(--ink); }
.pmois-nav a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pmois-nav select { border: 0; background: transparent; font-family: inherit; font-size: var(--fs-body); font-weight: 600; color: var(--ink); padding: 4px 6px; cursor: pointer; }
.pmois-nav select:focus { outline: none; }
.pmois-nav-txt { width: auto !important; padding: 0 10px; font-size: var(--fs-small); font-weight: 500; white-space: nowrap; }

/* ---- recherche -------------------------------------------------------- */
.precherche { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.precherche input, .precherche select {
  flex: 1; max-width: 420px; min-height: 40px; padding: 9px 14px 9px 38px;
  border: 0; border-radius: var(--rayon-s); background: var(--creux)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6F88' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 17px;
  font-family: inherit; font-size: var(--fs-body); color: var(--ink);
  transition: background-color var(--t), box-shadow var(--t);
}
.precherche select { padding-left: 14px; background-image: none; }
.precherche input:focus, .precherche select:focus { outline: none; background-color: var(--plaque); box-shadow: inset 0 0 0 1px var(--ink), var(--anneau); }

/* ============================================================ FORMULAIRES */
/* Un champ posé hors d'un .pchamp garde la même forme que les autres ; les
   règles plus précises qui suivent l'emportent là où elles s'appliquent. */
:where(.pmain) :where(select, input[type="text"], input[type="number"], input[type="date"]) {
  min-height: 38px; padding: 7px 12px; border: 1px solid var(--trait-fort); border-radius: var(--rayon-s);
  background-color: var(--plaque); font-family: inherit; font-size: var(--fs-body); color: var(--ink);
}
.pform { max-width: 880px; }
.pbloc { margin: 0 0 16px; padding: 22px 24px; border: 0; min-width: 0; }
.pbloc legend {
  float: left; width: 100%; padding: 0; margin: 0 0 4px;
  font-size: var(--fs-lead); font-weight: 650; letter-spacing: -.012em; color: var(--ink);
}
.pbloc legend + * { clear: both; }
.pgrille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.pchamp { display: flex; flex-direction: column; gap: 6px; grid-column: span 2; min-width: 0; }
.pchamp-large { grid-column: 1 / -1; }
.pchamp-court { grid-column: span 1; }
.pchamp > span { font-size: var(--fs-small); font-weight: 600; color: var(--ink-70); }
.pchamp > span.pchamp-aide { font-size: var(--fs-small); font-weight: 400; color: var(--ink-45); line-height: 1.45; }
.pchamp > span.pchamp-err, .pchamp-err { font-size: var(--fs-small); font-weight: 500; color: var(--rouge-donnee); }
.pchamp-aide a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--trait-fort); }

.pchamp input, .pchamp select, .pchamp textarea,
.pligne input, .pligne select,
.pt-horaires input, .pt-semainetype input, .pt-ouverture input, .pointage-h, .psaisie input, .psaisie select {
  width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
  min-height: 42px; padding: 10px 13px;
  border: 1px solid var(--trait-fort); border-radius: var(--rayon-s); background: var(--plaque);
  font-family: inherit; font-size: var(--fs-body); color: var(--ink);
  transition: border-color var(--t), box-shadow var(--t);
  -webkit-appearance: none; appearance: none;
}
.pchamp select, .pligne select, .psaisie select, .precherche select {
  padding-right: 34px;
  background: var(--plaque) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6F88' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center / 16px;
}
.precherche select { background-color: var(--creux); }
.pchamp textarea { resize: vertical; line-height: 1.5; min-height: 96px; }
.pchamp input:hover, .pchamp select:hover, .pchamp textarea:hover { border-color: rgba(11, 37, 69, .26); }
.pchamp input:focus, .pchamp select:focus, .pchamp textarea:focus,
.pligne input:focus, .pligne select:focus,
.pt-horaires input:focus, .pt-semainetype input:focus, .pt-ouverture input:focus, .pointage-h:focus {
  outline: none; border-color: var(--ink); box-shadow: var(--anneau);
}
.pchamp input[readonly], .pchamp input:disabled, .pchamp select:disabled { background-color: var(--plaque-2); color: var(--ink-45); }
.pchamp input[type="file"] { padding: 8px; min-height: 0; }
.pchamp input[type="checkbox"], .pchamp input[type="radio"] { width: auto; min-height: 0; -webkit-appearance: auto; appearance: auto; }
.pinvisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pcoches { display: flex; gap: 10px 22px; flex-wrap: wrap; margin-top: 16px; }
.popt { display: inline-flex; align-items: center; gap: 9px; font-size: var(--fs-body); color: var(--ink-70); cursor: pointer; }
.popt input { width: 18px; height: 18px; margin: 0; }

.pactions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.pactions-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.pactions-ligne form { margin: 0; }

.pdepot {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 18px; padding: 48px 32px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--trait-fort); border-radius: var(--rayon); background: var(--plaque);
  transition: border-color var(--t), background var(--t);
}
.pdepot:hover, .pdepot.on { border-color: var(--ink); background: var(--plaque-2); }
.pdepot-ico { width: 32px; height: 32px; margin-bottom: 6px; fill: none; stroke: var(--ink-45); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pdepot.on .pdepot-ico { stroke: var(--ink); }
.pdepot-liste { margin-top: 10px; color: var(--ink); font-weight: 600; }

.petapes { margin: 16px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.petapes li { font-size: var(--fs-body); color: var(--ink-70); }

/* Le choix qui décide de la comptabilisation : trois options ouvertes. Ce
   qui ne se défait pas se dit avant le geste (apport de la chambre noire). */
.pdecision { display: grid; gap: 8px; margin-top: 16px; }
.pdecision-opt {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 14px 16px; border-radius: var(--rayon-m); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--trait-fort); transition: box-shadow var(--t), background var(--t);
}
.pdecision-opt:hover { box-shadow: inset 0 0 0 1px rgba(11, 37, 69, .3); }
.pdecision-opt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ink); background: var(--plaque-2); }
.pdecision-opt input { margin-top: 3px; width: 18px; height: 18px; }
.pdecision-opt > span { display: grid; gap: 2px; }
.pdecision-opt b { font-size: var(--fs-body); color: var(--ink); }
.pdecision-opt .small { color: var(--ink-70); }

.pcalcul {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--rayon-m);
  background: var(--plaque-2); font-size: var(--fs-body); color: var(--ink-70);
}
.pcalcul b { color: var(--ink); }
.pcalcul-tot { white-space: nowrap; }

.pmdp {
  margin: 8px 0; padding: 12px 16px; border-radius: var(--rayon-s); background: var(--plaque-2);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--fs-lead); letter-spacing: .06em; color: var(--ink); user-select: all;
}

/* ============================================================ SÉLECTEUR DE PÉRIODE
   Un bouton qui dit la période retenue, un panneau qui s'ouvre. Bâti sur
   <details> : aucun JavaScript, clavier et lecteurs d'écran natifs. */
.pchoix { position: relative; display: inline-block; margin: 0; }
.pchoix-bouton {
  display: inline-flex; align-items: center; gap: 9px; min-height: 40px;
  padding: 8px 12px 8px 14px; border-radius: var(--rayon-s);
  background: var(--plaque); box-shadow: var(--ombre-1), inset 0 0 0 1px var(--trait);
  cursor: pointer; list-style: none; transition: box-shadow var(--t);
}
.pchoix-bouton::-webkit-details-marker { display: none; }
.pchoix-bouton:hover { box-shadow: var(--ombre-2), inset 0 0 0 1px var(--trait-fort); }
.pchoix-quoi { font-size: var(--fs-small); font-weight: 500; color: var(--ink-45); }
.pchoix-valeur { font-size: var(--fs-body); font-weight: 600; color: var(--ink); }
.pchoix-chevron { width: 16px; height: 16px; fill: none; stroke: var(--ink-45); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--t); }
.pchoix[open] .pchoix-chevron { transform: rotate(180deg); }
.pchoix-panneau {
  position: absolute; z-index: 30; top: calc(100% + 8px); right: 0;
  min-width: 300px; padding: 8px;
  border-radius: 16px; background: var(--plaque); box-shadow: var(--ombre-2), 0 0 0 1px var(--trait);
  transform-origin: top right; animation: ppop 220ms var(--ease) both;
}
.pchoix-titre { padding: 10px 10px 4px; font-size: var(--fs-small); font-weight: 600; color: var(--ink-45); }
.pchoix-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 38px; padding: 8px 10px; border-radius: 9px;
  font-size: var(--fs-body); color: var(--ink-70); transition: background var(--t), color var(--t);
}
.pchoix-option:hover { background: var(--plaque-2); color: var(--ink); }
.pchoix-option.on { color: var(--ink); font-weight: 600; }
.pchoix-coche { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.pchoix-dates { display: flex; align-items: center; gap: 6px; padding: 4px 6px 6px; }
.pchoix-dates input, .pchoix-dates select {
  width: 100%; min-width: 0; min-height: 36px; padding: 6px 8px;
  border: 1px solid var(--trait-fort); border-radius: 9px;
  font-family: inherit; font-size: var(--fs-small); color: var(--ink); background: var(--plaque);
}

/* ============================================================ CHIFFRES CLÉS
   Une seule grille d'étiquette pour toutes les cartes du portail : la
   légende, la valeur, la variation (apport de la boîte à chaussures). */
.pkpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.pkpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pkpi {
  position: relative; display: grid; grid-template-rows: auto auto auto 1fr; gap: 4px; min-width: 0;
  padding: 18px 20px 16px; border-radius: var(--rayon); background: var(--plaque); box-shadow: var(--ombre-1);
  transition: box-shadow var(--t), transform var(--t);
}
.pkpi:hover { box-shadow: var(--ombre-2); transform: translateY(-2px); }
.pkpi-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pkpi-tete .label { font-size: var(--fs-small); font-weight: 600; color: var(--ink-70); }
.pkpi-tete svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: var(--ink-45); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pkpi-val {
  font-size: var(--fs-display); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--ink);
  white-space: nowrap; font-variant-numeric: tabular-nums; margin-top: 4px;
}
.pkpi-val small { font-size: var(--fs-small); font-weight: 600; letter-spacing: 0; color: var(--ink-45); margin-left: 5px; }
.pkpi-bas { display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; font-size: var(--fs-small); color: var(--ink-45); }
.pkpi-fort { box-shadow: var(--ombre-1), inset 0 0 0 1.5px var(--ink); }
.pkpi-fort:hover { box-shadow: var(--ombre-2), inset 0 0 0 1.5px var(--ink); }
.pkpi-spark { display: block; width: 100%; height: 40px; margin-top: 10px; align-self: end; overflow: visible; }
.pkpi-spark path { fill: none; stroke: var(--ink-45); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pkpi-spark .pspark-aire { stroke: none; fill: url(#pspark-degrade); }
.pkpi-spark circle { fill: var(--ink); stroke: var(--plaque); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pkpi-fort .pkpi-spark path:not(.pspark-aire) { stroke: var(--ink); }

/* ---- la variation : signe et flèche toujours, la couleur souligne (4 bis) */
.pvar { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; white-space: nowrap; }
.pvar-bon { color: var(--vert); }
.pvar-mauvais { color: var(--rouge-donnee); }
.pvar-nul { color: var(--ink-45); font-weight: 500; }
.pvar span { font-size: .82em; }
.pvar-abs { color: var(--ink-45); font-weight: 500; }

/* ---- le verdict : une phrase avant tout chiffre --------------------------
   Plus de trait coloré à gauche : l'état se dit par une pastille qui porte
   un mot et un signe, la phrase porte le reste. */
.pverdict {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin-bottom: 4px; padding: 20px 24px; border-radius: var(--rayon); background: var(--plaque); box-shadow: var(--ombre-1);
}
/* La pastille d’état : un signe et un mot, à côté de la phrase. La couleur
   sémantique ne teint que le signe et le mot, jamais le fond (4 bis). */
.pverdict-etat {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 5px 12px 5px 9px; border-radius: 999px; background: var(--creux);
  font-size: var(--fs-small); font-weight: 650; color: var(--ink-70); white-space: nowrap;
}
.pverdict-etat svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pverdict-bon .pverdict-etat { color: var(--vert); }
.pverdict-moyen .pverdict-etat { color: var(--ink); }
.pverdict-mauvais .pverdict-etat { color: var(--rouge-donnee); }
.pverdict .lead { flex: 1 1 320px; min-width: 0; }
.pverdict .small { flex-basis: 100%; }
.pverdict .lead { font-size: var(--fs-lead); font-weight: 650; color: var(--ink); letter-spacing: -.01em; }
.pverdict .small { max-width: 72ch; font-size: var(--fs-body); color: var(--ink-70); }

/* ============================================================ GRAPHIQUE D'ACTIVITÉ
   Vert ce qui rentre, rouge ce qui sort, encre la marge cumulée (4 bis).
   Le geste signature : la ligne de lecture. Survoler ou glisser le doigt
   déplace un repère vertical à travers les deux dessins et une bulle lit
   la journée. */
.pgraph { position: relative; margin: 14px 0 0; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.pgraph-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pgraph-grille { stroke: var(--trait); stroke-width: 1; }
.pgraph-axe { stroke: var(--trait-fort); stroke-width: 1; }
.pgraph-zero { stroke: var(--trait-fort); stroke-width: 1; stroke-dasharray: 3 3; }

.pgraph-entree { fill: var(--vert); }
.pgraph-sortie { fill: var(--rouge-donnee); }
.pgraph-barre { transition: opacity 160ms var(--ease); }
.pgraph-echelle, .pgraph-jour, .pgraph-titre { font-family: inherit; fill: var(--ink-45); font-size: 13px; }
.pgraph-echelle { text-anchor: end; font-variant-numeric: tabular-nums; }
.pgraph-jour { text-anchor: middle; }
.pgraph-titre { font-weight: 600; fill: var(--ink-70); }
.pgraph-zone { fill: transparent; }
.pgraph-actif .pgraph-barre { opacity: .28; }
.pgraph-actif .pgraph-barre.pgraph-vise { opacity: 1; }

.pgraph-cumul { margin-top: 4px; }
.pgraph-aire { fill: url(#pgraph-degrade); }
.pgraph-ligne { fill: none; stroke: var(--ink); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.pgraph-fin { stroke: var(--plaque); stroke-width: 2.5; }
.pgraph-fin-bon { fill: var(--vert); }
.pgraph-fin-mauvais { fill: var(--rouge-donnee); }
.pgraph-curseur { fill: var(--ink); stroke: var(--plaque); stroke-width: 2.5; opacity: 0; transition: opacity 120ms; }
.pgraph-actif .pgraph-curseur { opacity: 1; }

.pgraph-guide {
  position: absolute; top: 10px; bottom: 6px; width: 1px; background: var(--ink); opacity: 0;
  pointer-events: none; transition: opacity 120ms;
}
.pgraph-actif .pgraph-guide { opacity: .35; }

.pgraph-bulle {
  position: absolute; z-index: 5; top: 0; left: 0; pointer-events: none; min-width: 200px;
  padding: 11px 13px; border-radius: 14px;
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: var(--flou); backdrop-filter: var(--flou);
  box-shadow: var(--ombre-2), 0 0 0 1px var(--trait);
  font-size: var(--fs-small); color: var(--ink-70); line-height: 1.55;
}
.pgraph-bulle b { display: block; margin-bottom: 4px; font-size: var(--fs-small); color: var(--ink); }
.pgraph-bulle > span { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.pgraph-bulle > span > span:first-child { display: inline-flex; align-items: center; }
.pgraph-bulle i { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 999px; vertical-align: 1px; }
.pgraph-bulle .pgraph-b-in i { background: var(--vert); }
.pgraph-bulle .pgraph-b-out i { background: var(--rouge-donnee); }
.pgraph-bulle .pgraph-b-net { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--trait); color: var(--ink); font-weight: 650; }

.pgraph-legende { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; font-size: var(--fs-small); color: var(--ink-70); }
.pgraph-legende span { display: inline-flex; align-items: center; gap: 7px; }
.pgraph-cle { display: inline-block; width: 10px; height: 10px; border-radius: 999px; }
.pgraph-cle-in { background: var(--vert); }
.pgraph-cle-out { background: var(--rouge-donnee); }
.pgraph-cle-marge { width: 16px; height: 3px; border-radius: 2px; background: var(--ink); }

/* ============================================================ ANNEAU
   Où va chaque franc. Le trou du centre porte ce qui reste ; survoler une
   part ou sa ligne de légende l'isole et estompe les autres. */
.pdonut { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: center; margin-top: 16px; }
.pdonut-compact { grid-template-columns: 168px minmax(0, 1fr); gap: 22px; }
.pdonut-dessin svg { display: block; width: 100%; height: auto; overflow: visible; }
.pdonut-fond { fill: none; stroke: var(--creux); stroke-width: 24; }
.pdonut-arc { fill: none; stroke-width: 24; stroke-linecap: butt; transition: stroke-width 180ms var(--ease), opacity 180ms var(--ease); cursor: default; }
.pdonut-c1 { stroke: var(--cat-achats); }
.pdonut-c2 { stroke: var(--cat-salaires); }
.pdonut-c3 { stroke: var(--cat-loyer); }
.pdonut-c4 { stroke: var(--cat-autres); }
.pdonut-reste { stroke: var(--vert); }
.pdonut-isole .pdonut-arc { opacity: .25; }
.pdonut-isole .pdonut-arc.pdonut-vise { opacity: 1; }
.pdonut-arc.pdonut-vise { stroke-width: 30; }
.pdonut-titre { font-family: inherit; fill: var(--ink-45); font-size: 13px; font-weight: 600; text-anchor: middle; }
.pdonut-valeur { font-family: inherit; font-size: 30px; font-weight: 700; letter-spacing: -.02em; text-anchor: middle; }
.pdonut-bon { fill: var(--vert); }
.pdonut-mauvais { fill: var(--rouge-donnee); }

.pdonut-legende { list-style: none; padding: 0; margin: 0; }
.pdonut-legende li {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 12px; align-items: baseline;
  margin: 0 -8px; padding: 8px; border-radius: 9px; font-size: var(--fs-body);
  transition: background var(--t), opacity var(--t);
}
.pdonut-legende li + li { box-shadow: inset 0 1px 0 var(--trait); }
.pdonut-legende li:hover, .pdonut-legende li.pdonut-vise { background: var(--plaque-2); box-shadow: none; }
.pdonut-isole .pdonut-legende li:not(.pdonut-vise) { opacity: .45; }
.pdonut-cle { width: 10px; height: 10px; border-radius: 999px; align-self: center; box-shadow: inset 0 0 0 1px rgba(11, 37, 69, .14); }
.pdonut-cle.pdonut-c1 { background: var(--cat-achats); }
.pdonut-cle.pdonut-c2 { background: var(--cat-salaires); }
.pdonut-cle.pdonut-c3 { background: var(--cat-loyer); }
.pdonut-cle.pdonut-c4 { background: var(--cat-autres); }
.pdonut-cle.pdonut-reste { background: var(--vert); }
.pdonut-rouge { background: var(--rouge-donnee); }
.pdonut-nom { color: var(--ink); }
.pdonut-part { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pdonut-montant { color: var(--ink-45); font-variant-numeric: tabular-nums; }
.pdonut-deficit .pdonut-part { color: var(--rouge-donnee); }

/* ====================================== PALETTE CATÉGORIELLE DE L'ANNEAU
   Règle 4 ter de la barre. Validée au calcul le 11 septembre 2026, sur
   toutes les paires et non seulement les arcs voisins :
     bande de clarté OKLCH ........ 5/5 dans 0,43–0,77
     plancher de chroma ........... 5/5 au-dessus de 0,10
     daltonisme protan / deutan ... pire paire 9,6 pour une cible de 8
     vision normale ............... pire paire 17,6 pour un plancher de 15
     contraste sur blanc .......... bleu ciel à 2,31:1, acceptable parce
                                    que la légende nomme et chiffre chaque part.
   Ne colore que l'anneau et sa légende. Toute retouche se remesure. */
:root {
  --cat-achats:   #C77F00;
  --cat-salaires: #0072B2;
  --cat-loyer:    #CC79A7;
  --cat-autres:   #56B4E9;
}

/* ============================================================ CONSEILS ET ALERTES
   L'état se dit par une pastille ronde, jamais par un trait coloré épais. */
.pconseils { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 12px; }
.pconseil { position: relative; padding: 16px 20px 16px 38px; }
.pconseil::before { content: ""; position: absolute; left: 18px; top: 23px; width: 8px; height: 8px; border-radius: 999px; background: var(--trait-fort); }
.pconseil-bon::before { background: var(--vert); }
.pconseil-moyen::before { background: var(--ink); }
.pconseil-mauvais::before { background: var(--rouge-donnee); }
.pconseil-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pconseil-titre { font-size: var(--fs-body); font-weight: 650; color: var(--ink); }
.pconseil-mesure { font-size: var(--fs-lead); font-weight: 700; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pconseil-attendu { color: var(--ink-45); margin-top: 2px; }
.pconseil-piste { margin-top: 8px; max-width: 74ch; }

.pplan-alertes { margin-bottom: 18px; padding: 16px 20px; }
.pplan-alertes ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.pplan-alertes .small { margin-top: 12px; }
.palerte { position: relative; padding-left: 18px; font-size: var(--fs-body); color: var(--ink-70); }
.palerte::before { content: ""; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 999px; background: var(--trait-fort); }
.palerte-mauvais::before { background: var(--rouge-donnee); }
.palerte-moyen::before { background: var(--ink); }

/* ============================================================ COMPTABILITÉ */
.pbilan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.pbilan-col .label { display: block; margin-bottom: 8px; }
.pbilan-lignes { list-style: none; padding: 0; margin: 0; }
.pbilan-lignes li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--trait); font-size: var(--fs-body); }
.pbilan-lignes li:first-child { border-top: 0; }
.pbilan-lignes li a { color: var(--ink); }
.pbilan-lignes li a:hover { color: var(--ink); }
.pbilan-lignes li .pnum { margin-right: 8px; }
.pbilan-lignes li b { white-space: nowrap; }
.pbilan-total { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--trait-fort); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.presultat, .ptotaux-paie, .pvac, .pjour-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.ptotaux-paie, .pvac, .pjour-chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.presultat div, .ptotaux-paie div, .pvac div, .pjour-chiffres div {
  min-width: 0; padding: 14px 16px; border-radius: var(--rayon-m); background: var(--plaque-2);
}
.psection .presultat div, .psection .pvac div { background: var(--plaque-2); }
.pjour-chiffres div { background: var(--plaque); box-shadow: var(--ombre-1); }
.presultat .label, .ptotaux-paie .label, .pvac .label { display: block; margin-bottom: 4px; }
.pjour-chiffres .label { display: block; margin-top: 2px; }
.presultat b, .ptotaux-paie b, .pvac b, .pjour-chiffres b {
  display: block; font-size: var(--fs-h2); font-weight: 700; letter-spacing: -.02em; color: var(--ink);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pvac .small { display: block; margin-top: 2px; }
.pvac-fort { background: var(--plaque) !important; box-shadow: inset 0 0 0 1.5px var(--ink); }
.pfleche-resultat { font-size: var(--fs-small); margin-top: 2px; }
.ptva-lignes { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.ptva-lignes li { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-body); color: var(--ink-70); }
.ptva-lignes li b { color: var(--ink); }
.ptva-du { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--trait); font-weight: 700; color: var(--ink); }

.pjournal { display: flex; flex-direction: column; gap: 12px; }
.pecr { padding: 16px 20px; }
.pecr-annulee { opacity: .55; }
.pecr-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pecr-etat { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pecr-montant { font-size: var(--fs-lead); font-weight: 700; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pecr-lignes { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: var(--fs-small); }
.pecr-lignes td { padding: 6px 8px; border-top: 1px solid var(--trait); color: var(--ink-70); vertical-align: top; }
.pecr-lignes td .small { display: block; }
.pecr-cpt { color: var(--ink-45); width: 56px; font-variant-numeric: tabular-nums; }
.pecr-total td { border-top: 1px solid var(--trait-fort); }
.psaisie td { padding: 8px; }

/* ============================================================ SCAN */
.pscan { max-width: 580px; }
.pscan-boutons { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.pscan-depot {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer;
  padding: 52px 32px; border: 1.5px dashed var(--trait-fort); border-radius: var(--rayon); background: var(--plaque);
  transition: border-color var(--t), background var(--t);
}
.pscan-depot:hover, .pscan-depot.on { border-color: var(--ink); background: var(--plaque-2); }
.pscan-depot svg { width: 36px; height: 36px; margin-bottom: 4px; fill: none; stroke: var(--ink-45); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pscan-depot.on svg { stroke: var(--ink); }
.pscan-depot .lead { font-weight: 650; color: var(--ink); }
.pscan-depot .btn { margin-top: 12px; }
/* Sur un téléphone, le grand bouton rouge : c'est lui qu'on vient chercher. */
.pscan-grand {
  display: none; flex-direction: column; align-items: center; gap: 8px;
  padding: 40px 24px 32px; border: 0; border-radius: 22px; cursor: pointer;
  background: var(--red); color: #fff; font-family: inherit; box-shadow: var(--ombre-2);
  transition: background var(--t), transform 120ms var(--ease);
}
.pscan-grand:active { transform: scale(.98); }
.pscan-grand:hover { background: var(--red-press); }
.pscan-grand svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pscan-grand span { font-size: var(--fs-lead); font-weight: 650; }
.pscan-grand small { font-size: var(--fs-small); opacity: .85; }
.pscan-galerie { display: none; align-self: center; }
@media (hover: none) and (pointer: coarse) {
  .pscan-depot { display: none; }
  .pscan-grand { display: flex; }
  .pscan-galerie { display: inline-flex; justify-content: center; }
}
.pscan-pages { display: flex; flex-direction: column; gap: 14px; }
.pscan-vignettes { display: flex; flex-wrap: wrap; gap: 10px; }
.pscan-vignette {
  position: relative; display: grid; place-items: center; width: 96px; height: 128px; overflow: hidden;
  border-radius: var(--rayon-m); background: var(--plaque-2); box-shadow: var(--ombre-1);
  font-size: var(--fs-label); color: var(--ink-45);
}
.pscan-vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pscan-vignette span { position: absolute; left: 6px; top: 6px; padding: 1px 7px; border-radius: 999px; background: var(--ink); color: #fff; font-size: var(--fs-label); font-weight: 600; }
.pscan-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pscan-envoyer { flex: 1 1 200px; min-height: 48px; }
.pscan-attente { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 0; text-align: center; }
.pscan-rond { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--creux); border-top-color: var(--ink); animation: ptourne .9s linear infinite; }
.pscan-total { font-size: var(--fs-lead); font-weight: 650; }
.pscan-recentes { max-width: 580px; }
#bloc-caisse[hidden], #bloc-compte[hidden], #bloc-montants[hidden],
#champ-moyen[hidden], #champ-echeance[hidden], #proposer-contact[hidden] { display: none; }

/* ============================================================ FICHE DOCUMENT */
.pdoc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
.pdoc-apercu { position: sticky; top: 24px; min-height: 420px; overflow: hidden; border-radius: var(--rayon); background: var(--plaque); box-shadow: var(--ombre-1); }
.pdoc-apercu img { width: 100%; height: auto; display: block; }
.pdoc-apercu object { width: 100%; height: 640px; display: block; }
.pdoc-forme .pbloc { margin-bottom: 16px; }
.pbloc-mensuel, .pbloc-horaire { display: block; }

/* ============================================================ LIGNES DE FACTURE
   Colonnes fixes : le prix et le total tombent au même endroit d'une ligne
   à l'autre, sinon l'œil ne peut pas additionner. */
.pligne-tete, .pligne { display: grid; grid-template-columns: minmax(0, 1fr) 78px 84px 104px 88px 92px 34px; gap: 8px; align-items: center; }
.pligne-sans-tva.pligne-tete, .pligne-sans-tva.pligne { grid-template-columns: minmax(0, 1fr) 78px 84px 104px 92px 34px; }
.pligne-tete { margin: 16px 0 6px; font-size: var(--fs-small); font-weight: 600; color: var(--ink-45); }
.pligne { margin-bottom: 8px; }
.pligne input, .pligne select { min-height: 38px; padding: 8px 10px; }
.pl-qte, .pl-prix, .pl-total { text-align: right; font-variant-numeric: tabular-nums; }
.pl-total { font-size: var(--fs-body); font-weight: 650; color: var(--ink); }
.pl-oter { padding: 6px 0; }

.pfacture { padding: 28px 30px; }
.pfacture-tete { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; margin-bottom: 28px; }
.pfacture-nom { font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.pfacture-client { min-width: 220px; }
.pfacture-totaux { max-width: 380px; margin-left: auto; }
.pfacture-paiement { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--trait); }

/* ============================================================ DOCUMENTS OFFICIELS
   Facture et fiche de salaire : la feuille A4 avant l'écran. Ce qu'on voit
   est ce qui s'imprime. À l'écran, la feuille est posée sur le fond avec
   l'ombre haute (--ombre-2) ; à l'impression, elle n'en a aucune. */
.pdocu { max-width: 860px; margin: 0 auto; padding: 52px 60px; border-radius: 6px; background: var(--plaque); box-shadow: var(--ombre-2); color: var(--ink-70); }
.pdocu-tete { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: start; padding-bottom: 28px; border-bottom: 2px solid var(--ink); }
.pdocu-marque { display: flex; align-items: center; gap: 14px; }
.pdocu-marque img { width: 44px; height: 44px; flex-shrink: 0; }
.pdocu-logo { max-height: 52px; max-width: 180px; width: auto !important; height: auto; object-fit: contain; }
.pdocu-mono { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--ink); color: #fff; font-size: var(--fs-lead); font-weight: 700; flex-shrink: 0; }
.pdocu-societe { font-size: var(--fs-lead); font-weight: 700; color: var(--ink); letter-spacing: -.01em; line-height: 1.2; }
.pdocu-coord { margin-top: 10px; font-size: var(--fs-small); line-height: 1.55; color: var(--ink-70); }
.pdocu-cartouche { text-align: right; }
.pdocu-type { display: block; font-size: var(--fs-display); font-weight: 700; letter-spacing: -.025em; line-height: 1; color: var(--ink); }
.pdocu-num { display: block; margin-top: 6px; font-size: var(--fs-small); color: var(--ink-70); }
.pdocu-etat { display: inline-block; margin-top: 10px; padding: 3px 10px; border-radius: 999px; background: var(--creux); font-size: var(--fs-label); font-weight: 600; color: var(--ink-70); }
.pdocu-etat-att { background: var(--creux); color: var(--rouge-donnee); }
.pdocu-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; padding: 28px 0; }
.pdocu-parties .label { display: block; margin-bottom: 6px; }
.pdocu-parties b { display: block; font-size: var(--fs-body); color: var(--ink); }
.pdocu-parties .small { line-height: 1.55; }
.pdocu-meta { display: grid; grid-template-columns: max-content 1fr; column-gap: 16px; row-gap: 4px; font-size: var(--fs-small); }
.pdocu-meta dt { color: var(--ink-45); }
.pdocu-meta dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.pdocu-table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: var(--fs-small); }
.pdocu-table th { text-align: left; padding: 10px; font-size: var(--fs-label); font-weight: 600; color: var(--ink-45); border-bottom: 1px solid var(--ink); white-space: nowrap; }
.pdocu-table td { padding: 11px 10px; border-bottom: 1px solid var(--trait); color: var(--ink-70); vertical-align: top; }
.pdocu-table td:first-child { color: var(--ink); }
.pdocu-table th:first-child, .pdocu-table td:first-child { padding-left: 0; }
.pdocu-table th:last-child, .pdocu-table td:last-child { padding-right: 0; }
.pdocu-table .pdroite { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pdocu-table .psous td { border-bottom: 0; padding-top: 4px; padding-bottom: 4px; color: var(--ink-45); font-size: var(--fs-label); }
.pdocu-table .pgroupe td { padding-top: 22px; border-bottom: 1px solid var(--trait-fort); font-size: var(--fs-label); font-weight: 600; color: var(--ink-45); }
.pdocu-table .psomme td { font-weight: 600; color: var(--ink); background: var(--plaque-2); }
.pdocu-table.pdocu-paie td:nth-child(2) { white-space: nowrap; }
.pdocu-totaux { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 32px; margin-top: 24px; align-items: start; }
.pdocu-totaux dl { display: grid; grid-template-columns: minmax(0, 1fr) max-content; row-gap: 8px; column-gap: 16px; margin: 0; font-size: var(--fs-small); }
.pdocu-totaux dt { color: var(--ink-70); }
.pdocu-totaux dd { margin: 0; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pdocu-totaux .pdocu-final { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; margin-top: 6px; padding: 12px 14px; border-radius: 8px; background: var(--ink); color: #fff; font-size: var(--fs-body); font-weight: 700; }
.pdocu-final span { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pdocu-note { font-size: var(--fs-small); line-height: 1.55; max-width: 52ch; }
.pdocu-paiement { margin-top: 28px; padding: 18px 20px; border-radius: 10px; background: var(--plaque-2); }
.pdocu-paiement .label { display: block; margin-bottom: 8px; }
.pdocu-paiement dl { display: grid; grid-template-columns: max-content 1fr; column-gap: 20px; row-gap: 5px; margin: 0; font-size: var(--fs-small); }
.pdocu-paiement dt { color: var(--ink-45); }
.pdocu-paiement dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.pdocu-pied { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--trait); font-size: var(--fs-label); color: var(--ink-45); }
.pdocu-pied span { white-space: nowrap; }

/* ============================================================ PAIE */
.pfiche-lignes { max-width: 420px; }
.pfiche-titre { display: block; margin: 22px 0 0; }
.pfiche-net { max-width: 420px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--trait); }
.pactions-paie { margin-top: 18px; align-items: flex-end; }
.pactions-paie .pchamp { margin: 0; }
/* Préparer, vérifier, valider, payer. Ce qui est fait est plein, l'étape
   du moment est cerclée ; valider ne se défait pas, et cela se voit. */
.petapes-barre { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 20px 0 22px; }
.petape { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; min-width: 0; padding: 12px 14px; border-radius: var(--rayon-m); background: var(--plaque); box-shadow: var(--ombre-1); }
.petape-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--creux); font-size: var(--fs-small); font-weight: 700; color: var(--ink-45); }
.petape-n svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.petape b { display: block; font-size: var(--fs-body); font-weight: 600; color: var(--ink-70); }
.petape .small { display: block; margin-top: 1px; }
.petape-fait .petape-n { background: var(--ink); color: #fff; }
.petape-fait b, .petape-ici b { color: var(--ink); }
.petape-ici { box-shadow: var(--ombre-1), inset 0 0 0 1.5px var(--ink); }
.petape-ici .petape-n { background: var(--plaque); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* ============================================================ CARNET D'ADRESSES */
.pcontacts-mobile { display: none; list-style: none; padding: 0; margin: 0; border-radius: var(--rayon); background: var(--plaque); box-shadow: var(--ombre-1); overflow: hidden; }
.pcontacts-mobile li + li { box-shadow: inset 0 1px 0 var(--trait); }
.pcontacts-mobile a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; transition: background var(--t); }
.pcontacts-mobile a:active { background: var(--plaque-2); }
.pavatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: var(--ink); color: #fff; font-size: var(--fs-small); font-weight: 700; letter-spacing: .02em; }
.pavatar-soc { background: var(--creux); color: var(--ink); border-radius: 11px; }
.pcontacts-nom { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.pcontacts-sous { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; font-size: var(--fs-small); color: var(--ink-45); }
.pcontacts-roles { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.pcontacts-roles .ppuce { margin: 0; }
.pcontacts-chevron { width: 16px; height: 16px; fill: none; stroke: var(--ink-45); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================ LOGO DE LA SOCIÉTÉ */
.plogo { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; align-items: center; margin: 18px 0 4px; padding: 16px; border-radius: var(--rayon-m); background: var(--plaque-2); }
.plogo-vu { display: grid; place-items: center; height: 72px; padding: 8px; border-radius: var(--rayon-s); background: var(--plaque); box-shadow: var(--ombre-1); }
.plogo-vu img { max-height: 56px; max-width: 80px; width: auto; object-fit: contain; }
.plogo-mono { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--ink); color: #fff; font-size: var(--fs-lead); font-weight: 700; }
.plogo-quoi .small { margin: 2px 0 12px; max-width: 56ch; }
.plogo-envoi { margin: 0; }

/* ============================================================ PLANNING
   Employés en lignes, jours en colonnes. Un créneau est une pastille encre
   pleine ; pointé, il passe en clair et porte une coche verte ; une absence
   n'est qu'un contour, elle ne pèse pas comme du travail. */
.pplan-outils { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 16px; }
.pplan-outils form { margin: 0; }
.pplan-outils .small { color: var(--ink-45); }
.pplan-boite { overflow-x: auto; overflow-y: hidden; }
.pplan { display: grid; grid-template-columns: 210px repeat(7, minmax(96px, 1fr)) 128px; min-width: max-content; }
.pplan-coin { position: sticky; left: 0; z-index: 3; background: var(--plaque); border-bottom: 1px solid var(--trait); }
.pplan-coin-fin { position: static; display: flex; align-items: flex-end; justify-content: flex-end; padding: 10px 14px; border-left: 1px solid var(--trait); }
.pplan-coin-fin .label { white-space: nowrap; }
.pplan-jour { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--trait); border-left: 1px solid var(--trait); background: var(--plaque); }
.pplan-jour a { display: block; padding: 3px; border-radius: 10px; transition: background var(--t); }
.pplan-jour a:hover { background: var(--plaque-2); }
.pplan-j-nom { display: block; font-size: var(--fs-small); font-weight: 600; color: var(--ink-45); }
.pplan-j-num { display: block; font-size: var(--fs-lead); font-weight: 700; color: var(--ink); line-height: 1.25; }
.pplan-auj .pplan-j-num { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 999px; background: var(--ink); color: #fff; }
.pplan-auj .pplan-j-nom { color: var(--ink); }
.pplan-qui { position: sticky; left: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: 12px 14px; border-top: 1px solid var(--trait); background: var(--plaque); }
.pplan-nom { font-size: var(--fs-body); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.pplan-nom:hover { color: var(--ink); }
.pplan-contrat { font-size: var(--fs-small); color: var(--ink-45); }
.pplan-case { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 64px; padding: 6px; border-top: 1px solid var(--trait); border-left: 1px solid var(--trait); }
.pplan-we, .pplan-repos { background: var(--plaque-2); }
.pplan-abs { display: block; font-size: var(--fs-label); font-weight: 600; color: var(--rouge-donnee); }

.pcre {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%;
  padding: 7px 9px; border: 0; border-radius: 10px; background: var(--ink); color: #fff;
  font-family: inherit; text-align: left; cursor: pointer;
  transition: background var(--t), box-shadow var(--t), transform 120ms var(--ease);
}
.pcre:hover { background: var(--ink-lift); box-shadow: var(--ombre-1); }
.pcre:active { transform: scale(.98); }
.pcre-h { font-size: var(--fs-small); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pcre-poste { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-label); color: var(--on-ink-2); }
.pcre-coche { position: absolute; top: 6px; right: 7px; width: 13px; height: 13px; fill: none; stroke: var(--on-ink-2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pcre-pointe { background: var(--plaque); color: var(--ink); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.pcre-pointe:hover { background: var(--plaque-2); box-shadow: inset 0 0 0 1px var(--ink); }
.pcre-pointe .pcre-poste { color: var(--ink-45); }
.pcre-pointe .pcre-coche { stroke: var(--vert); }
.pcre-pointe .pcre-h { padding-right: 15px; }
.pcre-vacances, .pcre-maladie, .pcre-conge, .pcre-ferie { background: transparent; color: var(--ink-45); box-shadow: inset 0 0 0 1px var(--trait-fort); outline: 1px dashed var(--trait-fort); outline-offset: -4px; }
.pcre-vacances:hover, .pcre-maladie:hover, .pcre-conge:hover, .pcre-ferie:hover { background-color: var(--plaque); box-shadow: inset 0 0 0 1px var(--ink-45); }

.pplan-ajout {
  flex: 1; min-height: 28px; border: 1px dashed transparent; border-radius: 10px;
  background: none; color: var(--ink-45); cursor: pointer; font-family: inherit; font-size: var(--fs-body); line-height: 1;
  opacity: 0; transition: opacity var(--t), border-color var(--t), color var(--t);
}
.pplan-case:hover .pplan-ajout { opacity: 1; border-color: var(--trait-fort); }
.pplan-ajout:hover { border-color: var(--ink); color: var(--ink); }
.pplan-ajout:focus-visible { opacity: 1; }
.pplan-repos .pplan-ajout { opacity: .45; font-size: var(--fs-label); }
.pplan-ajout-mini { flex: 0 0 auto; min-height: 20px; padding: 0; font-size: var(--fs-label); border-color: transparent; }
.pplan-case:hover .pplan-ajout-mini { opacity: .6; border-color: var(--trait); }
.pplan-ajout-mini:hover { opacity: 1; border-color: var(--ink); }

.pplan-tot { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 12px 14px; border-top: 1px solid var(--trait); border-left: 1px solid var(--trait); text-align: right; }
.pplan-tot b { font-size: var(--fs-body); color: var(--ink); }
.pplan-tot-sous { font-size: var(--fs-small); color: var(--ink-45); font-variant-numeric: tabular-nums; }
.pplan-tot-sous.pvar-mauvais { color: var(--rouge-donnee); font-weight: 600; }
.pplan-pied { padding: 10px 14px; border-top: 1px solid var(--trait-fort); background: var(--plaque-2); }
.pplan-pied.pplan-coin { border-left: 0; }
.pplan-pied-j { text-align: center; border-left: 1px solid var(--trait); }
.pplan-pied-j b { display: block; font-size: var(--fs-body); color: var(--ink); }
.pplan-pied-j span { font-size: var(--fs-small); color: var(--ink-45); font-variant-numeric: tabular-nums; }
.pplan-pied-fin { text-align: right; border-left: 1px solid var(--trait); }
.pplan-pied-fin b { font-size: var(--fs-body); color: var(--ink); }

/* ---- bandeau des jours (vue du jour) ----------------------------------- */
.pjours { display: flex; align-items: stretch; gap: 6px; margin: 16px 0 20px; }
.pjours-fleche { display: grid; place-items: center; width: 36px; flex-shrink: 0; border-radius: var(--rayon-m); color: var(--ink-70); background: var(--plaque); box-shadow: var(--ombre-1); }
.pjours-fleche:hover { color: var(--ink); }
.pjours-fleche svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pjour { flex: 1; min-width: 0; padding: 8px 2px; text-align: center; border-radius: var(--rayon-m); background: var(--plaque); box-shadow: var(--ombre-1); transition: background var(--t), box-shadow var(--t); }
.pjour:hover { box-shadow: var(--ombre-2); }
.pjour-nom { display: block; font-size: var(--fs-label); font-weight: 600; color: var(--ink-45); }
.pjour-num { display: block; font-size: var(--fs-lead); font-weight: 700; color: var(--ink); }
.pjour.on { background: var(--ink); }
.pjour.on .pjour-nom, .pjour.on .pjour-num { color: #fff; }
.pjour-auj:not(.on) .pjour-num { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

.pjournee { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pjournee-ligne {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%;
  padding: 12px 16px; border: 0; border-radius: var(--rayon-m); background: var(--plaque); box-shadow: var(--ombre-1);
  font-family: inherit; text-align: left; cursor: pointer; transition: box-shadow var(--t), transform 120ms var(--ease);
}
.pjournee-ligne:hover { box-shadow: var(--ombre-2); }
.pjournee-ligne:active { transform: scale(.99); }
.pjournee-abs { background-color: var(--plaque-2); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.pjournee-h { text-align: center; }
.pjournee-h b { display: block; font-size: var(--fs-body); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pjournee-h span { display: block; font-size: var(--fs-small); color: var(--ink-45); font-variant-numeric: tabular-nums; }
.pjournee-qui { min-width: 0; }
.pjournee-nom { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-body); font-weight: 600; color: var(--ink); }
.pjournee-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-small); color: var(--ink-45); }
.pjournee-duree { text-align: right; }
.pjournee-duree b { display: block; font-size: var(--fs-body); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pjournee-duree span { display: block; font-size: var(--fs-small); color: var(--ink-45); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pjournee-actions { margin-top: 18px; }

.pointage-h { width: 86px; min-height: 36px; padding: 7px 9px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- réglages des horaires ---------------------------------------------- */
.pt-horaires td, .pt-semainetype td, .pt-ouverture td { padding: 8px 10px; vertical-align: middle; }
.pt-horaires input, .pt-semainetype input, .pt-ouverture input { min-height: 38px; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.pt-horaires th:first-child { width: 26%; }
.pt-semainetype td:first-child { width: 28%; }
.pt-ouverture td:first-child { width: 18%; }
.phoraire-vide input { border-style: dashed; }
.ph-duree { font-size: var(--fs-small); color: var(--ink-45); font-variant-numeric: tabular-nums; }
.ph-debut, .ph-fin, .ph-pause { font-variant-numeric: tabular-nums; }
.pplage { display: flex; align-items: center; gap: 6px; }
.pplage span { color: var(--ink-45); }
.pt-joursh th.pcentre { width: 8%; }
.pt-joursh td { padding: 10px 8px; vertical-align: middle; }
.pt-joursh input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.pt-compteur .pt-encours td { background: var(--plaque-2); }

.pjoursh { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.pjoursh-jour { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 12px 10px; border-radius: var(--rayon-m); background: var(--plaque-2); }
.pjoursh-jour .label { display: block; }
.pjoursh-jour .popt { align-items: flex-start; gap: 7px; font-size: var(--fs-small); }
.pjoursh-jour .popt span { display: block; color: var(--ink); overflow-wrap: anywhere; }
.pjoursh-jour .popt small { display: block; color: var(--ink-45); font-variant-numeric: tabular-nums; }

/* ============================================================ FEUILLE (DIALOGUE)
   Sur bureau, une plaque centrée ; sur téléphone, une feuille qui monte du
   bas, avec sa poignée, comme partout sur un iPhone. */
.pdlg {
  width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0;
  border-radius: 22px; background: var(--plaque); color: var(--ink-70); box-shadow: var(--ombre-2), 0 0 0 1px var(--trait);
}
.pdlg[open] { animation: ppop 260ms var(--ease) both; }
.pdlg::backdrop { background: rgba(11, 37, 69, .32); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pdlg-tete { padding: 24px 26px 0; }
.pdlg-tete .small { margin-top: 4px; }
.pdlg-corps { padding: 18px 26px 4px; }
.pdlg-corps .pgrille { margin-top: 0; }
.pdlg-pied { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; padding: 18px 26px 24px; }
.pdlg-sup { padding: 0 26px 18px; border-top: 1px solid var(--trait); }
.pdlg-sup .pnav-sortie { width: auto; height: auto; margin-top: 14px; padding: 6px 0; color: var(--rouge-donnee); }
.pdlg-duree { padding: 11px 0 0; font-size: var(--fs-body); font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.pdlg-modeles { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pmodele {
  display: flex; flex-direction: column; gap: 1px; padding: 9px 14px; cursor: pointer;
  border: 0; border-radius: var(--rayon-m); background: var(--plaque-2); box-shadow: inset 0 0 0 1px var(--trait);
  font-family: inherit; text-align: left; transition: box-shadow var(--t), background var(--t);
}
.pmodele:hover { box-shadow: inset 0 0 0 1.5px var(--ink); background: var(--plaque); }
.pmodele b { font-size: var(--fs-body); font-weight: 600; color: var(--ink); }
.pmodele span { font-size: var(--fs-small); color: var(--ink-45); font-variant-numeric: tabular-nums; }
.pmodele-ouverture { background: var(--creux); }
.pmodele-vide { box-shadow: inset 0 0 0 1px var(--trait-fort); background: transparent; }
#dlg-ouverture { display: contents; }

/* ============================================================ CONNEXION */
body.pconnexion {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: 1fr;
  min-height: 100vh; min-height: 100dvh; margin: 0; background: var(--plaque);
}
.pcx-marque {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  padding: 48px 56px; overflow: hidden; background: var(--ink); color: var(--on-ink-2);
}
.pcx-logo { position: relative; display: inline-flex; align-items: center; gap: 12px; font-size: var(--fs-body); font-weight: 700; color: #fff; }
.pcx-logo img { width: 42px; height: 42px; border-radius: 10px; background: #fff; padding: 4px; }
.pcx-mot { position: relative; max-width: 30ch; }
.pcx-mot h1 { margin-top: 16px; font-size: var(--fs-display); color: #fff; }
.pcx-mot .lead { margin-top: 16px; color: var(--on-ink-2); }
.pcx-mot .label { color: var(--on-ink-4); }
.pcx-points { position: relative; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.pcx-points li { display: flex; align-items: flex-start; gap: 11px; font-size: var(--fs-body); color: var(--on-ink-2); }
.pcx-points svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.pcx-forme { display: grid; place-items: center; padding: 48px 32px; }
.pcx-boite { width: 100%; max-width: 380px; }
.pcx-boite h2 { margin-bottom: 6px; font-size: var(--fs-display); }
.pcx-boite form { display: grid; gap: 16px; margin-top: 28px; }
.pcx-pied { margin-top: 20px; }

/* ============================================================ ERREUR */
body.perreur { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; margin: 0; padding: 32px; }
.perreur-boite { width: 100%; max-width: 420px; padding: 40px; text-align: center; border-radius: 22px; background: var(--plaque); box-shadow: var(--ombre-2); }
.perreur-boite h1 { margin: 10px 0 8px; font-size: var(--fs-h2); }
.perreur-boite .btn { margin-top: 22px; }

/* ============================================================ MOUVEMENT (R6)
   Tout part d'un état déjà juste : sans JavaScript, sans mouvement, tout
   est lisible. `pjs-anime` n'est posée sur <html> que si le visiteur
   n'a pas demandé moins de mouvement ; `pvu` arrive quand la plaque entre
   dans l'écran, une seule fois. */
@keyframes pentre { from { opacity: 0; transform: translateY(8px); } }
@keyframes ppop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes pmonte { from { transform: scaleY(0); } }
@keyframes pglisse { from { transform: scaleX(0); } }
@keyframes ptrace { from { stroke-dasharray: 1 2; stroke-dashoffset: 1; } to { stroke-dasharray: 1 2; stroke-dashoffset: 0; } }
@keyframes pfondu { from { opacity: 0; } }
@keyframes parc { from { stroke-dasharray: 0 999; } }
@keyframes ptourne { to { transform: rotate(360deg); } }

.pjs-anime .panime:not(.pvu) { opacity: 0; }
.pjs-anime .panime.pvu { animation: pentre 520ms var(--ease) backwards; animation-delay: var(--d, 0ms); }
.pjs-anime .pvu .pgraph-barre { transform-box: fill-box; transform-origin: 50% 100%; animation: pmonte 620ms var(--ease) backwards; animation-delay: var(--d, 0ms); }
.pjs-anime .pvu .pgraph-ligne { animation: ptrace 700ms var(--ease) backwards; }
.pjs-anime .pvu .pgraph-aire, .pjs-anime .pvu .pgraph-fin { animation: pfondu 500ms var(--ease) 200ms backwards; }
.pjs-anime .pvu .pdonut-arc { animation: parc 520ms var(--ease) backwards; animation-delay: var(--d, 0ms); }
.pjs-anime .pvu .pbarres-part { animation: pglisse 620ms var(--ease) backwards; animation-delay: var(--d, 0ms); }
.pjs-anime .pvu .pkpi-spark path:not(.pspark-aire) { animation: ptrace 700ms var(--ease) backwards; }
.pjs-anime .pvu .pkpi-spark .pspark-aire, .pjs-anime .pvu .pkpi-spark circle { animation: pfondu 400ms var(--ease) 300ms backwards; }

@media (prefers-reduced-motion: reduce) {
  .portail *, .portail *::before, .portail *::after, .pconnexion * {
    animation: none !important; transition: none !important;
  }
}

/* ============================================================ LARGEURS MOYENNES */
@media (max-width: 1200px) {
  .pmain { padding: 32px 32px 80px; }
  .pkpi-val { font-size: var(--fs-h2); }
}
@media (max-width: 1100px) {
  .pkpis, .pcartes-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pdeux-tiers, .pdoc { grid-template-columns: 1fr; }
  .pdoc-apercu { position: static; }
  .pdoc-apercu object { height: 420px; }
  .petapes-barre, .ptotaux-paie { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pplan { grid-template-columns: 170px repeat(7, minmax(90px, 1fr)) 108px; }
  .pjoursh { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pkpi-val { font-size: var(--fs-display); }
}
@media (max-width: 1000px) {
  .pcartes { grid-template-columns: 1fr; }
  .pdeux { grid-template-columns: 1fr; }
  .pgrille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pchamp, .pchamp-court { grid-column: span 1; }
}

/* ============================================================ TÉLÉPHONE
   Une barre haute en verre qui dit où l'on est, une barre d'onglets au
   pouce, le menu complet dans une feuille qui monte du bas. */
@media (max-width: 900px) {
  body.portail { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; }

  .ptop {
    position: sticky; top: 0; z-index: 30;
    display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px;
    min-height: 52px; padding: var(--sure-haut) 10px 0;
    background: var(--verre); -webkit-backdrop-filter: var(--flou); backdrop-filter: var(--flou);
    box-shadow: 0 1px 0 var(--trait);
  }
  .ptop-marque { display: grid; place-items: center; width: 40px; height: 40px; }
  .ptop-marque img { width: 30px; height: 30px; border-radius: 8px; }
  .ptop-titre {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
    font-size: var(--fs-body); font-weight: 650; color: var(--ink);
  }
  .ptop-moi { display: grid; place-items: center; width: 40px; height: 40px; justify-self: end; }
  .ptop-moi .pnav-initiales { width: 32px; height: 32px; font-size: var(--fs-label); }

  /* La barre d'onglets : cinq destinations, le scan au centre. */
  .ptabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: start;
    height: calc(var(--barre-onglets) + var(--sure-bas)); padding: 6px 6px var(--sure-bas);
    background: var(--verre); -webkit-backdrop-filter: var(--flou); backdrop-filter: var(--flou);
    box-shadow: 0 -1px 0 var(--trait);
  }
  .ptabs a, .ptabs button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0;
    padding: 4px 2px; border: 0; background: none; cursor: pointer; font-family: inherit;
    font-size: var(--fs-label); font-weight: 500; color: var(--ink-45);
    transition: color var(--t);
  }
  .ptabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .ptabs span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ptabs .on { color: var(--ink); font-weight: 650; }
  .ptabs .on svg { stroke-width: 2.1; }
  .ptabs .ptabs-scan { margin-top: -29px; }
  .ptabs .ptabs-scan i {
    display: grid; place-items: center; width: 54px; height: 54px; border-radius: 999px;
    background: var(--red); color: #fff; box-shadow: 0 6px 16px -6px rgba(11, 37, 69, .12), 0 0 0 4px var(--fond);
    transition: transform 120ms var(--ease);
  }
  .ptabs .ptabs-scan:active i { transform: scale(.94); }
  .ptabs .ptabs-scan svg { width: 25px; height: 25px; }

  /* Le menu complet devient une feuille. */
  .pnav {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 50;
    width: auto; height: auto; max-height: 86dvh;
    padding: 8px 14px calc(18px + var(--sure-bas));
    border-right: 0; border-radius: 22px 22px 0 0;
    background: var(--plaque); -webkit-backdrop-filter: none; backdrop-filter: none;
    box-shadow: var(--ombre-2);
    transform: translateY(104%); transition: transform 360ms var(--ease);
    overscroll-behavior: contain;
  }
  .pnav.ouvert { transform: none; }
  .pnav-poignee { display: block; width: 38px; height: 5px; margin: 0 auto 10px; border-radius: 999px; background: var(--trait-fort); }
  .pnav-marque { display: none; }
  .pnav-liens a { min-height: 44px; }
  .pnav-bas { margin-top: 8px; }

  .pvoile { position: fixed; inset: 0; z-index: 45; display: block; background: rgba(11, 37, 69, .32); animation: pfondu 240ms var(--ease) both; }
  .pvoile[hidden] { display: none; }
  body.pmenu-ouvert { overflow: hidden; }

  .pmain { padding: 18px 16px calc(var(--barre-onglets) + var(--sure-bas) + 28px); max-width: none; }

  .ptete { align-items: stretch; gap: 14px; margin-bottom: 18px; }
  .ptete .small { font-size: var(--fs-small); }
  .ptete > .btn, .ptete > form, .ptete-cmd { width: 100%; }
  .ptete > .btn { display: flex; }
  .ptete-cmd .pchoix { flex: 1; }
  .ptete-cmd .btn { flex: 1; }
  /* Le scan vit dans la barre d'onglets : pas de second bouton rouge. */
  .ptete-cmd .pbtn-scan { display: none; }

  .pchoix { display: block; }
  .pchoix-bouton { width: 100%; justify-content: space-between; }
  .pchoix-panneau { left: 0; right: 0; min-width: 0; transform-origin: top center; }

  .pcartes { gap: 12px; }
  .psection { margin-top: 14px; padding: 18px 16px; border-radius: 16px; }
  .psection .ptable-boite { margin: 8px -16px -18px; }
  .psection .ptable-boite .ptable th:first-child, .psection .ptable-boite .ptable td:first-child { padding-left: 16px; }
  .psection .ptable-boite .ptable th:last-child, .psection .ptable-boite .ptable td:last-child { padding-right: 16px; }
  .pdeux-tiers > .psection, .pdeux > .psection, .pdeux .pbloc-large { margin-top: 14px; }
  .pcarte, .pbloc, .pbloc-large { padding: 18px 16px; }
  .pbloc-large { margin-top: 14px; }
  .pgrille { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pchamp, .pchamp-court, .pchamp-large { grid-column: auto; }
  .pactions { flex-direction: column-reverse; align-items: stretch; }
  .pactions .btn { width: 100%; }
  .pactions-ligne form, .pactions-ligne .btn { flex: 1 1 auto; }
  .precherche input, .precherche select { max-width: none; flex-basis: 100%; }
  .pdoc-apercu object { height: 360px; }

  /* 16 px dans les champs : en dessous, iOS zoome sur le focus. */
  .pchamp input, .pchamp select, .pchamp textarea, .precherche input, .precherche select,
  .pchoix-dates input, .pchoix-dates select, .pligne input, .pligne select,
  .pt-horaires input, .pt-semainetype input, .pt-ouverture input, .pointage-h { font-size: 16px; }

  .pkpis { gap: 10px; margin-top: 14px; }
  .pkpi { padding: 14px 14px 12px; border-radius: 16px; }
  .pkpi-tete svg { display: none; }
  .pkpi-val { font-size: var(--fs-h2); }
  .pkpi-val small { display: none; }
  .pkpi-bas { font-size: var(--fs-label); }
  .pkpi-bas .pnul { display: none; }
  .pkpi-spark { height: 32px; margin-top: 6px; }
  .pkpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pkpis-3 .pkpi { padding: 12px 10px; }
  .pkpis-3 .pkpi-bas { display: none; }

  .pverdict { padding: 16px; gap: 2px 12px; border-radius: 16px; }
  .pverdict .small { font-size: var(--fs-small); }



  .pgraph-bulle { min-width: 180px; }
  .pdonut, .pdonut-compact { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pdonut-dessin { width: 190px; margin: 0 auto; }


  .pbarres { grid-template-columns: minmax(0, 1fr) 64px max-content; column-gap: 10px; }
  .pconseil-tete { flex-direction: column; gap: 2px; }

  .ponglets, .pbascule-vue { display: flex; width: 100%; }
  .ponglets a, .pbascule-vue a { flex: 1; }
  .pfiltres, .pfiltres-roles { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .pfiltres a, .pfiltre { flex-shrink: 0; }
  .pmois-nav { display: flex; width: 100%; justify-content: space-between; }
  .pmois-nav select { flex: 1; text-align: center; }

  .pbilan, .presultat { grid-template-columns: minmax(0, 1fr); }
  .ptotaux-paie, .pvac, .pjour-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .presultat div, .ptotaux-paie div, .pvac div, .pjour-chiffres div { padding: 12px; }
  .presultat b, .ptotaux-paie b, .pvac b, .pjour-chiffres b { font-size: var(--fs-lead); }
  .pvac .small { display: none; }
  .pvac-fort .small { display: block; }
  .petapes-barre { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 14px 0 16px; }
  .petape { padding: 10px; gap: 8px; }
  .petape .small { display: none; }

  .pcontacts-mobile { display: block; }
  .pcontacts-table { display: none; }
  .pecr { padding: 14px 16px; }
  .pecr-tete { flex-direction: column; gap: 8px; }
  .pliste li { flex-wrap: wrap; gap: 6px 12px; }

  .pligne-tete { display: none; }
  .pligne, .pligne-sans-tva.pligne { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 12px; margin-bottom: 10px; border-radius: var(--rayon-m); background: var(--plaque-2); }
  .pligne input[name="designation[]"] { grid-column: 1 / -1; }

  .pdocu { padding: 22px 18px; border-radius: 12px; }
  .pdocu-tete { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-bottom: 18px; }
  .pdocu-cartouche { text-align: left; }
  .pdocu-type { font-size: var(--fs-h2); }
  .pdocu-parties { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px 0; }
  .pdocu-totaux { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pdocu-table.pdocu-facture th:nth-child(2), .pdocu-table.pdocu-facture td:nth-child(2) { display: none; }
  .pscan-depot { padding: 28px 16px; }

  .pplan { grid-template-columns: 128px repeat(7, 96px) 104px; }
  .pplan-qui { padding: 10px; }
  .pplan-case { min-height: 56px; }
  .pplan-ajout { opacity: .55; border-color: var(--trait); }
  .pplan-outils { gap: 8px; }
  .pplan-outils .small { flex-basis: 100%; }
  .pjours { gap: 4px; }
  .pjours-fleche { width: 30px; }
  .pjour { padding: 7px 1px; }
  .pjoursh { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pt-ouverture td:first-child { width: auto; }
  .pplage { flex-wrap: nowrap; }
  .pt-joursh td, .pt-joursh th { padding: 8px 3px; }
  .pt-joursh td:first-child .small { display: none; }
  .pointage-h { width: 70px; }

  .pdlg { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .pdlg[open] { animation: pentre 320ms var(--ease) both; }
  .pdlg-corps { max-height: 58dvh; overflow-y: auto; padding: 16px 18px 4px; }
  .pdlg-tete { padding: 22px 18px 0; }
  .pdlg-pied { position: sticky; bottom: 0; padding: 14px 18px calc(14px + var(--sure-bas)); background: var(--plaque); box-shadow: 0 -1px 0 var(--trait); }
  .pdlg-pied .btn { flex: 1; }
  .pdlg-modeles .pmodele { flex: 1 1 30%; }

  body.pconnexion { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .pcx-marque { padding: 28px 22px 32px; gap: 24px; }
  .pcx-points { display: none; }
  .pcx-forme { align-items: start; padding: 32px 22px 56px; }

  .plogo { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 12px; }
}

/* ------------------------------------------------ tableaux sur téléphone
   Un tableau de sept colonnes ne tient pas dans 360 px : on garde le nom,
   le montant, l'état ; le détail est à un clic, dans la fiche. Sélecteurs
   écrits au long plutôt qu'avec :is() : une pseudo-classe inconnue d'un
   vieux téléphone invaliderait la règle entière. */
@media (max-width: 900px) {
  .ptable { font-size: var(--fs-small); }
  .ptable th, .ptable td { padding: 11px 10px; }
  .ptable th { white-space: normal; }
  .ptable td .small, .ptable .ppuce { white-space: normal; }

  .pt-contacts th:nth-child(2), .pt-contacts td:nth-child(2),
  .pt-contacts th:nth-child(4), .pt-contacts td:nth-child(4),
  .pt-contacts th:nth-child(5), .pt-contacts td:nth-child(5) { display: none; }
  .pt-documents th:nth-child(2), .pt-documents td:nth-child(2),
  .pt-documents th:nth-child(3), .pt-documents td:nth-child(3),
  .pt-documents th:nth-child(4), .pt-documents td:nth-child(4),
  .pt-documents th:nth-child(5), .pt-documents td:nth-child(5) { display: none; }
  .pt-sorties th:nth-child(2), .pt-sorties td:nth-child(2),
  .pt-sorties th:nth-child(3), .pt-sorties td:nth-child(3) { display: none; }
  .pt-entrees th:nth-child(2), .pt-entrees td:nth-child(2),
  .pt-entrees th:nth-child(3), .pt-entrees td:nth-child(3) { display: none; }
  .pt-salaires th:nth-child(2), .pt-salaires td:nth-child(2),
  .pt-salaires th:nth-child(3), .pt-salaires td:nth-child(3),
  .pt-salaires th:nth-child(4), .pt-salaires td:nth-child(4),
  .pt-salaires th:nth-child(7), .pt-salaires td:nth-child(7) { display: none; }
  .pt-salaires tfoot td:nth-child(2), .pt-salaires tfoot td:nth-child(3) { display: none; }
  .pt-taux th:nth-child(4), .pt-taux td:nth-child(4) { display: none; }
  .pt-clients th:nth-child(2), .pt-clients td:nth-child(2),
  .pt-clients th:nth-child(3), .pt-clients td:nth-child(3),
  .pt-clients th:nth-child(5), .pt-clients td:nth-child(5),
  .pt-clients th:nth-child(6), .pt-clients td:nth-child(6) { display: none; }
  .pt-utilisateurs th:nth-child(3), .pt-utilisateurs td:nth-child(3),
  .pt-utilisateurs th:nth-child(4), .pt-utilisateurs td:nth-child(4),
  .pt-utilisateurs th:nth-child(5), .pt-utilisateurs td:nth-child(5) { display: none; }
  .pt-demandes th:nth-child(3), .pt-demandes td:nth-child(3),
  .pt-demandes th:nth-child(4), .pt-demandes td:nth-child(4),
  .pt-demandes th:nth-child(5), .pt-demandes td:nth-child(5) { display: none; }
  .pt-acces th:nth-child(2), .pt-acces td:nth-child(2),
  .pt-acces th:nth-child(3), .pt-acces td:nth-child(3),
  .pt-acces th:nth-child(4), .pt-acces td:nth-child(4) { display: none; }
  .pt-historique th:nth-child(3), .pt-historique td:nth-child(3),
  .pt-historique th:nth-child(5), .pt-historique td:nth-child(5),
  .pt-historique th:nth-child(6), .pt-historique td:nth-child(6),
  .pt-historique th:nth-child(7), .pt-historique td:nth-child(7) { display: none; }
  .pt-livre th:nth-child(3), .pt-livre td:nth-child(3),
  .pt-livre th:nth-child(4), .pt-livre td:nth-child(4) { display: none; }
  .pt-compare th:nth-child(5), .pt-compare td:nth-child(5),
  .pt-compare th:nth-child(6), .pt-compare td:nth-child(6) { display: none; }
  .pt-paie th:nth-child(3), .pt-paie td:nth-child(3),
  .pt-paie th:nth-child(5), .pt-paie td:nth-child(5),
  .pt-paie th:nth-child(7), .pt-paie td:nth-child(7) { display: none; }
  .pt-recents th:nth-child(3), .pt-recents td:nth-child(3) { display: none; }
  .pt-mois th:nth-child(5), .pt-mois td:nth-child(5) { display: none; }
  .pt-moisconnus th:nth-child(2), .pt-moisconnus td:nth-child(2) { display: none; }
  .pt-pointage th:nth-child(5), .pt-pointage td:nth-child(5) { display: none; }
  .pt-horaires th:nth-child(5), .pt-horaires td:nth-child(5),
  .pt-horaires th:nth-child(6), .pt-horaires td:nth-child(6) { display: none; }
  .pt-compteur th:nth-child(2), .pt-compteur td:nth-child(2) { display: none; }
}

/* ============================================================ IMPRESSION
   Rien de l'application ne s'imprime : ni barres, ni boutons. Le client
   reçoit une facture, pas une capture d'écran du portail. */
@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; }
  html, body { background: #fff !important; }
  body.portail { display: block !important; }
  .pnav, .ptop, .ptabs, .pvoile, .pas-imprime, .pnav-bas, .pmsg,
  .pplan-outils, .pplan-ajout, .pplan-alertes, .pkpis, .pmois-nav, .pjours { display: none !important; }
  .pmain { padding: 0 !important; max-width: none !important; }
  .pdocu, .pfacture { border: 0; border-radius: 0; padding: 0; max-width: none; box-shadow: none; }
  .ptable-boite, .pplan-boite, .psection { box-shadow: none; overflow: visible; }
  .pplan { min-width: 0; }
  .pdocu-final, .pdocu-paiement, .pdocu-table .psomme td, .pdocu-mono, .pdocu-logo, .pcre { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
}

/* ---- les deux formats du graphique d'activité ---------------------------
   Le large sur écran, le haut et étroit sur téléphone : chacun garde des
   étiquettes à taille lisible. Le repère de lecture couvre les deux dessins. */
.pgraph-vue { position: relative; }
.pgraph-vue-petit { display: none; }
@media (max-width: 640px) {
  .pgraph-vue-large { display: none; }
  .pgraph-vue-petit { display: block; }
}

/* Un sous-titre dans une plaque : plus d'air au-dessus qu'en dessous. */
.ptitre-sous { margin: 26px 0 0; font-size: var(--fs-body); }
.pkpi-spark { height: auto; aspect-ratio: 5 / 1; }
/* La feuille fermée est hors d'atteinte, y compris pour le clavier et un
   rebond de défilement : elle ne devient visible qu'au moment de monter. */
@media (max-width: 900px) {
  .pnav { visibility: hidden; transition: transform 360ms var(--ease), visibility 0s linear 360ms; }
  .pnav.ouvert { visibility: visible; transition: transform 360ms var(--ease), visibility 0s; }
}

/* ---- corrections de la revue de finition -------------------------------- */
/* Pas de plaque dans une plaque : dans une section, les conseils deviennent
   des rangées séparées d'un filet. */
.psection .pconseils, .pbloc-large .pconseils { gap: 0; }
.psection .pconseil, .pbloc-large .pconseil { padding: 14px 0 14px 22px; border-radius: 0; box-shadow: none; background: transparent; }
.psection .pconseil + .pconseil, .pbloc-large .pconseil + .pconseil { box-shadow: inset 0 1px 0 var(--trait); }
.psection .pconseil::before, .pbloc-large .pconseil::before { left: 2px; top: 21px; }

/* Les chiffres de l'analyse suivent la grille des chiffres clés : légende,
   valeur, précision ; deux par rangée sur téléphone. */
.pcartes-4 .pcarte { gap: 4px; padding: 18px 20px 16px; }
.pcartes-4 .pcarte .label { font-size: var(--fs-small); font-weight: 600; color: var(--ink-70); }
.pcartes-4 .pcarte .big { font-size: var(--fs-h2); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 900px) {
  .pcartes-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pcartes-4 .pcarte { padding: 14px; border-radius: 16px; }
  .pcartes-4 .pcarte .big { font-size: var(--fs-lead); }
  .pcartes-4 .pcarte .small { font-size: var(--fs-label); }
}

/* Un montant signé ne se coupe pas entre son signe et ses chiffres. */
.pt-recents td.pdroite { white-space: nowrap; }
.pkpi-bas .pnul { white-space: nowrap; }
.pl-oter svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
/* Les totaux sans jauge gardent leurs deux colonnes sur téléphone : la règle
   des barres à trois colonnes, plus haut, les écrasait (« À payer » remontait
   à côté du total hors taxe). */
@media (max-width: 900px) { .pbarres.pbarres-nu { grid-template-columns: minmax(0, 1fr) max-content; } }
/* Un menu déroulant posé hors d'un .pchamp porte le même chevron dessiné. */
:where(.pmain) :where(select) {
  -webkit-appearance: none; appearance: none; padding-right: 34px;
  background: var(--plaque) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6F88' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center / 16px;
}
/* Le détail d'une carte (heures, part du CA) sur sa propre ligne : collé à
   « vs avant », il se lisait « comparé à 210 h avant ». */
.pkpi-bas .pnul { flex-basis: 100%; }
.pmois-nav select { -webkit-appearance: auto; appearance: auto; padding-right: 6px; }

/* ======================================================= INFORMATIQUE
   Tickets et parc d'appareils. Les listes sont des cartes, pas des tableaux :
   elles se lisent pareil sur téléphone. L'urgence est une pastille dont la
   couleur monte avec la gravité ; seul « bloquant » prend le rouge, pour
   qu'il reste rare à l'écran. */
.pticket-urg { display: inline-block; flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; vertical-align: 1px; margin-right: 8px; }
.pticket-urg-basse { box-shadow: inset 0 0 0 2px var(--trait-fort); }
.pticket-urg-normale { background: var(--ink-45); }
.pticket-urg-haute { background: var(--ink); }
.pticket-urg-bloquant { background: var(--rouge-donnee); box-shadow: 0 0 0 3px rgba(184, 7, 22, .14); }

.ptickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pticket {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 16px 20px; border-radius: var(--rayon-m); background: var(--plaque); box-shadow: var(--ombre-1);
  color: var(--ink-70); transition: box-shadow var(--t), transform var(--t);
}
.pticket:hover { box-shadow: var(--ombre-2); transform: translateY(-1px); }
.pticket .pticket-urg { margin: 0; }
.pticket-corps { display: grid; gap: 2px; min-width: 0; }
.pticket-sujet { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pticket-meta { font-size: var(--fs-small); color: var(--ink-45); overflow-wrap: anywhere; }
.pticket-etat { display: grid; justify-items: end; gap: 4px; text-align: right; }
.pticket-quand { font-size: var(--fs-label); color: var(--ink-45); white-space: nowrap; }
.pticket-attend { color: var(--ink); font-weight: 600; }

.ptickets-outils { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.ptickets-outils .pfiltres { margin: 0; }
.ptickets-societe { margin: 0; }
.ptickets-societe .pchamp { min-width: 240px; }

/* Carte « Vos appareils » sous la liste du client. */
.pparc { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-direction: row; }
.pparc svg { width: 28px; height: 28px; flex-shrink: 0; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pparc > span { display: grid; gap: 2px; }
.pparc b { color: var(--ink); }

/* Choix de la catégorie : les options à cocher en grille. */
.pchoix-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.pchoix-grille .pdecision-opt { align-items: center; padding: 12px 14px; }
.pchoix-grille .pdecision-opt input { margin-top: 0; }
.pdecision-quatre { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 4px; }
.pdecision-quatre b { display: block; }
.pdecision-quatre b .pticket-urg { vertical-align: 0; }
.pdecision-note { margin-top: 12px; }
.pgrille-apres { margin-top: 18px; }

/* Pièces jointes : zone compacte dans les formulaires. */
.pdepot-petit { flex-direction: row; justify-content: flex-start; gap: 14px; margin: 16px 0 0; padding: 18px 20px; text-align: left; border-radius: var(--rayon-m); }
.pdepot-petit .pdepot-ico { width: 24px; height: 24px; margin: 0; flex-shrink: 0; }
.pdepot-txt { display: grid; gap: 2px; }
.pdepot-txt b { color: var(--ink); font-weight: 600; }
.pdepot-petit .pdepot-liste { margin: 0 0 0 auto; }
.pdepot-mini { flex-direction: row; gap: 8px; margin: 0; padding: 9px 14px; border-radius: 999px; font-size: var(--fs-small); color: var(--ink); }
.pdepot-mini .pdepot-ico { width: 18px; height: 18px; margin: 0; }
.pdepot-mini .pdepot-txt { display: block; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* La conversation. Ce que j'ai écrit à droite, sur fond d'encre pâle ; ce
   que l'autre partie a écrit à gauche, sur blanc ; les événements au
   milieu, en petit ; les notes internes en pointillé. */
.pticket-page { align-items: start; }
.pfil-boite { padding: 22px 24px 20px; }
.pfil { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pfil-msg { max-width: 86%; padding: 14px 16px; border-radius: var(--rayon-m); background: var(--plaque-2); box-shadow: inset 0 0 0 1px var(--trait); }
.pfil-moi { justify-self: end; background: rgba(11, 37, 69, .06); box-shadow: none; }
.pfil-note { justify-self: stretch; max-width: none; background: var(--plaque); box-shadow: none; border: 1.5px dashed var(--trait-fort); }
.pfil-qui { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 6px; font-size: var(--fs-small); color: var(--ink-45); }
.pfil-qui b { color: var(--ink); font-weight: 600; }
.pfil-qui img { border-radius: 5px; }
.pfil-quand { font-size: var(--fs-label); color: var(--ink-45); }
.pfil-qui .pfil-quand { margin-left: auto; }
.pfil-texte { color: var(--ink); overflow-wrap: anywhere; }
.pfil-evt { justify-self: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; padding: 4px 12px; font-size: var(--fs-small); color: var(--ink-70); text-align: center; }
.pfil-evt::before { content: ""; align-self: center; width: 6px; height: 6px; border-radius: 50%; background: var(--trait-fort); }
.pfil-pieces { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pfil-pieces a { display: flex; align-items: center; gap: 10px; max-width: 260px; padding: 6px 12px 6px 6px; border-radius: var(--rayon-s); background: var(--plaque); box-shadow: inset 0 0 0 1px var(--trait); color: var(--ink); font-size: var(--fs-small); transition: box-shadow var(--t); }
.pfil-pieces a:hover { box-shadow: inset 0 0 0 1px var(--trait-fort); }
.pfil-pieces img { width: 44px; height: 44px; object-fit: cover; border-radius: 7px; }
.pfil-pieces svg { width: 44px; height: 44px; padding: 10px; border-radius: 7px; background: var(--creux); fill: none; stroke: var(--ink-45); stroke-width: 1.6; }
.pfil-pieces span { display: grid; min-width: 0; overflow-wrap: anywhere; }
.pfil-pieces small { font-size: var(--fs-label); color: var(--ink-45); }
.pfil-repondre { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--trait); }
.pfil-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.pfil-outils .btn { margin-left: auto; }
.pticket-cote .pdef dd { display: flex; align-items: center; justify-content: flex-end; }
.pticket-reglages { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--trait); }
.pticket-cote > .small { margin-top: 10px; }
.pticket-regle { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--trait); }
.pticket-regle .btn { width: 100%; }
.pticket-regle .small { margin-top: 8px; }

/* Le parc : une grille de fiches. */
.pappareils { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pappareil { display: grid; align-content: start; gap: 4px; height: 100%; padding: 18px 20px; border-radius: var(--rayon-m); background: var(--plaque); box-shadow: var(--ombre-1); color: var(--ink-70); transition: box-shadow var(--t), transform var(--t); }
.pappareil:hover { box-shadow: var(--ombre-2); transform: translateY(-1px); }
.pappareil-type { font-size: var(--fs-label); color: var(--ink-45); }
.pappareil-nom { font-size: var(--fs-lead); font-weight: 650; color: var(--ink); letter-spacing: -.01em; }
.pappareil-details { font-size: var(--fs-small); overflow-wrap: anywhere; }
.pappareil-puces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pappareil-puces:empty { display: none; }
.pappareil-retire { opacity: .6; }
.pappareils-pied { margin-top: 16px; }

@media (max-width: 1100px) {
  .pchoix-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pdecision-quatre { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pticket { grid-template-columns: auto minmax(0, 1fr); padding: 14px 16px; }
  .pticket-sujet { white-space: normal; }
  .pticket-etat { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; text-align: left; }
  .pfil-msg { max-width: 94%; }
  .pfil-boite { padding: 18px 16px; }
  .ptickets-societe, .ptickets-societe .pchamp { width: 100%; min-width: 0; }
  .pdepot-petit { flex-wrap: wrap; }
  .pdepot-petit .pdepot-liste { margin: 0; flex-basis: 100%; }
}
@media (max-width: 520px) {
  .pchoix-grille, .pdecision-quatre { grid-template-columns: minmax(0, 1fr); }
  .pfil-outils .btn { width: 100%; }
}

/* ======================================================= JURIDIQUE
   Deux portes (écrire, appeler), des créneaux au quart d'heure, un agenda
   jour par jour. Rien de nouveau dans le système : des cartes, des
   pastilles, les jetons existants. */
.btn-petit { min-height: 0; padding: 6px 12px; font-size: var(--fs-small); }
.pticket-delai { font-weight: 600; color: var(--ink); }

.pjur-portes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.pjur-porte { flex-direction: row; align-items: flex-start; gap: 16px; }
.pjur-porte svg { width: 30px; height: 30px; flex-shrink: 0; margin-top: 2px; fill: none; stroke: var(--red); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pjur-porte > span { display: grid; gap: 4px; }
.pjur-porte b { font-size: var(--fs-lead); color: var(--ink); letter-spacing: -.01em; }
.pjur-porte + .pjur-porte svg { stroke: var(--ink); }
.pjur-questions .psection-tete { flex-wrap: wrap; gap: 10px; }
.pjur-questions .pfiltres { margin: 0; }
.pjur-questions .ptickets { margin-top: 12px; }

/* Les appels : l'heure en tête de ligne, comme dans un agenda. */
.pappels { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.pappel {
  display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 14px 18px; border-radius: var(--rayon-m); background: var(--plaque-2);
  box-shadow: inset 0 0 0 1px var(--trait); color: var(--ink-70); transition: box-shadow var(--t);
}
.pappel:hover { box-shadow: inset 0 0 0 1px var(--trait-fort); }
.pappel-quand { display: grid; gap: 1px; font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.pappel-quand b { font-size: var(--fs-body); color: var(--ink); }
.pappel-sujet { display: grid; gap: 2px; color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.pappel-sujet .small { font-weight: 400; }
.pappel-mode { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); color: var(--ink-45); white-space: nowrap; }
.pappel-annule { opacity: .6; }
.pjur-agenda-jour { margin-top: 24px; }
.pjur-agenda-jour:first-of-type { margin-top: 4px; }
.pjur-agenda-jour .pappel { background: var(--plaque); box-shadow: var(--ombre-1); }
.pjur-agenda-jour .pappel-quand { grid-template-columns: auto; }

/* Réservation : la durée, puis les créneaux du jour en pastilles. */
.pjur-durees { margin: 4px 0 10px; }
.pjur-preavis { margin: 0 0 14px; }
.pjur-jour { padding: 14px 0; border-top: 1px solid var(--trait); }
.pjur-jour:first-of-type { border-top: 0; padding-top: 0; }
.pjur-jour-nom { margin: 0 0 10px; font-weight: 600; color: var(--ink); }
.pcreneaux { display: flex; flex-wrap: wrap; gap: 8px; }
.pcreneau { position: relative; cursor: pointer; }
.pcreneau input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pcreneau span {
  display: inline-flex; min-width: 68px; justify-content: center; padding: 9px 12px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--trait-fort); background: var(--plaque);
  font-size: var(--fs-small); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink);
  transition: box-shadow var(--t), background var(--t), color var(--t);
}
.pcreneau:hover span { box-shadow: inset 0 0 0 1px var(--ink); }
.pcreneau input:checked + span { background: var(--ink); color: #fff; box-shadow: none; }
.pcreneau input:focus-visible + span { box-shadow: var(--anneau), inset 0 0 0 1px var(--ink); }
.pjur-plus { padding-top: 6px; border-top: 1px solid var(--trait); }
.pjur-plus summary { padding: 12px 0 4px; cursor: pointer; font-weight: 600; color: var(--ink); }
.pjur-plus[open] summary { padding-bottom: 12px; }
.pjur-rien .lead { color: var(--ink); font-weight: 600; font-size: var(--fs-body); }
.pjur-rien .small { margin-top: 6px; }
.pjur-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 4px; }

/* Fiche d'un appel. */
.pjur-message { margin: 10px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.pjur-annule { margin-top: 16px; }
.pjur-cloture { display: grid; gap: 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--trait); }
.pjur-cloture form { margin: 0; }
.pjur-cloture .pform { display: grid; gap: 10px; }
.pjur-cloture .pform .btn { justify-self: start; }
.pticket-appels { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--trait); }
.pticket-appels .btn { margin-top: 12px; width: 100%; }

/* Disponibilités. */
.pjur-onglets { margin-bottom: 20px; }
.pjur-dispo-jour + .pjur-dispo-jour { margin-top: 14px; }
.pjur-dispo-jour .pjur-jour-nom { margin: 12px 0 0; }
.pjur-dispo-jour .pliste li { align-items: center; }
.pjur-retirer { margin: 0 0 0 auto; }

@media (max-width: 900px) {
  .pjur-portes { grid-template-columns: minmax(0, 1fr); }
  .pappel { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 16px; }
  .pappel-quand { grid-template-columns: auto auto; justify-content: start; gap: 8px; }
  .pappel-mode { white-space: normal; flex-wrap: wrap; }
  .pjur-modes { grid-template-columns: minmax(0, 1fr); }
}
.pjur-dispo-jour .pliste { margin-top: 2px; }
.pjur-dispo-jour .pliste li { padding: 6px 0; }
.pjur-dispo-jour + .pjur-dispo-jour { padding-top: 12px; border-top: 1px solid var(--trait); }

/* ======================================================= FIL D'ACTIVITÉ
   Un ticket se lit comme dans les outils de support des grandes sociétés,
   dit avec les mots de tout le monde : l'avancement en trois étapes, le
   problème, la réponse, puis l'historique jour par jour, à l'heure près.
   Les notes internes sont en pointillé et nommées comme telles. */
.pavance { list-style: none; margin: 0 0 18px; padding: 0; display: flex; gap: 8px; counter-reset: none; }
.pavance li { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--rayon-m); background: var(--plaque); box-shadow: inset 0 0 0 1px var(--trait); font-size: var(--fs-small); font-weight: 600; color: var(--ink-45); }
.pavance-n { display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; background: var(--creux); font-size: var(--fs-label); color: var(--ink-45); }
.pavance li.fait { color: var(--ink); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.pavance li.fait .pavance-n { background: var(--ink); color: #fff; }
.pattend { margin-bottom: 18px; box-shadow: inset 0 0 0 1.5px var(--ink); }
.pattend::before { background: var(--rouge-donnee); }

.pticket-principal { display: grid; gap: 16px; min-width: 0; }
.pticket-principal > .pbloc-large { margin-top: 0; }
.pprobleme-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0 0 10px; }
.pprobleme-tete b { font-size: var(--fs-lead); color: var(--ink); }
.pprobleme-tete span { font-size: var(--fs-small); color: var(--ink-45); }

/* La zone de réponse : deux onglets pour l'équipe. En mode « note
   interne », tout le cadre passe en pointillé : impossible de confondre. */
.pcompose { display: grid; gap: 10px; }
.pcompose .pchamp { margin: 0; }
.pcompose-titre { margin: 0; font-weight: 600; color: var(--ink); }
.pcompose-mode { display: inline-flex; justify-self: start; padding: 3px; border-radius: 999px; background: var(--creux); }
.pcompose-mode label { position: relative; padding: 7px 16px; border-radius: 999px; font-size: var(--fs-small); font-weight: 600; color: var(--ink-70); cursor: pointer; transition: background var(--t), color var(--t); }
.pcompose-mode input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pcompose-mode label:has(input:checked) { background: var(--plaque); color: var(--ink); box-shadow: 0 1px 3px rgba(11, 37, 69, .12); }
.pcompose-mode label:has(input:focus-visible) { box-shadow: var(--anneau); }
.pcompose-aide { margin: 0; }
.pcompose-aide-interne { display: none; }
.pcompose:has(input[value=interne]:checked) { box-shadow: none; outline: 1.5px dashed var(--ink-45); outline-offset: -1.5px; background: var(--plaque-2); }
.pcompose:has(input[value=interne]:checked) .pcompose-aide-public { display: none; }
.pcompose:has(input[value=interne]:checked) .pcompose-aide-interne { display: block; color: var(--ink); }
.pcompose .pfil-outils { margin-top: 0; }

/* L'historique : un rail à gauche, une pastille par ligne. */
.pchrono { list-style: none; margin: 14px 0 0; padding: 0; position: relative; }
.pchrono::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--trait); }
.pchrono-jour { position: relative; margin: 18px 0 10px 44px; font-size: var(--fs-label); font-weight: 700; color: var(--ink-45); }
.pchrono-jour:first-child { margin-top: 4px; }
.pchrono-item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 6px 0; }
.pchrono-ico { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--plaque); box-shadow: inset 0 0 0 1.5px var(--trait-fort); }
.pchrono-ico svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-70); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pchrono-equipe .pchrono-ico { background: var(--ink); box-shadow: none; }
.pchrono-equipe .pchrono-ico svg { stroke: #fff; }
.pchrono-note .pchrono-ico { background: var(--plaque-2); box-shadow: inset 0 0 0 1.5px var(--ink-45); }
.pchrono-note .pchrono-ico svg { stroke: var(--ink); }
.pchrono-corps { min-width: 0; padding: 12px 16px; border-radius: var(--rayon-m); background: var(--plaque-2); box-shadow: inset 0 0 0 1px var(--trait); }
.pchrono-note .pchrono-corps { background: var(--plaque); box-shadow: none; outline: 1.5px dashed var(--ink-45); outline-offset: -1.5px; }
.pchrono-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 6px; font-size: var(--fs-small); color: var(--ink-45); }
.pchrono-tete b { color: var(--ink); font-weight: 600; }
.pchrono-tete time { margin-left: auto; font-variant-numeric: tabular-nums; }
.pchrono-interne { padding: 1px 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: var(--fs-label); font-weight: 600; }
.pchrono-texte { color: var(--ink); overflow-wrap: anywhere; }
.pchrono-discret { margin: 0; color: var(--ink-70); }
.pchrono-evenement { align-items: center; padding: 2px 0; }
.pchrono-evenement .pchrono-ico { width: 32px; height: 20px; background: none; box-shadow: none; }
.pchrono-evenement .pchrono-ico svg { width: 12px; height: 12px; fill: var(--plaque); stroke: var(--ink-45); stroke-width: 3; }
.pchrono-evt { margin: 0; font-size: var(--fs-small); color: var(--ink-70); }
.pchrono-evt time { margin-left: 6px; color: var(--ink-45); font-variant-numeric: tabular-nums; }

/* Les pièces : les captures s'affichent, le reste se présente en fiche. */
.pchrono-pieces { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.pchrono-pieces a { display: grid; gap: 6px; color: var(--ink); }
.pchrono-image a { width: min(320px, 100%); }
.pchrono-image img { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: var(--rayon-s); background: var(--creux); box-shadow: inset 0 0 0 1px var(--trait); transition: opacity var(--t); }
.pchrono-image a:hover img { opacity: .9; }
.pchrono-fichier a { grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; max-width: 320px; padding: 8px 12px 8px 8px; border-radius: var(--rayon-s); background: var(--plaque); box-shadow: inset 0 0 0 1px var(--trait); }
.pchrono-fichier svg { width: 40px; height: 40px; padding: 9px; border-radius: 8px; background: var(--creux); fill: none; stroke: var(--ink-45); stroke-width: 1.6; }
.pchrono-piece-nom { display: grid; font-size: var(--fs-small); overflow-wrap: anywhere; }
.pchrono-piece-nom small { font-size: var(--fs-label); color: var(--ink-45); }
.pprobleme .pchrono-pieces { margin-top: 14px; }

@media (max-width: 900px) {
  .pavance { gap: 6px; }
  .pavance li { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; font-size: var(--fs-label); }
  .pchrono-corps { padding: 10px 12px; }
  .pchrono-tete time { margin-left: 0; }
}

/* ======================================================= COMPTES ET ACCÈS */
.pcomptes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pcompte { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--rayon-m); background: var(--plaque); box-shadow: var(--ombre-1); color: var(--ink-70); transition: box-shadow var(--t); }
.pcompte:hover { box-shadow: var(--ombre-2); }
.pcompte-off { opacity: .6; }
.pcompte-qui { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.pcompte-qui b { color: var(--ink); }
.pcompte-acces { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.pcomptes-pied { margin-top: 16px; }
.pcomptes-role { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 4px 0 18px; }
.pacces { display: grid; gap: 0; }
.pacces-ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; align-items: center; padding: 14px 0; border-top: 1px solid var(--trait); }
.pacces-ligne:first-child { border-top: 0; }
.pacces-module { display: grid; gap: 2px; }
.pacces-module b { color: var(--ink); }
.pacces-niveaux { display: flex; flex-wrap: wrap; gap: 6px; }
.pacces-niveaux .pcreneau span { min-width: 0; }
.pform:has(input[name=role][value=admin]:checked) .pacces { opacity: .45; pointer-events: none; }
.pequipe-roles { margin-top: 18px; }
@media (max-width: 900px) {
  .pcompte { grid-template-columns: auto minmax(0, 1fr); }
  .pcompte-acces { grid-column: 1 / -1; justify-content: flex-start; }
  .pcomptes-role, .pacces-ligne { grid-template-columns: minmax(0, 1fr); }
}

/* Lecture seule : les formulaires qui enregistrent disparaissent, comme
   les boutons d'action de l'en-tête. Le routeur refuse de toute façon. */
body.plecture .pmain form[method=post], body.plecture .pmain form[method=POST] { display: none; }
body.plecture .ptete .btn-pri, body.plecture .ptete-cmd .btn-pri { display: none; }
.plecture-bandeau { margin-bottom: 18px; }

/* ======================================================= AGENDA (SEMAINE)
   Une grille comme celle d'Outlook ou de Gmail : 7 h à 20 h, une colonne
   par jour. Chaque bloc est placé à la minute près par --debut et --duree
   (en minutes depuis 7 h) ; la hauteur d'une minute est --pcal-min. */
.pcal-outils { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pcal-outils .pfiltres { margin: 0; }
.pcal-nav { display: flex; align-items: center; gap: 6px; }
.pcal-titre { margin-left: 8px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pcal { --pcal-min: 1.2px; border-radius: var(--rayon); background: var(--plaque); box-shadow: var(--ombre-1); overflow: hidden; }
.pcal-tete, .pcal-corps { display: grid; grid-template-columns: 56px repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .6fr)); }
.pcal-tete { border-bottom: 1px solid var(--trait); }
.pcal-tete span { padding: 10px 8px; font-size: var(--fs-small); color: var(--ink-45); text-align: center; }
.pcal-tete b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; margin-left: 2px; border-radius: 50%; color: var(--ink); font-size: var(--fs-body); }
.pcal-tete .auj b { background: var(--red); color: #fff; }
.pcal-corps { position: relative; height: calc(var(--pcal-minutes) * var(--pcal-min)); }
.pcal-heures { position: relative; }
.pcal-heures span { display: block; height: calc(60 * var(--pcal-min)); padding: 0 8px 0 0; font-size: var(--fs-label); color: var(--ink-45); text-align: right; transform: translateY(-7px); }
.pcal-heures span:first-child { transform: none; }
.pcal-jour {
  position: relative; border-left: 1px solid var(--trait);
  background-image: linear-gradient(var(--trait) 1px, transparent 1px);
  background-size: 100% calc(60 * var(--pcal-min));
}
.pcal-jour.we { background-color: var(--plaque-2); }
.pcal-jour.auj { background-color: rgba(227, 16, 30, .025); }
.pcal-dispo, .pcal-appel, .pcal-maintenant { position: absolute; left: 3px; right: 3px; top: calc(var(--debut) * var(--pcal-min)); }
.pcal-dispo { height: calc(var(--duree) * var(--pcal-min)); border-radius: 6px; background: rgba(11, 37, 69, .06); box-shadow: inset 0 0 0 1px rgba(11, 37, 69, .08); }
.pcal-appel {
  z-index: 1; display: grid; align-content: start; gap: 1px; overflow: hidden;
  height: calc(var(--duree) * var(--pcal-min) - 2px); min-height: 22px; padding: 2px 7px;
  border-radius: 6px; background: var(--ink); color: #fff; font-size: var(--fs-label); line-height: 1.3;
  box-shadow: 0 1px 2px rgba(11, 37, 69, .2); transition: transform var(--t);
}
.pcal-appel:hover { transform: translateY(-1px); }
.pcal-appel b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcal-appel span { opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcal-termine { background: var(--ink-45); }
.pcal-annule { background: var(--plaque); color: var(--ink-45); box-shadow: inset 0 0 0 1px var(--trait-fort); text-decoration: line-through; }
.pcal-maintenant { z-index: 2; height: 2px; left: 0; right: 0; background: var(--red); }
.pcal-maintenant::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.pcal-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.pcal-cle { display: inline-block; width: 12px; height: 12px; margin-left: 6px; border-radius: 3px; vertical-align: -1px; }
.pcal-cle:first-child { margin-left: 0; }
.pcal-cle-dispo { background: rgba(11, 37, 69, .1); }
.pcal-cle-appel { background: var(--ink); }
.pcal-cle-annule { box-shadow: inset 0 0 0 1px var(--trait-fort); }

.pcal-lien { margin-top: 24px; }
.pcal-adresse { display: flex; gap: 8px; margin-top: 12px; }
.pcal-adresse input { flex: 1; min-width: 0; font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.pcal-aide { margin: 14px 0 10px; padding-left: 18px; display: grid; gap: 6px; font-size: var(--fs-small); color: var(--ink-70); }
.pcal-aide b { color: var(--ink); }

/* Téléphone : une grille de sept colonnes ne se lit pas ; la liste, si. */
@media (max-width: 900px) {
  .pcal { overflow-x: auto; }
  .pcal-tete, .pcal-corps { min-width: 720px; }
  .pcal-titre { flex-basis: 100%; margin: 6px 0 0; }
  .pcal-nav { flex-wrap: wrap; }
  .pcal-adresse { flex-direction: column; }
}
.pticket-facturer { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--trait); }
.pticket-facturer form { margin: 0; }
.pfacturation-activer { display: grid; gap: 10px; margin-top: auto; }
.pfacturation-activer .pchamp { margin: 0; }

/* ======================================================= SCANNER
   Plein écran noir, comme l'appareil photo du téléphone : la vidéo au
   centre, la zone jaune par-dessus, les commandes au pouce. Le jaune est
   fonctionnel (il suit le document), pas décoratif : c'est le code que
   les utilisateurs connaissent du scanner de l'iPhone. */
html.pscanner-ouvert, html.pscanner-ouvert body { overflow: hidden; }
.pscanner {
  position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: #000; color: #fff; --tenu: 0;
  padding: var(--sure-haut) 0 var(--sure-bas);
}
.pscanner button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.pscanner-haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.pscanner-fermer { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .14) !important; font-size: 18px; }
.pscanner-compte { font-size: var(--fs-small); font-weight: 600; }
.pscanner-auto { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14) !important; font-size: var(--fs-small); font-weight: 600; }
.pscanner-auto.on { background: #FFCC00 !important; color: #111 !important; }
.pscanner-vue { position: relative; min-height: 0; }
.pscanner-vue video, .pscanner-calque { position: absolute; inset: 0; width: 100%; height: 100%; }
.pscanner-vue video { object-fit: contain; background: #000; }
.pscanner-aide { margin: 0; padding: 10px 20px 0; min-height: 2.6em; text-align: center; font-size: var(--fs-small); color: rgba(255, 255, 255, .85); }
.pscanner-bas { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 20px 20px; }
.pscanner-declencheur {
  width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  /* L'anneau se remplit pendant que le cadrage tient : la prise automatique approche. */
  background: conic-gradient(#FFCC00 calc(var(--tenu) * 360deg), rgba(255, 255, 255, .35) 0) !important;
}
.pscanner-declencheur i { width: 60px; height: 60px; border-radius: 50%; background: #fff; transition: transform 150ms var(--ease); }
.pscanner-declencheur:active i { transform: scale(.92); }
.pscanner-fini { justify-self: end; padding: 10px 16px; border-radius: 999px; background: #fff !important; color: #0B2545 !important; font-weight: 600; font-size: var(--fs-small); }
.pscanner-flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .7; pointer-events: none; animation: pscanner-flash 180ms ease-out forwards; }
@keyframes pscanner-flash { to { opacity: 0; } }

/* La revue : la page telle qu'elle partira, et le choix du rendu. */
.pscanner-revue { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 14px; padding: calc(16px + var(--sure-haut)) 16px calc(16px + var(--sure-bas)); background: #111; }
.pscanner-revue[hidden], .pscanner-coins[hidden] { display: none; }
.pscanner-apercu { min-height: 0; display: grid; place-items: center; }
.pscanner-apercu img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); background: #fff; }
.pscanner-filtres { display: flex; justify-content: center; gap: 6px; }
.pscanner-filtres button { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12) !important; font-size: var(--fs-small); font-weight: 600; }
.pscanner-filtres button.on { background: #fff !important; color: #111 !important; }
.pscanner-revue-bas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pscanner-revue-bas button { padding: 13px 10px; border-radius: 12px; background: rgba(255, 255, 255, .12) !important; font-weight: 600; font-size: var(--fs-small); }
.pscanner-revue-bas .pscanner-garder { grid-column: 1 / -1; background: #FFCC00 !important; color: #111 !important; font-size: var(--fs-body); }
.pscanner-coins { position: absolute; inset: 0; z-index: 3; background: #000; }

/* Scanner : la lampe, la note de qualité, et « Reprendre » en premier quand la page est mauvaise. */
.pscanner-haut-droite { display: flex; gap: 8px; }
.pscanner-lampe { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14) !important; font-size: var(--fs-small); font-weight: 600; }
.pscanner-lampe.on { background: #fff !important; color: #111 !important; }
.pscanner-qualite { margin: 0; text-align: center; font-size: var(--fs-small); font-weight: 600; color: #7BE0A4; }
.pscanner-mauvaise .pscanner-qualite { color: #FFCC00; }
.pscanner-mauvaise .pscanner-reprendre { grid-column: 1 / -1; order: -1; background: #FFCC00 !important; color: #111 !important; font-size: var(--fs-body); }
.pscanner-mauvaise .pscanner-garder { background: rgba(255, 255, 255, .12) !important; color: #fff !important; font-size: var(--fs-small); }
.preprendre { display: grid; gap: 12px; }
.preprendre p { margin: 0; }
.preprendre form { margin: 0; }
.pscanner-mauvaise .pscanner-garder { grid-column: auto; }
/* Déclencheur inactif tant que la zone jaune n'est pas là : il ne prend qu'elle. */
.pscanner-declencheur[aria-disabled="true"] { opacity: .35; }
.pscanner-declencheur.arme { opacity: 1; }

/* Bandeau du site de test, sur chaque page. */
.penv-test { position: fixed; top: 0; left: 50%; z-index: 999; transform: translateX(-50%); margin: 0; padding: 4px 14px; border-radius: 0 0 10px 10px; background: #FFCC00; color: #111; font-size: var(--fs-label); font-weight: 700; pointer-events: none; }
