/* OneCloud — l'apparence « Logiciel ».
   Reprise de la version faite avec ChatGPT le 19/09/2026 (Documentation/DA_Logiciel_ChatGPT).
   Clair ou sombre : light-dark(couleur du jour, couleur de la nuit).
   Par défaut on suit l'appareil ; le menu du compte permet de forcer Jour ou Nuit. */

/* ------------------------------------------------------------ les couleurs */
:root {
  color-scheme: light dark;
  --fond:          light-dark(#ffffff, #202020);
  --doux:          light-dark(#f0f1f3, #2d2d2d);   /* le haut, les onglets, la barre d'état */
  --encre:         light-dark(#22252a, #f0f0f0);   /* le texte */
  --gris:          light-dark(#656b74, #b8bcc4);   /* le texte secondaire */
  --trait:         light-dark(#d2d6dc, #454545);   /* les bordures */
  --accent:        light-dark(#176ac1, #a1ceff);   /* le bleu */
  --choisi:        light-dark(#ddecfd, #314b67);   /* la ligne choisie */
  --choisi-bord:   light-dark(#b8d2ee, #4e6e8e);
  --dossier-fond:  light-dark(#f5ce72, #927533);   /* les dossiers jaunes */
  --dossier-trait: light-dark(#bc8b25, #f0cc77);
  --pdf:           light-dark(#b3473e, #e4a298);
  --image:         light-dark(#8a5cc2, #c9b2ef);
  --video:         light-dark(#9b4fb5, #d7a8e8);
  --plan:          light-dark(#2f8577, #9ad5c9);
  --maquette:      light-dark(#3b62b5, #a9c0f0);
  --archive:       light-dark(#9a6b3f, #dcbb96);
  --audio:         light-dark(#c2410c, #f5b28a);
  --word:          light-dark(#2b579a, #8fb4f0);
  --excel:         light-dark(#217346, #8fd0a8);
  --powerpoint:    light-dark(#b7472a, #f0a58f);
  --danger:        light-dark(#c4314b, #ff99a4);
}
/* Jour / Nuit choisis dans le site (menu du compte). Sans réglage, on suit l'appareil.
   Une seule ligne suffit : tous les light-dark() du dessus basculent avec. */
html[data-theme="clair"]  { color-scheme: light; }
html[data-theme="sombre"] { color-scheme: dark; }

/* ------------------------------------------------------------ la base */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--fond); color: var(--encre); font: 12px/1.35 "Segoe UI", system-ui, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.reserve-icones { display: none; }
.ic { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* l'application prend tout l'écran : le haut et le bas restent, la liste défile */
.app { height: 100dvh; display: flex; flex-direction: column; }

/* ------------------------------------------------------------ 1. le haut */
.haut { display: flex; align-items: center; gap: 12px; padding: 9px 13px; background: var(--doux); }
.marque { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.marque .ic { width: 19px; height: 19px; color: var(--accent); }
.recherche { display: flex; align-items: center; gap: 8px; width: 300px; margin-left: auto; padding: 6px 8px;
  border: 1px solid var(--trait); border-radius: 4px; background: var(--fond); color: var(--gris); }
.recherche input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--encre); font-size: 12px; outline-offset: 3px; }
.recherche input::placeholder { color: var(--gris); opacity: 1; }
.compte { position: relative; }
.avatar { width: 25px; height: 25px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--trait); font-size: 11px; flex-shrink: 0; }
.avatar[aria-expanded="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.qui { display: grid; gap: 1px; padding: 7px 9px 9px; margin-bottom: 4px; border-bottom: 1px solid var(--trait); }
.qui span { color: var(--gris); font-size: 11px; }
.titre-menu { padding: 5px 9px 3px; color: var(--gris); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
/* la loupe et le voile ne servent qu'au téléphone */
.loupe, .voile { display: none; }

/* ------------------------------------------------------------ 2. les onglets, reliés à la zone du dessous */
.onglets { display: flex; align-items: flex-end; gap: 2px; padding: 0 10px; background: var(--doux); border-bottom: 1px solid var(--trait); }
.onglet { position: relative; top: 1px; display: flex; align-items: center; gap: 6px; padding: 10px 12px; white-space: nowrap;
  background: transparent; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; font-size: 12px; }
.onglet .ic { width: 14px; height: 14px; }
.onglet[aria-pressed="true"] { background: var(--fond); border-color: var(--trait); }
.onglet[aria-pressed="true"] .ic { color: var(--accent); }
/* le petit rond : des liens ont été téléchargés depuis la dernière visite de l'onglet */
.onglet[data-nouveau]:not([data-nouveau=""])::after { content: attr(data-nouveau); min-width: 16px; padding: 0 5px; border-radius: 8px;
  background: var(--accent); color: var(--fond); font-size: 10px; line-height: 16px; text-align: center; }

.ajouter { position: relative; margin-left: auto; margin-bottom: 4px; }
.bouton-ajouter { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--trait); border-radius: 4px; background: var(--fond); font-size: 11px; white-space: nowrap; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 185px; padding: 5px;
  background: var(--fond); border: 1px solid var(--trait); border-radius: 5px; box-shadow: 0 6px 18px light-dark(#16253c20, #00000044); }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px; border: 0; background: transparent; text-align: left; font-size: 12px; border-radius: 3px; }
.menu button:hover { background: var(--choisi); }
.menu hr { border: 0; border-top: 1px solid var(--trait); margin: 4px 2px; }
.menu button.coche::after { content: "✓"; margin-left: auto; color: var(--accent); }
.menu button.danger, .menu button.danger .ic { color: var(--danger); }
.menu-contexte, .menu-tri { position: fixed; top: 0; right: auto; z-index: 20; }   /* placés par script.js */
.menu-contexte { min-width: 190px; }
.menu-tri { min-width: 160px; }

/* ------------------------------------------------------------ 3. la barre de commandes */
/* une seule ligne, toujours la même hauteur : l'adresse se raccourcit par la gauche, comme dans Windows */
.commandes { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; padding: 8px 12px; border-bottom: 1px solid var(--trait); }
.adresse { display: flex; align-items: center; justify-content: flex-end; gap: 2px; flex: 0 1 auto; min-width: 0; overflow: hidden;
  padding: 3px 6px; border: 1px solid var(--trait); border-radius: 3px; font-size: 12px; }
.adresse > * { flex-shrink: 0; }
.retour, .actions, .tri { flex-shrink: 0; }
.adresse::before { content: "›"; color: var(--gris); font-size: 15px; margin: 0 4px 0 2px; }
.adresse button { padding: 2px 4px; border: 0; border-radius: 3px; background: transparent; white-space: nowrap; }
.adresse button:hover { background: var(--doux); }
.adresse .sep { color: var(--gris); }
.retour { display: flex; align-items: center; gap: 5px; padding: 5px 6px; border: 0; background: transparent; color: var(--accent); font-size: 11px; }
.retour .ic { width: 14px; height: 14px; }
.espaceur { flex: 1; }
.trier { display: flex; align-items: center; gap: 5px; margin-left: 4px; padding: 5px 8px; border: 0; border-left: 1px solid var(--trait); background: transparent; font-size: 11px; white-space: nowrap; }
.trier .ic { width: 13px; height: 13px; }
.trier[aria-pressed="true"] { color: var(--accent); }
.actions { display: flex; gap: 2px; margin-left: 4px; }
.action { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 0; border-radius: 3px; background: transparent; font-size: 12px; white-space: nowrap; }
.action:hover { background: var(--doux); }
.action:disabled { opacity: .35; cursor: default; }
.action:disabled:hover { background: transparent; }
.action .ic { width: 15px; height: 15px; color: var(--accent); }
.action.danger, .action.danger .ic { color: var(--danger); }
.statut .annuler { padding: 0 4px; border: 0; background: none; color: var(--accent); text-decoration: underline; font-size: 11px; }

/* ------------------------------------------------------------ 4. la liste */
.contenu { position: relative; flex: 1; min-height: 0; overflow: auto; padding: 0 7px 8px; user-select: none; }
.lasso { position: absolute; z-index: 2; pointer-events: none; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.liste.charge { opacity: .45; }
.liste { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.liste .col-date { width: 146px; }
.liste .col-type { width: 145px; }
.liste .col-taille { width: 90px; }
.liste .col-reste { width: 0; }                       /* la place en trop, à droite, quand on a réglé les colonnes */
.liste th { position: sticky; top: 0; height: 28px; padding: 5px 9px; background: var(--fond); color: var(--gris); font-size: 11px; font-weight: 400; text-align: left;
  border-bottom: 1px solid var(--trait); border-right: 1px solid var(--trait); }
.liste th:last-child { border-right: 0; }
.liste th .titre { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* la poignée, sur le bord droit de chaque en-tête : on la tire pour élargir la colonne */
.poignee { position: absolute; top: 0; right: -4px; z-index: 1; width: 8px; height: 100%; cursor: col-resize; }
body.tirage, body.tirage * { cursor: col-resize !important; user-select: none; }
.liste td:nth-child(n+2) { overflow: hidden; text-overflow: ellipsis; }
.liste td:nth-child(4) { text-align: right; }
.liste th[data-tri] { cursor: pointer; user-select: none; }
.liste th[data-tri]:hover { background: var(--doux); }
.liste th.trie-haut .titre::after, .liste th.trie-bas .titre::after { margin-left: 6px; font-size: 8px; color: var(--gris); }
.liste th.trie-haut .titre::after { content: "▲"; }
.liste th.trie-bas .titre::after { content: "▼"; }
.liste td { height: 28px; padding: 4px 9px; line-height: 1.25; }
.liste td:nth-child(2), .liste td:nth-child(3), .liste td:nth-child(4) { font-size: 11px; white-space: nowrap; color: var(--gris); }
.liste tbody tr:hover { background: var(--doux); }
.liste tbody tr.choisi, .liste tbody tr.choisi:hover { background: var(--choisi); }
.liste tbody tr.choisi td { border-top: 1px solid var(--choisi-bord); border-bottom: 1px solid var(--choisi-bord); padding-top: 3px; padding-bottom: 3px; }

.fichier { display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.fichier span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* la 2e ligne (date · taille) et le bouton ⋮ : téléphone seulement */
.fichier .sous, .fichier .plus { display: none; }
.fichier .ic { color: var(--gris); }
.fichier[data-type="dossier"] .ic { color: var(--dossier-trait); fill: var(--dossier-fond); }
.fichier[data-type="pdf"] .ic { color: var(--pdf); }
.fichier[data-type="image"] .ic { color: var(--image); }
.fichier[data-type="video"] .ic { color: var(--video); }
.fichier[data-type="texte"] .ic { color: var(--accent); }
.fichier[data-type="plan"] .ic { color: var(--plan); }
.fichier[data-type="maquette"] .ic { color: var(--maquette); }
.fichier[data-type="archive"] .ic { color: var(--archive); }
.fichier[data-type="audio"] .ic { color: var(--audio); }
.fichier[data-type="word"] .ic { color: var(--word); }
.fichier[data-type="excel"] .ic { color: var(--excel); }
.fichier[data-type="powerpoint"] .ic { color: var(--powerpoint); }
/* une étoile après le nom d'un favori ; le champ pour renommer, à la place du nom */
.liste tr.favori .fichier > .nom::after { content: " ★"; color: light-dark(#d49a00, #f5c542); }
.fichier input.renommer { flex: 1; min-width: 0; padding: 1px 4px; border: 1px solid var(--accent); border-radius: 2px; background: var(--fond); color: var(--encre); font-size: 12px; user-select: text; }
.fichier mark { background: light-dark(#ffe58a, #6b5a14); color: inherit; border-radius: 2px; }

.vide { padding: 30px 9px; margin: 0; color: var(--gris); }

/* ------------------------------------------------------------ 5. la barre d'état */
.etat { display: flex; align-items: center; gap: 8px; padding: 7px 13px; background: var(--doux); border-top: 1px solid var(--trait); font-size: 11px; color: var(--gris); }
.etat .ic { width: 12px; height: 12px; }
.statut { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* une seule ligne */
.espace { white-space: nowrap; }

/* ------------------------------------------------------------ la blague : « And it's gone » */
.parti { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: #000000b0; cursor: pointer; }
.parti figure { margin: 0; text-align: center; color: #fff; }
.parti video { display: block; width: min(400px, 90vw); border-radius: 6px; }
.parti figcaption { margin-top: 10px; font-size: 15px; }

/* ------------------------------------------------------------ déposer, déplacer */
.contenu.depot { outline: 2px dashed var(--accent); outline-offset: -4px; }       /* des fichiers du PC arrivent */
.fantome { position: fixed; z-index: 50; pointer-events: none; padding: 4px 9px; border-radius: 4px; background: var(--accent); color: var(--fond); font-size: 11px; white-space: nowrap; }
.liste tbody tr.cible { outline: 2px solid var(--accent); outline-offset: -2px; }  /* le dossier où l'on va lâcher */
.adresse button.cible { background: var(--choisi); outline: 1px solid var(--accent); }
body.deplace, body.deplace * { cursor: grabbing !important; }

/* ------------------------------------------------------------ « Envoyer un dossier du PC » (OneVerif V2) */
.boite.grande { width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
.depot-pc { display: grid; place-items: center; gap: 12px; min-height: 160px; margin: 12px 0; padding: 16px; border: 2px dashed var(--trait); border-radius: 8px; color: var(--gris); text-align: center; }
.fenetre-envoi.survol .depot-pc { border-color: var(--accent); color: var(--accent); }
.compteurs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.compteur { display: grid; gap: 2px; padding: 10px; border: 1px solid var(--trait); border-radius: 6px; background: var(--fond); text-align: left; font-size: 11px; color: var(--gris); }
.compteur b { font-size: 20px; font-weight: 600; color: var(--encre); }
.compteur.actif { border-color: var(--accent); background: var(--choisi); }
.details { max-height: 240px; overflow: auto; margin: 0 0 12px; padding: 6px 10px; border: 1px solid var(--trait); border-radius: 6px; list-style: none; font-size: 11px; }
.details li { padding: 2px 0; overflow-wrap: anywhere; }
.details li span, .details .rien { color: var(--gris); }
.copier-tout { width: 100%; padding: 9px; }
.copier-tout:disabled { opacity: .7; }
.progression { display: grid; gap: 4px; font-size: 11px; color: var(--gris); }
.progression progress { width: 100%; height: 10px; }
.echecs { margin-top: 12px; color: var(--danger); font-size: 11px; }
.echecs ul { margin: 4px 0 0; padding-left: 16px; }
@media (max-width: 600px) { .compteurs { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------------------ « Déplacer vers… » */
.boite-deplacer .ou { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; font-size: 11px; color: var(--gris); overflow-wrap: anywhere; }
.boite-deplacer .dossiers { max-height: min(50dvh, 360px); overflow: auto; margin: 0; padding: 4px; border: 1px solid var(--trait); border-radius: 6px; list-style: none; }
.boite-deplacer .dossiers button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; border-radius: 4px; background: transparent; text-align: left; }
.boite-deplacer .dossiers button:hover { background: var(--choisi); }
.boite-deplacer .dossiers .ic { color: var(--dossier-trait); fill: var(--dossier-fond); }
.boite-deplacer .dossiers .rien { padding: 8px; color: var(--gris); font-size: 11px; }
.boite-deplacer .pied .bouton-principal:disabled { opacity: .5; }

/* ------------------------------------------------------------ la question avant de vider la corbeille */
.fenetre-confirmer .question { margin: 0 0 4px; font-size: 13px; line-height: 1.5; }
.bouton-danger, .pied .bouton-danger { padding: 6px 14px; border: 1px solid var(--danger); border-radius: 4px; background: var(--danger); color: var(--fond); }

/* ------------------------------------------------------------ la petite fenêtre « Partager » */
.fenetre { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: #00000066; }
.boite { width: min(470px, 100%); padding: 16px; background: var(--fond); border: 1px solid var(--trait); border-radius: 8px; box-shadow: 0 10px 30px #00000040; }
.boite h2 { margin: 0 0 6px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.aide, .note-locale { margin: 0 0 10px; color: var(--gris); font-size: 11px; }
.note-locale { margin: 10px 0 0; }
.ligne-lien { display: flex; gap: 6px; }
.champ-lien { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--trait); border-radius: 4px; background: var(--doux); font-size: 12px; }
.bouton-principal { padding: 6px 14px; border: 0; border-radius: 4px; background: var(--accent); color: var(--fond); white-space: nowrap; }
.pied { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.pied button { padding: 6px 10px; border: 1px solid var(--trait); border-radius: 4px; background: transparent; }
.pied .couper-ce-lien { display: flex; align-items: center; gap: 6px; padding-left: 0; border: 0; color: var(--danger); }
.couper-ce-lien .ic { width: 14px; height: 14px; }

/* ------------------------------------------------------------ les écrans moyens (petit portable, tablette) */
@media (max-width: 900px) {
  .action span { display: none; }            /* les boutons gardent leur dessin, sans le texte */
  .recherche { width: 200px; }
}
@media (max-width: 760px) {
  .onglet { padding: 10px 8px; }
  .liste .col-type { width: 0 !important; }
  .liste th:nth-child(3), .liste td:nth-child(3) { display: none; }
}

/* ============================================================ LE TÉLÉPHONE
   Sur un téléphone, OneCloud n'est plus un logiciel de bureau rétréci :
   · le haut tient sur une ligne, la recherche s'ouvre à la loupe ;
   · les onglets descendent en bas, sous le pouce ;
   · chaque fichier est une ligne de 58 px : nom, puis date · taille en dessous ;
   · les menus s'ouvrent en bas de l'écran, en grand (« feuille »).
   Rien de tout cela ne change quoi que ce soit au PC. */
@media (max-width: 700px) {

  /* --- l'ordre : haut · adresse · liste · état · onglets (en bas) */
  .haut      { order: 1; }
  .commandes { order: 2; }
  .contenu   { order: 3; }
  .etat      { order: 4; }
  .onglets   { order: 5; }

  /* --- 1. le haut : une seule ligne */
  .haut { flex-wrap: wrap; gap: 8px; padding: 9px 12px; }
  .marque { font-size: 15px; }
  .marque .ic { width: 22px; height: 22px; }
  .loupe { display: grid; place-items: center; width: 40px; height: 40px; margin-left: auto; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--gris); }
  .loupe .ic { width: 21px; height: 21px; }
  .avatar { width: 34px; height: 34px; font-size: 13px; }
  .recherche { display: none; }
  body.chercher .recherche { display: flex; order: 3; width: 100%; margin: 0; padding: 9px 10px; }
  body.chercher .recherche input { font-size: 16px; outline: none; }
  body.chercher .recherche:focus-within { border-color: var(--accent); }
  body.chercher .loupe { color: var(--accent); }

  /* --- 2. la ligne d'adresse : ‹ retour · où on est · trier */
  .commandes { gap: 4px; padding: 4px 8px; }
  .retour { order: -1; padding: 8px; }                  /* la flèche à gauche, avant le chemin */
  .retour span, .trier span { display: none; }
  /* le chemin entier ne tient pas : on n'affiche que le dossier où on est, la flèche remonte */
  .adresse { flex: 1 1 auto; justify-content: flex-start; border: 0; padding: 2px 0; font-size: 14px; font-weight: 600; }
  .adresse::before, .adresse .sep, .adresse button:not(:last-of-type) { display: none; }
  .adresse button { padding: 4px 2px; }
  .actions { display: none; }                /* au doigt, tout passe par le menu ⋮ */
  .trier { min-height: 40px; padding: 8px; border-left: 0; }

  /* --- 3. la liste : une ligne par fichier, sur deux étages */
  .contenu { padding: 0 0 76px; }                        /* de la place sous le dernier fichier, pour le « + » */
  .liste, .liste tbody, .liste tr { display: block; width: 100%; }
  .liste thead, .liste colgroup, .poignee { display: none; }
  .liste td { display: none; }
  .liste td:first-child { display: block; height: auto; padding: 0; }
  .liste tbody tr { border-bottom: 1px solid color-mix(in srgb, var(--trait) 60%, transparent); }
  .liste tbody tr.choisi td, .liste tbody tr.choisi td:first-child { border: 0; padding: 0; }
  .fichier { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 12px; min-height: 58px; padding: 8px 4px 8px 14px; }
  .fichier .ic { grid-row: 1 / span 2; width: 26px; height: 26px; stroke-width: 1.4; }
  .fichier > .nom { grid-column: 2; font-size: 14px; line-height: 1.3; white-space: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .fichier > .sous { grid-column: 2; display: block; margin-top: 2px; color: var(--gris); font-size: 11.5px; }
  .fichier .plus { grid-column: 3; grid-row: 1 / span 2; display: grid; place-items: center; width: 44px; height: 44px;
    padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--gris); }
  .fichier .plus .ic { grid-row: auto; width: 20px; height: 20px; }
  .fichier input.renommer { grid-column: 2; font-size: 16px; padding: 6px; }
  .vide { padding: 40px 18px; text-align: center; font-size: 13px; }

  /* --- 4. les onglets, en bas, sous le pouce */
  .onglets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 0; padding-bottom: env(safe-area-inset-bottom);
    background: var(--doux); border-top: 1px solid var(--trait); border-bottom: 0; }
  .onglet { flex-direction: column; justify-content: center; gap: 3px; top: 0; min-height: 56px; padding: 7px 2px;
    border: 0; border-radius: 0; font-size: 10px; color: var(--gris); }
  .onglet .ic { display: block; width: 22px; height: 22px; }
  .onglet[aria-pressed="true"] { background: transparent; color: var(--accent); }
  .onglet[data-nouveau]:not([data-nouveau=""])::after { position: absolute; top: 4px; left: 54%; }

  /* le « + », en pastille au-dessus des onglets */
  .ajouter { position: fixed; right: 14px; bottom: calc(98px + env(safe-area-inset-bottom)); z-index: 11; margin: 0; }
  /* pendant qu'une feuille est ouverte, la pastille « + » s'efface */
  body.feuille .bouton-ajouter { opacity: 0; pointer-events: none; }
  /* « Envoyer un dossier du PC » choisit un dossier du disque : ça n'existe pas sur un téléphone */
  .menu-ajouter [data-creer="comparer"] { display: none; }
  .bouton-ajouter { width: 54px; height: 54px; justify-content: center; padding: 0; border: 0; border-radius: 17px;
    background: var(--accent); color: light-dark(#fff, #12243a); box-shadow: 0 6px 18px #0000004d; }
  .bouton-ajouter .ic { width: 25px; height: 25px; }
  .bouton-ajouter span { display: none; }

  /* --- 5. les menus : une feuille qui monte du bas */
  .voile { display: block; position: fixed; inset: 0; z-index: 9; background: #00000059; }
  .menu, .menu-contexte, .menu-tri { position: fixed !important; left: 0 !important; right: 0; top: auto !important; bottom: 0 !important;
    z-index: 10; width: 100%; min-width: 0 !important; max-height: 72dvh; overflow: auto;
    padding: 8px 8px calc(12px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--trait);
    border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px #00000038; }
  .menu::before { content: ""; display: block; width: 38px; height: 4px; margin: 2px auto 10px; border-radius: 2px; background: var(--trait); }
  .menu button { min-height: 50px; padding: 13px 12px; gap: 13px; border-radius: 8px; font-size: 14px; }
  .menu .ic { width: 21px; height: 21px; }
  .menu .qui { padding: 2px 12px 12px; }
  .menu .titre-menu { padding: 10px 12px 4px; }

  /* --- 6. le reste */
  .etat { padding: 6px 12px; font-size: 11px; }
  .fenetre { place-items: end center; padding: 0; }
  .boite { width: 100%; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .boite.grande { max-height: 88dvh; }
  .compteurs { grid-template-columns: repeat(2, 1fr); }
}

/* au doigt : des cibles plus grandes */
@media (pointer: coarse) {
  button { min-height: 44px; }
  .fichier { min-height: 44px; }
  input { font-size: 16px !important; }
}

/* ------------------------------------------------------------ la page de connexion */
.page-connexion { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: var(--doux); }
.carte-connexion { width: min(360px, 100%); padding: 22px; background: var(--fond); border: 1px solid var(--trait); border-radius: 8px; box-shadow: 0 10px 30px #0000001a; }
.carte-connexion .marque { margin-bottom: 18px; }
.carte-connexion h1 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.carte-connexion form { display: grid; gap: 11px; }
.carte-connexion label { display: grid; gap: 4px; color: var(--gris); font-size: 11px; }
.carte-connexion input:not([type="checkbox"]) { padding: 7px 9px; border: 1px solid var(--trait); border-radius: 4px; background: var(--fond); color: var(--encre); font-size: 13px; }
.carte-connexion .case { display: flex; align-items: center; gap: 7px; color: var(--encre); font-size: 12px; }
.carte-connexion .petit, .carte-connexion .nouvelle-cle { margin: -5px 0 0; color: var(--gris); font-size: 11px; }
.carte-connexion .nouvelle-cle p { margin: 0 0 6px; }
.carte-connexion .nouvelle-cle b { color: var(--encre); font-weight: 600; }
.carte-connexion .cle-a-recopier { color: var(--encre); font-family: Consolas, monospace; font-size: 12px; user-select: all; }
.qr svg { display: block; width: 190px; height: 190px; margin: 4px auto 8px; border-radius: 4px; }
.lien-bouton { min-height: 0 !important; padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; font-size: 11px; }
.carte-connexion .bouton-principal { padding: 9px; font-size: 13px; }
.carte-connexion .bouton-principal:disabled { opacity: .6; }
.carte-connexion .erreur { margin: 12px 0 0; color: var(--danger); font-size: 12px; }
.carte-connexion .erreur:empty { display: none; }

/* la page de connexion, au téléphone : pas de carte, on remplit l'écran */
@media (max-width: 700px) {
  .page-connexion { align-content: start; padding: 9dvh 20px 20px; background: var(--fond); }
  .carte-connexion { width: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .carte-connexion .marque { margin-bottom: 26px; font-size: 19px; }
  .carte-connexion .marque .ic { width: 26px; height: 26px; }
  .carte-connexion h1 { font-size: 16px; }
  .carte-connexion form { gap: 15px; }
  .carte-connexion label { font-size: 12px; }
  .carte-connexion input:not([type="checkbox"]) { padding: 12px 11px; font-size: 16px; }
  .carte-connexion .bouton-principal { padding: 14px; font-size: 15px; }
  .carte-connexion .case input { width: 20px; height: 20px; }
}
