/* Thème de la suite d'essai : carte blanche, vert AnonySocial, police système. */
:root {
  color-scheme: light;
  --vert: #2e7d32;
  --vert-clair: #e8f3ea;
  --trait: #d7e0d9;
  --texte: #1c2b21;
  --doux: #55645a;
  --fond: #e6efe8;
  --danger: #a3231b;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  padding: 20px 16px 40px;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.carte {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 14px;
  padding: 24px 22px;
  box-shadow: 0 1px 2px rgba(28, 43, 33, .06);
}

.marque { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.marque img { width: 30px; height: 30px; }
.marque span { font-weight: 700; }
.badge {
  margin-left: auto; font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--vert); border: 1px solid #b9d4bd; border-radius: 999px; padding: 2px 8px;
}

h1 { font-size: 1.4rem; margin: 0 0 6px; }
h2 { font-size: 1.05rem; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
.doux { color: var(--doux); font-size: .93rem; }
.petit { font-size: .85rem; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }

input[type="password"], input[type="text"], input[type="email"] {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  color: var(--texte);
  background: #fff;
  border: 1px solid #b9c6bc;
  border-radius: 10px;
}
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid #9cc9a2;
  outline-offset: 2px;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 11px 16px;
}
.primaire { background: var(--vert); color: #fff; font-weight: 600; width: 100%; margin-top: 18px; }
.primaire:disabled { opacity: .6; cursor: progress; }
.secondaire { background: #fff; color: var(--vert); border-color: #b9d4bd; }
.lien {
  background: none; border: 0; padding: 0; color: var(--vert); text-decoration: underline;
  font-size: .9rem;
}

.verdict { margin-top: 8px; font-size: .9rem; }
.verdict.ok { color: var(--vert); }
.verdict.ko { color: var(--danger); }
.erreur { color: var(--danger); font-size: .92rem; margin-top: 10px; }
.aide { color: var(--doux); font-size: .85rem; margin-top: 6px; }

.duree { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.duree label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 0; }
.duree input { margin-top: 4px; }

.code-secours {
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  font-size: 1.25rem;
  letter-spacing: .06em;
  white-space: pre-line;
  overflow-wrap: anywhere;
  background: var(--vert-clair);
  border: 1px dashed #9cc9a2;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  margin: 12px 0;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.actions button { flex: 1 1 160px; }

[hidden] { display: none !important; }

.pied { max-width: 560px; margin: 16px auto 0; text-align: center; font-size: .82rem; color: var(--doux); }
.pied a { color: var(--vert); }

.charge { display: flex; align-items: center; gap: 10px; color: var(--doux); font-size: .9rem; }
.point {
  width: 10px; height: 10px; border-radius: 50%; background: var(--vert);
  animation: pulse 1s infinite ease-in-out;
}
@keyframes pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

@media print {
  body { background: #fff; padding: 0; }
  .carte { border: 0; box-shadow: none; max-width: none; }
  .actions, .primaire, .lien, .pied { display: none !important; }
  .code-secours { border: 2px solid #000; font-size: 1.6rem; }
}

/* ---- Accueil, barre commune et réglages ---- */

.page { width: 100%; max-width: 900px; margin: 0 auto; }
.lede { color: var(--doux); max-width: 62ch; }

.entete {
  max-width: 900px;
  margin: 0 auto 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 14px;
  padding: 12px 16px;
}
.entete-marque { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; }
.entete-marque img { width: 34px; height: 34px; }
.entete-etat { margin: 0; color: var(--doux); font-size: .92rem; }
.entete-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; position: relative; }
.entete-actions .secondaire { padding: 8px 12px; font-size: .92rem; }

.pill {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--doux);
  border: 1px solid var(--trait);
  border-radius: 999px;
  padding: 1px 8px;
  vertical-align: middle;
}
.pill.vert { color: var(--vert); border-color: #b9d4bd; background: var(--vert-clair); }

.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 18px 0 26px; }
.tuile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 14px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}
.tuile:hover { border-color: #b9d4bd; }
.tuile.desactive { opacity: .72; cursor: default; }
.tuile-icone { font-size: 1.5rem; line-height: 1; }
.tuile-texte { display: flex; flex-direction: column; }
.tuile-texte span { color: var(--doux); font-size: .9rem; }
.tuile .pill { margin-left: auto; }

.autres h2 { font-size: 1.05rem; margin: 0 0 8px; }
.autres ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.autres li { color: var(--doux); }
.autres a { color: var(--vert); }

.pied-accueil { margin-top: 28px; display: flex; gap: 8px; flex-wrap: wrap; color: var(--doux); font-size: .88rem; }
.pied-accueil a { color: var(--vert); }

/* Sauvegarde de nuit : la ligne discrète de l'accueil, et la ligne rouge
   commune à toutes les pages (point 3 de la 8 bis). */
.etat-sauvegarde { flex-basis: 100%; font-size: .85rem; }
.bandeau-sauvegarde {
  margin: 0;
  padding: 9px 16px;
  background: #fbeceb;
  border-bottom: 1px solid #e5b4b0;
  color: var(--danger);
  font-size: .92rem;
  font-weight: 600;
  text-align: center;
}





.barre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  /* 1000 px depuis le 22/11 (900 avant) : avec AnonyKanban, sept entrées ne
     tenaient plus sur une ligne à côté de « Réglages » et « Verrouiller ». */
  max-width: 1000px;
  margin: 0 auto 18px;
  padding: 6px 6px;
  background: #1b5e20;
  border: 1px solid #1b5e20;
  border-radius: 12px;
  font-size: .93rem;
}
.barre a,
.barre .lien { color: #e4ece4; text-decoration: none; padding: 4px 8px; border-radius: 6px; }
.barre .lien { color: #fff; text-decoration: underline; }
.barre a:hover,
.barre .lien:hover { color: #fff; background: rgb(255 255 255 / 10%); }
.barre a[aria-current="page"] { color: #fff; font-weight: 700; background: rgb(255 255 255 / 16%); }
.barre a:focus-visible,
.barre .lien:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.barre-droite { margin-left: auto; display: flex; gap: 4px; align-items: center; position: relative; }

/* 29/11 — la barre du téléphone montre une icône et un petit nom (voir le bloc
   ≤ 600 px) ; sur ordinateur, seuls les noms longs restent, comme avant. */
.barre .barre-icone,
.barre .barre-court { display: none; }

/* D4 — l'icône de compte et son menu, dans l'en-tête de chaque page. */
.compte-bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 50%;
  background: rgb(255 255 255 / 12%);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
}
.compte-bouton:hover { background: rgb(255 255 255 / 22%); }
.compte-bouton:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* APK-1 — sur l'en-tête clair de l'accueil, l'icône doit rester lisible. */
.entete-actions .compte-bouton {
  color: #1b5e20;
  background: #eef4ee;
  border-color: #9bc19f;
}
.entete-actions .compte-bouton:hover { background: #dcebdd; }
.entete-actions .compte-bouton:focus-visible { outline-color: #1b5e20; }
.menu-compte {
  /* APK-1 — le menu vit dans <body>, en fixed : la barre qui défile ne le
     rogne plus. La position est calculée à l'ouverture (menu-compte.js). */
  position: fixed;
  top: auto;
  right: auto;
  z-index: 10000;
  min-width: 190px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  color: var(--texte);
  border: 1px solid var(--trait);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 18%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-compte[hidden] { display: none; }
.menu-compte button,
.menu-compte a {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.menu-compte button:hover,
.menu-compte a:hover { background: #eef4ee; }
.menu-compte [data-compte="deconnexion"] { color: #a3231b; }
.menu-compte-version {
  margin: 4px 2px 0;
  padding: 8px 10px 2px;
  border-top: 1px solid var(--trait);
  color: var(--doux);
  font-size: .78rem;
  line-height: 1.35;
}

.carte-section {
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 14px 0;
}
.carte-section h2 { margin-top: 0; }
.carte-section .primaire { width: auto; margin-top: 14px; padding: 10px 16px; }
.carte-section select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid #b9c6bc;
  border-radius: 10px;
  background: #fff;
}
.carte-section progress { width: 100%; height: 10px; margin-top: 8px; }

.message { font-size: .92rem; margin-top: 10px; }
.message.ok { color: var(--vert); }
.message.erreur { color: var(--danger); }

.phrase-proposee {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--vert-clair);
  border: 1px dashed #9cc9a2;
  border-radius: 10px;
}
.phrase-proposee strong { display: block; font-size: 1.1rem; margin-top: 4px; letter-spacing: .02em; }
.champ-avec-voir { display: flex; gap: 8px; align-items: center; }
.champ-avec-voir input { flex: 1; }
.champ-avec-voir .voir {
  flex: 0 0 auto;
  padding: 9px 12px;
  font-size: .85rem;
  background: #fff;
  color: var(--vert);
  border: 1px solid #b9d4bd;
}

/* ---- Garde : rien ne s'affiche avant que le coffre soit confirmé ---- */

.ecran-garde { display: none; }
body.en-attente > :not(.ecran-garde) { display: none !important; }
body.en-attente .ecran-garde {
  display: flex;
  /* Sans cette ligne, le titre, le texte et le bouton se rangent côte à côte :
     sur un téléphone, cela fait trois colonnes étroites (défaut du 11/11,
     19 h 16 et 19 h 28). L'écran « Ta connexion a expiré » réutilise cette
     règle : c'est ici que se joue sa mise en page. */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  box-sizing: border-box;
  text-align: center;
  min-height: 70vh;
  color: var(--doux);
  font-size: .95rem;
}
/* Le texte de l'écran de garde ne s'étale pas sur toute la largeur d'un grand
   écran ; sur un téléphone, il prend la largeur disponible. */
body.en-attente .ecran-garde > :is(h1, p) {
  max-width: 32rem;
  margin: 0;
}

/* ---- Installation de l'application ---- */

.installation {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 16px;
  margin: 0 0 26px;
}
.installation > button { flex: 0 0 auto; }
.conseils {
  flex: 1 1 260px;
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 12px;
  padding: 12px 16px;
}
.conseils p { margin: 0 0 6px; }
.conseils ol { margin: 0; padding-left: 22px; color: var(--doux); font-size: .92rem; }

/* ---- AnonyDoc : liste des documents ---- */

.page-docs { max-width: 900px; }
.docs-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 18px;
  margin-bottom: 18px;
}
.docs-tete h1 { margin: 0; }
.docs-tete .lede { margin: 4px 0 0; }
.docs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.docs-actions .primaire, .docs-actions .secondaire { width: auto; margin-top: 0; padding: 10px 16px; }

.docs-filtres {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.docs-filtres label { margin: 0; font-weight: 600; font-size: .9rem; }
.docs-filtres input[type="search"] {
  flex: 1 1 220px;
  padding: 9px 12px;
  font: inherit;
  border: 1px solid #b9c6bc;
  border-radius: 10px;
  background: #fff;
}
.docs-filtres select {
  padding: 9px 12px;
  font: inherit;
  border: 1px solid #b9c6bc;
  border-radius: 10px;
  background: #fff;
}

.liste-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.doc-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 12px;
  padding: 12px 16px;
}
.doc-lien {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.doc-lien:hover .doc-titre { text-decoration: underline; }
.doc-titre { font-weight: 600; overflow-wrap: anywhere; }
.doc-date { color: var(--doux); font-size: .85rem; }
/* Conseil sous la ligne d'actions (« enregistre-le en .docx… »). */
.doc-note { flex-basis: 100%; color: var(--doux); font-size: .82rem; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.doc-actions .lien { font-size: .88rem; }
/* APK-2 — pendant le téléchargement, le lien est désactivé et doit se voir. */
.doc-actions .lien:disabled,
.doc-actions .lien[aria-disabled="true"] { opacity: .42; text-decoration: none; cursor: not-allowed; }
.doc-actions .danger { color: var(--danger); }

.vide {
  background: #fff;
  border: 1px dashed var(--trait);
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  color: var(--doux);
}

.corbeille-section { margin-top: 24px; }
.corbeille-section > .lien { font-size: .92rem; }
#corbeille-bloc { margin-top: 12px; }

.dialogue {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--trait);
  border-radius: 14px;
  padding: 20px;
  color: var(--texte);
}
.dialogue::backdrop { background: rgba(28, 43, 33, .35); }
.dialogue h2 { margin-top: 0; }
.dialogue input { width: 100%; }
.dialogue .actions { margin-top: 14px; }
.dialogue .primaire { width: auto; margin-top: 0; }

/* ---- AnonyDoc : éditeur ---- */

.page-doc { max-width: 940px; }
.doc-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 12px;
}
.lien-retour { color: var(--vert); text-decoration: none; font-size: .92rem; }
.titre-doc {
  flex: 1 1 260px;
  min-width: 0;
  font: inherit;
  font-weight: 700;
  font-size: 1.25rem;
  padding: 8px 10px;
  color: var(--texte);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}
.titre-doc:hover { border-color: var(--trait); }
.titre-doc:focus { background: #fff; border-color: #b9c6bc; }

.etat-doc {
  font-size: .82rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid var(--trait);
  color: var(--doux);
  white-space: nowrap;
}
.etat-doc.etat-ok { color: var(--vert); border-color: #b9d4bd; background: var(--vert-clair); }
.etat-doc.etat-attente { color: #8a5a00; border-color: #e6cfa4; background: #fdf4e3; }
.etat-doc.etat-conflit { color: var(--danger); border-color: #e5b4b0; background: #fbeceb; }

.banniere {
  background: #fdf4e3;
  border: 1px solid #e6cfa4;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: .92rem;
}
.banniere .banniere-fermer { font-size: .86rem; white-space: nowrap; }

.editeur-cadre {
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 12px;
  overflow: hidden;
}
.editeur-cadre .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--trait); }
.editeur-cadre .ql-container.ql-snow { border: 0; font-family: inherit; font-size: 1rem; }
.editeur-cadre .ql-editor {
  min-height: 52vh;
  padding: 20px 22px;
  line-height: 1.6;
}
.editeur-cadre .ql-editor h1 { font-size: 1.6rem; }
.editeur-cadre .ql-editor h2 { font-size: 1.3rem; }
.editeur-cadre .ql-editor h3 { font-size: 1.1rem; }
.editeur-cadre .ql-editor blockquote { border-left: 3px solid var(--vert); padding-left: 14px; color: var(--doux); }
.editeur-cadre .ql-editor a { color: var(--vert); }

.doc-pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 12px;
  color: var(--doux);
  font-size: .88rem;
}
.doc-pied .doc-actions { margin-left: auto; }
.doc-pied .secondaire { padding: 8px 12px; font-size: .88rem; }

@media print {
  .doc-tete, .doc-pied, .ql-toolbar { display: none !important; }
}

/* ------------------------------------------------------- AnonyDrive (étape 5) */

.page-drive { position: relative; }

.fil {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 14px 0 4px;
  font-size: .92rem;
}
.fil .lien { font-size: .92rem; }

.liste-docs.grille {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-items: start;
}
.liste-docs.grille .doc-item { flex-direction: column; align-items: flex-start; }
.liste-docs.grille .doc-lien { gap: 4px; }
.liste-docs.grille .doc-titre { font-size: 1.02rem; }
.liste-docs.grille .doc-actions { margin-left: 0; }

/* 28/11 — AnonyDrive : une case à cocher par ligne, et la barre des lignes
   cochées (« Tout cocher », « Mettre à la corbeille (n) » ; dans la corbeille,
   « Restaurer (n) » et « Supprimer (n) »). 44 px de zone à toucher. */
.doc-case {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: -10px -8px -10px -12px;
  cursor: pointer;
}
.doc-case input,
.selection-tout input { width: 20px; height: 20px; margin: 0; accent-color: var(--vert); cursor: pointer; }
.doc-item.coche { border-color: var(--vert); background: var(--vert-clair); }
.liste-docs.grille .doc-case { align-self: flex-start; margin: -10px 0 -8px -12px; }
.selection-barre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0 0 10px;
  padding: 4px 12px;
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 12px;
}
.selection-barre.selection-active {
  position: sticky;
  top: 8px;
  z-index: 5;
  border-color: var(--vert);
  box-shadow: 0 4px 14px rgb(28 43 33 / 12%);
}
.selection-tout { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: .92rem; cursor: pointer; }
.selection-compte { color: var(--doux); font-size: .9rem; }
.selection-compte:empty { display: none; }
.selection-barre .secondaire { padding: 8px 12px; font-size: .9rem; }
.selection-barre .lien { font-size: .9rem; }
#corbeille-bloc .selection-barre { margin-top: 4px; }

.depot {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(46, 125, 50, .12);
  border: 3px dashed var(--vert);
  color: var(--vert);
  font-weight: 700;
  font-size: 1.1rem;
  pointer-events: none;
  text-align: center;
}

.envois { display: grid; gap: 8px; margin-top: 16px; }
.envoi {
  display: grid;
  grid-template-columns: 18px minmax(120px, 1fr) 2fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--trait);
  border-radius: 10px;
  background: #fff;
  font-size: .9rem;
}
.envoi-nom { font-weight: 600; overflow-wrap: anywhere; }
.envoi-etat { color: var(--doux); font-size: .85rem; white-space: nowrap; }
.envoi-fin { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.envoi progress { width: 100%; height: 8px; }
.envoi.fini { border-color: #b9d4bd; background: var(--vert-clair); }
.envoi.erreur { border-color: #e5b4b0; background: #fbeceb; }
.envoi.erreur .envoi-etat { color: var(--danger); }
.envoi-reessayer { font-size: .85rem; white-space: nowrap; }

/* D1 / D3 — le cercle qui tourne, la coche et l'erreur, à côté du fichier. */
.envoi-icone {
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}
.envoi-icone.tourne {
  border: 2px solid #d7e2d8;
  border-top-color: var(--vert);
  animation: tourne .9s linear infinite;
}
.envoi-icone.coche { color: #2e7d32; font-weight: 700; }
.envoi-icone.erreur { color: var(--danger); font-weight: 700; }
@keyframes tourne { to { transform: rotate(360deg); } }
.doc-statut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font-size: .82rem;
  color: var(--doux);
}
.doc-statut .envoi-icone { width: 14px; height: 14px; font-size: .85rem; }
.doc-statut.erreur { color: var(--danger); }

.dialogue select { width: 100%; }

.apercu-corps {
  max-height: 65vh;
  overflow: auto;
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.apercu-corps img,
.apercu-corps video { max-width: 100%; height: auto; border-radius: 8px; }
.apercu-corps audio { width: 100%; }
.apercu-corps pre {
  margin: 0;
  padding: 12px;
  max-height: 55vh;
  overflow: auto;
  background: #f6f8f6;
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .9rem;
}

.danger { color: var(--danger); border-color: #e5b4b0; }
#vider-corbeille { margin-top: 12px; width: auto; }

/* Menu « Exporter » de l'éditeur : PDF, Word, HTML, texte. */
.menu-export { position: relative; }
.menu-export > summary {
  list-style: none;
  cursor: pointer;
  background: #fff;
  border: 1px solid #b9d4bd;
  border-radius: 10px;
  color: var(--vert);
  padding: 8px 12px;
  font-size: .88rem;
  font-weight: 600;
}
.menu-export > summary::-webkit-details-marker { display: none; }
.menu-export > summary::after { content: ' ▾'; }
.menu-export[open] > summary { background: var(--vert-clair); }
.menu-export ul {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 5;
  min-width: 190px;
  list-style: none;
  margin: 0;
  padding: 6px;
  display: grid;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(28, 43, 33, .14);
}
.menu-export ul .lien { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; }
.menu-export ul .lien:hover { background: var(--vert-clair); }

/* Dictionnaire personnel, dans le menu « Correcteur » : un mot par ligne, avec
   « Retirer » (relecture du 01/11, décision 2). */
.menu-export ul .dico {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--trait);
}
.dico-titre { padding: 0 10px; font-size: .78rem; font-weight: 600; color: var(--doux); }
.dico-liste { display: grid; gap: 2px; max-height: 190px; overflow-y: auto; }
.dico-ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 10px;
  font-size: .85rem;
  overflow-wrap: anywhere;
}
.menu-export ul .dico-ligne .lien {
  display: inline;
  width: auto;
  flex: none;
  padding: 2px 6px;
  font-size: .8rem;
}
.dico-vide { margin: 0; padding: 2px 10px; font-size: .82rem; color: var(--doux); }

@media (max-width: 600px) {
  .docs-actions { margin-left: 0; width: 100%; }
  .docs-actions .primaire, .docs-actions .secondaire { flex: 1 1 140px; }
  .doc-actions { width: 100%; }
  .editeur-cadre .ql-editor { padding: 14px; }
  .envoi { grid-template-columns: 1fr; gap: 6px; }
  .envoi-etat { white-space: normal; }

  /* 29/11 — la barre commune du téléphone : un seul rang d'icônes avec leur petit
     nom, l'avatar à droite ; « Réglages » et « Verrouiller » ne vivent plus que
     dans le menu de l'avatar (A4.2 : le défilement de côté est retiré). */
  .barre {
    flex-wrap: nowrap;
    overflow: visible;
    gap: 0;
    padding: 4px;
    margin-bottom: 12px;
  }
  .barre > a {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    font-size: .68rem;
    line-height: 1.1;
    text-align: center;
  }
  .barre .barre-icone { display: block; font-size: 1.25rem; line-height: 1; }
  .barre .barre-court {
    display: block;
    font-size: .6rem;
    line-height: 1.05;
    text-align: center;
    /* Aucun nom coupé, ni ellipse : la police est assez petite pour que
       « Accueil », « Agenda » et « Kanban » tiennent à 360 px. */
    white-space: nowrap;
    overflow: visible;
    max-width: 100%;
  }
  /* Le nom long reste dans la page pour les lecteurs d'écran : caché
     visuellement, jamais `display: none`. */
  .barre .barre-long {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  /* L'avatar reste seul à droite ; les deux actions sont dans son menu. */
  .barre-droite { margin-left: 0; flex: 0 0 auto; padding-left: 0; gap: 0; }
  .barre-droite > a,
  .barre-droite > .lien { display: none; }
}

/* 29/11 — le plus petit téléphone (360 px) : huit applis et l'avatar dans 348 px ;
   le petit nom descend d'un cran pour qu'aucun ne soit coupé. */
@media (max-width: 380px) {
  .barre .barre-court { font-size: .56rem; }
}


/* ---------------------------------------------------------------------------------------------------------------
 * Administration en tableau (10/11/2026, B2) : cinq chiffres, onglets, tableau
 * des comptes. Sur téléphone les cartes s'empilent et le tableau défile en
 * largeur dans sa boîte.
 * ------------------------------------------------------------------------------------------------------------- */

.page-large { max-width: 1360px; }

.cartes-admin {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}
.carte-chiffre {
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 12px;
  padding: 14px 16px;
}
.carte-chiffre h2 {
  margin: 0 0 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--doux);
}
.carte-chiffre .chiffre { font-size: 1.85rem; font-weight: 700; line-height: 1.15; }
.carte-chiffre .detail { margin: 6px 0 0; font-size: .85rem; color: var(--doux); }
.carte-chiffre .detail a { color: var(--vert); }
.carte-chiffre.alerte { border-color: #e6c37a; background: #fdf6e6; }
.carte-chiffre.alerte .chiffre { color: #8a5a00; }
.carte-chiffre a { color: var(--vert); }

.onglets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.onglet {
  font: inherit;
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--texte);
}
.onglet[aria-selected="true"] { background: #1b5e20; border-color: #1b5e20; color: #fff; font-weight: 600; }
.onglet:focus-visible { outline: 2px solid var(--vert); outline-offset: 2px; }

.panneau { margin-top: 0; }
.panneau:focus-visible { outline: 2px solid var(--vert); outline-offset: 2px; }

.outils-tableau { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.outils-tableau .recherche,
.outils-tableau .filtre { display: flex; flex-direction: column; gap: 4px; }
.outils-tableau .recherche { flex: 1 1 260px; min-width: 200px; }
.outils-tableau input[type="search"],
.outils-tableau select {
  font: inherit;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #b9c6bc;
  border-radius: 8px;
  background: #fff;
}
.outils-tableau .primaire { width: auto; margin: 0; padding: 9px 16px; }

.tableau-defilant { overflow-x: auto; overscroll-behavior-x: contain; }
.tableau-admin { border-collapse: collapse; width: 100%; min-width: 1120px; font-size: .84rem; }
.tableau-admin th,
.tableau-admin td { text-align: left; vertical-align: middle; padding: 8px 6px; border-bottom: 1px solid var(--trait); }
.tableau-admin thead th {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--doux);
  white-space: nowrap;
}
.tableau-admin tbody tr:last-child td { border-bottom: none; }
.tableau-admin tbody tr:hover { background: #f7fbf8; }

.cellule-compte { min-width: 146px; }
.cellule-connexion { white-space: nowrap; }
.cellule-compte .identifiant { font-weight: 700; color: inherit; text-decoration: none; }
.cellule-compte .identifiant:hover,
.cellule-compte .identifiant:focus-visible { text-decoration: underline; }
.cellule-compte .sous { color: var(--doux); font-size: .76rem; }

.espace-barre { display: block; height: 7px; background: #e3ebe5; border-radius: 999px; overflow: hidden; margin-bottom: 5px; }
.espace-barre > span { display: block; height: 100%; background: var(--vert); }
.cellule-espace { min-width: 116px; }
.espace-chiffres { font-weight: 600; white-space: nowrap; }
.espace-detail { color: var(--doux); font-size: .72rem; }

.cellule-regularite { min-width: 214px; }
.cases-jour { display: flex; flex-wrap: nowrap; gap: 1px; margin-bottom: 5px; }
.case-jour { width: 6px; height: 13px; border-radius: 2px; background: #e6ece8; flex: 0 0 auto; }
.case-jour[data-actif="oui"] { background: var(--vert); }
.regularite-texte { color: var(--doux); font-size: .76rem; }

.cellule-connexions .nombre { font-weight: 700; font-size: 1.05rem; }
.cellule-connexions .sous,
.cellule-appareils .sous { color: var(--doux); font-size: .72rem; }
.cellule-appareils { min-width: 84px; }

.cellule-actions { min-width: 172px; }

.pill.bleu { color: #1d4e89; border-color: #b9cfe8; background: #eaf2fb; }
.pill.rouge { color: var(--danger); border-color: #e7bdb9; background: #fbecea; }
.pill.gris { color: #4a5560; border-color: #d6dde3; background: #eef1f4; }

.cellule-actions { white-space: nowrap; }
.cellule-actions .secondaire {
  width: auto;
  margin: 0 0 0 6px;
  padding: 6px 12px;
  font-size: .85rem;
}
.cellule-actions .secondaire:first-child { margin-left: 0; }
.cellule-actions .bouton-danger { color: var(--danger); border-color: #e0b4b0; }
.cellule-actions .protege { color: var(--doux); font-size: .85rem; }

.legende-tableau { margin-top: 12px; }

/* B4 : le bouton rouge du dialogue de suppression (inactif tant que le texte
   tapé ne correspond pas à l'identifiant). */
.dialogue .primaire.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.dialogue .primaire.danger:disabled { opacity: .45; cursor: not-allowed; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .cartes-admin { grid-template-columns: 1fr; }
  .outils-tableau .recherche { flex-basis: 100%; }
  .outils-tableau .primaire { width: 100%; }
  .tableau-admin { min-width: 980px; }
}

/* ---------------------------------------------------------------------------------------------------------------
 * Fiche d'un compte (10/11/2026, B3) : quatre chiffres, barres des semaines,
 * espace par appli, appareils et historique.
 * ------------------------------------------------------------------------------------------------------------- */

.fiche-chiffres { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 0; }
.lede .pill { margin-left: 8px; vertical-align: middle; }

.barres-semaine {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  margin: 10px 0 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--trait);
}
.barre-semaine { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.barre-semaine .valeur { font-size: .75rem; color: var(--doux); }
.barre-semaine .colonne { width: 100%; max-width: 46px; background: var(--vert); border-radius: 4px 4px 0 0; min-height: 2px; }
.barre-semaine .etiquette { font-size: .72rem; color: var(--doux); white-space: nowrap; }

.tableau-etroit { min-width: 0; }
.tableau-etroit th, .tableau-etroit td { padding: 8px 10px; }

.liste-appareils { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ligne-appareil {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px 10px;
  border: 1px solid var(--trait);
  border-radius: 10px;
  background: #fbfdfb;
}

.historique { display: grid; grid-template-columns: minmax(160px, max-content) 1fr; gap: 6px 16px; margin: 8px 0 0; }
.historique dt { font-weight: 600; }
.historique dd { margin: 0; color: var(--texte); }

@media (max-width: 700px) {
  .barres-semaine { height: 110px; gap: 4px; }
  .barre-semaine .etiquette { font-size: .65rem; }
  .historique { grid-template-columns: 1fr; gap: 2px; }
  .historique dd { margin-bottom: 8px; }
}

/* 29/11 : dans l'appli (classe posée par appli-entete.js), ce qui n'a pas lieu d'y être. */
.dans-appli .hors-appli { display: none !important; }

