/* Mijoka — L'Office : administration, sur ordinateur comme sur tablette et téléphone.
   Barre latérale à icônes (tiroir sur petit écran), contenu aéré, CSS natif moderne
   (grilles, :has(), conteneurs adaptatifs, color-mix), aucune bibliothèque externe. */
.office {
  --cible: 44px;
  --office-fond: #F6F1E9;
  --office-barre: #2B1B11;
  --office-barre-texte: #F4E9DA;
  --office-barre-doux: color-mix(in srgb, var(--office-barre-texte) 62%, transparent);
  --office-rayon: 16px;
  --office-ombre: 0 1px 2px rgba(43, 27, 17, .06), 0 8px 24px rgba(43, 27, 17, .07);
  font-size: 16px;
  background: var(--office-fond);
}
.office .carte { border: 0; border-radius: var(--office-rayon); box-shadow: var(--office-ombre); }
.office .icone { width: 20px; height: 20px; flex: none; }
.office .bouton { width: auto; font-size: 1rem; padding: 0 20px; }

/* ---------- Coque : bandeau en haut, menu latéral (ordinateur) ou barre d'icônes en bas (tablette, téléphone) ---------- */
.office { --bandeau: 68px; --barre-bas: 72px; }
.office-bandeau {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: var(--esp-3);
  height: var(--bandeau); padding: 0 clamp(14px, 3vw, 32px);
  background: color-mix(in srgb, #FFFDF8 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ligne); box-shadow: 0 1px 0 rgba(255, 255, 255, .6), 0 6px 18px rgba(43, 27, 17, .05);
}
.office-logo { display: flex; align-items: center; gap: var(--esp-3); text-decoration: none; color: var(--texte); min-width: 0; }
.office-logo img { display: block; height: 52px; width: auto; }
.office-logo .logo-compact { display: none; height: 40px; }
.office-titre {
  padding: 4px 12px; border-radius: 999px; background: var(--secondaire-doux); color: var(--secondaire);
  font-weight: 800; font-size: .85rem; white-space: nowrap;
}
.office-session { display: flex; align-items: center; gap: var(--esp-3); }
.office-session form { margin: 0; }
.office-qui { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; color: var(--texte-doux); }
/* Boutons du bandeau : même taille, centrés, jamais plus hauts que le bandeau (y compris au doigt) */
.office .office-session .office-bouton { height: 44px; min-height: 44px; margin: 0; padding: 0 16px; gap: 8px; flex: none; }
.office-bouton .icone { width: 20px; height: 20px; }
.office-nav-large { display: contents; }
.office-nav-autre { display: none; }
.office-autre { display: none; }

.office-app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100dvh - var(--bandeau)); }
.office-nav {
  position: sticky; top: var(--bandeau); align-self: start; height: calc(100vh - var(--bandeau)); height: calc(100dvh - var(--bandeau));
  display: flex; flex-direction: column; gap: 4px; padding: var(--esp-5) var(--esp-3);
  background: linear-gradient(180deg, #33200F 0%, var(--office-barre) 60%); color: var(--office-barre-texte); overflow-y: auto;
}
.office-nav a {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: var(--cible); padding: 0 14px; border-radius: 12px;
  color: var(--office-barre-doux); font-weight: 700; text-decoration: none; transition: background-color .15s, color .15s;
}
.office-nav a:hover { background: rgba(255, 255, 255, .06); color: var(--office-barre-texte); }
.office-nav a[aria-current="page"] { background: color-mix(in srgb, var(--m-orange) 22%, transparent); color: #fff; }
.office-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--m-orange); }
.office-nav a[aria-current="page"] .icone { color: #FFB27A; }
.office-nav a:focus-visible, .office-logo:focus-visible { outline: 3px solid var(--mise-en-avant); outline-offset: 2px; }
.office-contenu { display: flex; flex-direction: column; min-width: 0; }
.office-page { width: 100%; max-width: 1180px; margin: 0 auto; padding: var(--esp-6) clamp(16px, 4vw, 48px); flex: 1; container-type: inline-size; }
.office .pied { color: var(--texte-doux); }
.office-acces .office-bandeau { justify-content: center; }
.office-acces .office-page { max-width: 520px; }

/* Tablette et téléphone : cinq icônes fixées en bas, « Autre » ouvre un panneau qui monte */
@media (max-width: 999px) {
  .office-app { display: block; }
  .office-nav {
    position: fixed; z-index: 45; inset: auto 0 0 0; top: auto; height: auto;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, #FFFDF8 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid var(--ligne); box-shadow: 0 -6px 18px rgba(43, 27, 17, .06); color: var(--texte-doux);
  }
  .office-nav-large { display: none; }
  .office-nav a, .office-nav .office-nav-autre {
    flex-direction: column; justify-content: center; gap: 3px; min-height: 58px; padding: 4px 2px; border-radius: 12px;
    color: var(--texte-doux); font-size: .7rem; line-height: 1.1; text-align: center;
  }
  .office-nav .office-nav-autre {
    position: relative; display: flex; align-items: center; font: inherit; font-weight: 700; font-size: .7rem; line-height: 1.1;
    background: none; border: 0; cursor: pointer;
  }
  .office-nav-autre:focus-visible { outline: 3px solid var(--mise-en-avant); outline-offset: -3px; }
  .office-nav a span, .office-nav-autre span { max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }
  .office-nav a .icone, .office-nav-autre .icone { width: 24px; height: 24px; }
  .office-nav a:hover, .office-nav-autre:hover { background: none; color: var(--texte); }
  .office-nav a[aria-current="page"], .office-nav-autre[aria-current="page"] { background: none; color: var(--accent-fort); }
  .office-nav a[aria-current="page"] .icone, .office-nav-autre[aria-current="page"] .icone { color: var(--accent-fort); }
  .office-nav-autre[aria-current="page"]::before { content: ""; position: absolute; left: 25%; right: 25%; top: -6px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .office-nav a[aria-current="page"]::before { left: 25%; right: 25%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .office-contenu { padding-bottom: calc(var(--barre-bas) + env(safe-area-inset-bottom)); }
  .office-page { padding-top: var(--esp-5); }

  /* Panneau « Autre » : monte du bas, page derrière floutée et immobile */
  .office-autre[open] {
    display: flex; flex-direction: column; gap: var(--esp-3);
    position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 80dvh;
    padding: var(--esp-3) var(--esp-5) calc(var(--esp-5) + env(safe-area-inset-bottom));
    border: 0; border-radius: 24px 24px 0 0; background: #FFFDF8; color: var(--texte);
    box-shadow: 0 -12px 40px rgba(43, 27, 17, .18); overflow-y: auto;
    animation: autre-monte .25s cubic-bezier(.2, .8, .2, 1);
  }
  .office-autre.sortie { animation: autre-descend .2s ease-in forwards; }
  .office-autre .poignee { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: var(--ligne); }
  .office-autre h2 { margin: 0; font-size: 1.1rem; }
  .office-autre ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-1); }
  .office-autre a {
    display: flex; align-items: center; gap: var(--esp-3); min-height: 56px; padding: 0 var(--esp-3); border-radius: 14px;
    color: var(--texte); font-weight: 700; text-decoration: none; background: var(--surface); border: 1px solid var(--ligne);
  }
  .office-autre a[aria-current="page"] { border-color: var(--accent); color: var(--accent-fort); }
  .office-autre a .icone { width: 22px; height: 22px; color: var(--accent-fort); }
  .office-autre .bouton { align-self: stretch; gap: 8px; }
}
@keyframes autre-monte { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes autre-descend { from { transform: translateY(0); } to { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .office-autre[open], .office-autre.sortie { animation: none; } }
@media (max-width: 699px) {
  .office { --bandeau: 60px; }
  .office-logo .logo-complet { display: none; }
  .office-logo .logo-compact { display: block; }
  .office-titre { font-size: .78rem; padding: 3px 10px; }
  .office-qui { display: none; }
  .office .office-session .office-bouton { width: 44px; padding: 0; }
  .office-bouton span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .office-session { gap: var(--esp-2); }
}
@media (max-width: 380px) { .office-titre { display: none; } }
@media (pointer: coarse) {
  .office { --cible: 52px; font-size: 17px; }
  .office .bouton { min-height: 52px; }
}

/* ---------- En-tête de page ---------- */
.entete-section { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-1) var(--esp-4); }
.entete-section h1 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.entete-section .sous-titre { flex-basis: 100%; order: 3; margin: 0; color: var(--texte-doux); }
.entete-section > .bouton { margin: 0 0 0 auto; }

/* ---------- Chiffres clés ---------- */
.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--esp-4); }
.indicateur {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px var(--esp-3);
  padding: var(--esp-4) var(--esp-5); border-radius: var(--office-rayon); background: var(--surface); box-shadow: var(--office-ombre);
  color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s;
}
a.indicateur:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(43, 27, 17, .08), 0 14px 30px rgba(43, 27, 17, .1); }
.indicateur .icone { grid-row: span 2; width: 44px; height: 44px; padding: 11px; border-radius: 12px; background: var(--accent-doux); color: var(--accent-fort); }
.indicateur strong { font-family: var(--police-titre); font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.indicateur span { color: var(--texte-doux); font-weight: 700; font-size: .9rem; }
.indicateur.ok .icone { background: var(--secondaire-doux); color: var(--secondaire); }
.indicateur.attente .icone { background: #FFF2D6; color: #8A5A00; }
.indicateur.off .icone { background: #F6E1DE; color: var(--erreur); }

/* ---------- Composants ---------- */
.grille-2 { display: grid; gap: var(--esp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.chiffres { display: flex; gap: 28px; flex-wrap: wrap; }
.chiffres div { font-size: .9rem; color: var(--texte-doux); }
.chiffres strong { display: block; font-size: 1.6rem; color: var(--texte); }
table.donnees { width: 100%; border-collapse: separate; border-spacing: 0; }
table.donnees th, table.donnees td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
table.donnees th { position: sticky; top: 0; background: var(--surface); font-size: .85rem; font-weight: 800; color: var(--texte-doux); }
table.donnees tbody tr { transition: background-color .12s; }
table.donnees tbody tr:hover td { background: color-mix(in srgb, var(--accent-doux) 60%, transparent); }
table.donnees tbody tr:last-child td { border-bottom: 0; }
table.donnees td small { color: var(--texte-doux); }
.statut { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: .82rem; font-weight: 800; white-space: nowrap; }
.statut::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.statut.ok { background: var(--secondaire-doux); color: var(--secondaire); }
.statut.attente { background: #FFF2D6; color: #8A5A00; }
.statut.off { background: #F6E1DE; color: var(--erreur); }
.lien-activation { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.lien-activation input { width: 100%; font-family: ui-monospace, monospace; font-size: .85rem; }
.zone-danger { box-shadow: inset 0 0 0 2px #EBC3BD, var(--office-ombre) !important; }
.zone-danger h2 { color: var(--erreur); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.actions form { margin: 0; }
.formulaire-ligne { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.formulaire-ligne label { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.fiche-compte { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0 0 8px; }
.fiche-compte dt { color: var(--texte-doux); font-weight: 700; }
.fiche-compte dd { margin: 0; }
.carte-a-noter { box-shadow: inset 0 0 0 2px var(--mise-en-avant), var(--office-ombre) !important; }
.office .lien-retour { color: var(--accent-fort); margin-bottom: var(--esp-2); }

/* Tableaux en fiches quand la place manque (conteneur étroit) */
@container (max-width: 640px) {
  table.donnees, table.donnees tbody, table.donnees tr, table.donnees td { display: block; width: 100%; }
  table.donnees thead { display: none; }
  table.donnees tr { padding: 12px 0; border-bottom: 1px solid var(--ligne); }
  table.donnees tbody tr:last-child { border-bottom: 0; }
  table.donnees td { border: 0; padding: 3px 0; }
  table.donnees td[data-libelle]::before { content: attr(data-libelle) " : "; color: var(--texte-doux); font-size: .85rem; font-weight: 700; }
  table.donnees td[data-libelle]:first-child::before { content: none; }
  table.donnees tbody tr:hover td { background: none; }
  .entete-section > .bouton { flex-basis: 100%; margin: 0; }
  .office .bouton { width: 100%; }
  .fiche-compte { grid-template-columns: 1fr; gap: 0; }
  .fiche-compte dd { margin-bottom: var(--esp-3); overflow-wrap: anywhere; }
}

/* Fiche d'un foyer */
.entete-section { flex-wrap: wrap; justify-content: flex-start; }
.entete-section > .bouton { margin-left: auto; }
.barre-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--esp-2); margin-top: var(--esp-5); }
.barre-actions form { margin: 0; }
.barre-actions .bouton { margin: 0; }
details.confirmation { flex-basis: 100%; }
details.confirmation > summary { list-style: none; display: inline-flex; width: auto; }
details.confirmation > summary::-webkit-details-marker { display: none; }
details.confirmation[open] > summary { opacity: .55; }
details.confirmation .formulaire { margin-top: var(--esp-3); max-width: 560px; }
.barre-actions + .aide { margin-top: var(--esp-3); }
.lien-transmis { display: grid; grid-template-columns: auto 1fr; gap: var(--esp-4); align-items: center; }
.lien-transmis .qr { margin: 0; min-height: 0; }
.lien-transmis input { width: 100%; font-family: ui-monospace, monospace; font-size: .85rem; }
.tableau-foyers td a { text-decoration: none; }
@media (max-width: 860px) {
  .barre-actions { flex-direction: column; align-items: stretch; }
  .barre-actions .bouton, details.confirmation > summary { width: 100%; justify-content: center; }
  .lien-transmis { grid-template-columns: 1fr; justify-items: center; }
  .entete-section > .bouton { margin-left: 0; }
}

/* Recherche, filtre et tri des foyers */
.filtres-office { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: var(--esp-3); align-items: end; margin-bottom: var(--esp-3); }
.filtres-office > div { display: flex; flex-direction: column; min-width: 0; }
.filtres-office label { margin: 0 0 var(--esp-2); }
.filtres-office .bouton { margin: 0; }
.filtres-office select, .filtres-office input { width: 100%; }
table.donnees th a { color: inherit; text-decoration: none; }
table.donnees th a:hover { color: var(--accent-fort); }
@media (max-width: 860px) {
  .filtres-office { grid-template-columns: 1fr 1fr; }
  .filtres-office .champ-recherche { grid-column: 1 / -1; }
  .filtres-office .bouton { grid-column: 1 / -1; }
}
details.confirmation { flex-basis: auto; }
details.confirmation[open] { flex-basis: 100%; }
@media (max-width: 860px) {
  .fiche-compte { grid-template-columns: 1fr; gap: 0; }
  .fiche-compte dd { margin-bottom: var(--esp-3); overflow-wrap: anywhere; }
  details.confirmation { flex-basis: auto; }
}

/* ---------- Journal : lignes compactes, détail en fenêtre ---------- */
.filtres-journal { display: flex; flex-wrap: wrap; gap: var(--esp-2); }
.puce-lien { display: inline-flex; align-items: center; gap: var(--esp-2); min-height: 36px; padding: 0 14px; border: 2px solid var(--ligne); border-radius: 999px; color: var(--texte); font-weight: 700; text-decoration: none; background: var(--surface); }
.puce-lien.active { background: var(--accent-fort); border-color: var(--accent-fort); color: var(--accent-texte); }
.pastille { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--erreur); color: #fff; font-size: .75rem; }
.puce-lien.active .pastille { background: #fff; color: var(--accent-fort); }
.carte-journal { padding: var(--esp-5); }
.journal { list-style: none; margin: 0; padding: 0; }
.journal li + li { border-top: 1px solid var(--ligne); }
.journal-ligne {
  display: grid; grid-template-columns: 12px 96px minmax(120px, 190px) minmax(0, 1fr) minmax(0, 160px);
  gap: var(--esp-3); align-items: center; width: 100%;
  padding: 8px var(--esp-3); border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: .92rem; color: var(--texte); text-align: left; cursor: pointer;
}
.journal-ligne:hover, .journal-ligne:focus-visible { background: var(--accent-doux); outline: none; }
.journal-point { width: 10px; height: 10px; border-radius: 50%; background: #B9A48F; }
.niveau-attention .journal-point { background: var(--mise-en-avant); }
.niveau-erreur .journal-point { background: var(--erreur); }
.journal-ligne time { color: var(--texte-doux); font-variant-numeric: tabular-nums; white-space: nowrap; }
.journal-titre { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.niveau-erreur .journal-titre { color: var(--erreur); }
.journal-message, .journal-foyer { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texte-doux); }
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--esp-3); padding: var(--esp-3); }

.modale-journal { width: min(560px, calc(100vw - 32px)); padding: var(--esp-5); border: 0; border-radius: 18px; background: var(--surface); color: var(--texte); box-shadow: 0 30px 80px rgba(40, 20, 5, .35); }
.modale-journal::backdrop { background: rgba(40, 24, 12, .35); backdrop-filter: blur(3px); }
.modale-journal .fermer { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 1.6rem; line-height: 1; color: var(--texte-doux); cursor: pointer; }
.modale-journal .fermer:hover { background: var(--accent-doux); }
.modale-journal h2 { margin: 0 0 var(--esp-3); }
.detail-niveau { margin: 0 0 var(--esp-1); font-weight: 700; color: var(--texte-doux); }
.modale-journal.niveau-erreur .detail-niveau { color: var(--erreur); }
.modale-journal.niveau-attention .detail-niveau { color: #A86A00; }
.detail-message { padding: var(--esp-3); border-radius: 10px; background: var(--fond); overflow-wrap: anywhere; }
.detail-aide { margin-top: var(--esp-4); padding: var(--esp-4); border-left: 4px solid var(--mise-en-avant); border-radius: 8px; background: #FFF7E6; }
.modale-journal.niveau-erreur .detail-aide { border-left-color: var(--erreur); background: #FBEDEB; }
.detail-aide h3 { margin: 0 0 var(--esp-1); font-size: 1rem; }
.detail-aide p + h3 { margin-top: var(--esp-3); }

@media (max-width: 860px) {
  .journal-ligne { grid-template-columns: 12px 1fr auto; grid-template-areas: "point titre date" ". message message"; row-gap: 2px; }
  .journal-point { grid-area: point; }
  .journal-titre { grid-area: titre; }
  .journal-ligne time { grid-area: date; }
  .journal-message { grid-area: message; }
  .journal-foyer { display: none; }
}
.entete-section > h1 { order: 1; }
.entete-section > .bouton { order: 2; }
.entete-section > .sous-titre { order: 3; }
@container (max-width: 640px) { .entete-section > .bouton { order: 4; } }
@container (max-width: 640px) {
  .indicateurs { grid-template-columns: 1fr 1fr; gap: var(--esp-4); }
  .indicateur { padding: var(--esp-3); grid-template-columns: 1fr; }
  .indicateur .icone { grid-row: auto; width: 36px; height: 36px; padding: 8px; }
  .indicateur strong { font-size: 1.6rem; }
}

/* ---------- Mises à jour ---------- */
.version-installee { font-size: 1.3rem; margin-bottom: var(--esp-2); }
.version-installee strong { font-family: var(--police-titre); font-size: 1.6rem; color: var(--accent-fort); }
.notes-version { margin: var(--esp-3) 0; }
.notes-version h3 { margin: var(--esp-3) 0 var(--esp-1); font-size: 1rem; }
.notes-version ul { margin: 0; padding-left: 1.2em; }
.office details.confirmation + details.confirmation, .office table + details.confirmation { margin-top: var(--esp-4); }
.office td details.confirmation { text-align: left; }
input[type=file] { min-height: var(--cible); padding: 10px; border: 2px dashed var(--ligne); border-radius: 12px; background: var(--surface); width: 100%; }
.diagnostic > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-3); cursor: pointer; list-style: none; }
.diagnostic > summary::-webkit-details-marker { display: none; }
.diagnostic > summary h2 { margin: 0; }
.diagnostic[open] > summary { margin-bottom: var(--esp-3); }
.controles { list-style: none; margin: 0 0 var(--esp-3); padding: 0; display: grid; gap: var(--esp-2); }
.controles li { position: relative; padding-left: 30px; }
.controles li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--secondaire) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 13px no-repeat; }
.controles li.ko::before { background: var(--erreur) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center / 12px no-repeat; }
.controles li span { color: var(--texte-doux); font-size: .9rem; overflow-wrap: anywhere; }
pre.commande { margin: 0 0 var(--esp-2); padding: var(--esp-3); border-radius: 12px; background: #2B1B11; color: #F4E9DA; font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
progress { width: 100%; height: 10px; accent-color: var(--accent); }

/* Mises à jour par Git */
.changements { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.aide-jeton summary { cursor: pointer; font-weight: 700; color: var(--accent-fort); min-height: 44px; display: flex; align-items: center; }
.aide-jeton ol { margin: var(--esp-2) 0 0; padding-left: 1.3em; display: grid; gap: var(--esp-2); }
.pastille-maj { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--m-orange); box-shadow: 0 0 0 2px #FFFDF8; }
.office-nav a .pastille-maj { top: 12px; left: 30px; }
@media (max-width: 999px) { .office-nav a .pastille-maj { top: 6px; left: calc(50% + 6px); } }

/* Passe charte : cibles tactiles de 44 px au moins (filtres du journal, retour) */
.puce-lien { min-height: 44px; }
.office .lien-retour { display: inline-flex; align-items: center; min-height: 44px; }
.donnees td a:not(.bouton) { display: inline-flex; align-items: center; min-height: 44px; }

/* Fenêtre d'avancement (installation, restauration, sauvegarde) : logo qui mijote, étapes, page floutée */
.avancement {
  position: fixed; inset: 0; margin: auto; height: fit-content; width: min(440px, calc(100vw - 32px));
  border: 0; border-radius: 20px; padding: var(--esp-6) var(--esp-5) var(--esp-5); text-align: center;
  background: #FFFDF8; color: var(--texte); box-shadow: 0 24px 60px rgba(43, 27, 17, .28);
}
.avancement[open] { display: grid; gap: var(--esp-4); justify-items: center; animation: avancement-arrivee .25s ease-out; }
.avancement:focus, .avancement:focus-visible { outline: none; }
.avancement h2 { margin: 0; font-size: 1.2rem; }
.avancement .aide { margin: 0; }
.avancement-logo { position: relative; width: 96px; height: 96px; }
.avancement-logo img { display: block; width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 6px 18px rgba(43, 27, 17, .15); animation: avancement-mijote 1.6s ease-in-out infinite; }
.vapeur { position: absolute; top: -6px; width: 8px; height: 22px; border-radius: 8px; background: rgba(232, 96, 28, .35); filter: blur(1px); animation: avancement-vapeur 1.8s ease-out infinite; }
.vapeur:nth-of-type(1) { left: 34px; }
.vapeur:nth-of-type(2) { left: 46px; animation-delay: .6s; }
.vapeur:nth-of-type(3) { left: 58px; animation-delay: 1.2s; }
.avancement-barre { width: 100%; height: 10px; border-radius: 999px; background: var(--secondaire-doux); overflow: hidden; }
.avancement-barre span { display: block; width: 8%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--m-orange), var(--accent-fort)); transition: width 1.2s ease; }
.avancement-etapes { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 6px; text-align: left; }
.avancement-etapes li { display: flex; align-items: center; gap: 10px; min-height: 32px; color: var(--texte-doux); }
.avancement-etapes li::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ligne); }
.avancement-etapes li.en-cours { color: var(--texte); font-weight: 800; }
.avancement-etapes li.en-cours::before { border-color: var(--accent-fort); border-right-color: transparent; animation: avancement-tourne .8s linear infinite; }
.avancement-etapes li.fait { color: var(--secondaire); }
.avancement-etapes li.fait::before { border-color: var(--secondaire); background: var(--secondaire); box-shadow: inset 0 0 0 3px #FFFDF8; }
@keyframes avancement-arrivee { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes avancement-mijote { 50% { transform: translateY(-3px); } }
@keyframes avancement-vapeur { 0% { opacity: 0; transform: translateY(6px) scaleY(.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px) scaleY(1.1); } }
@keyframes avancement-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .avancement-logo img, .vapeur, .avancement-etapes li.en-cours::before, .avancement[open] { animation: none; } .avancement-barre span { transition: none; } }

/* Recettes : contrôles de Mijoka et création par IA */
.controles li.attention::before { background: var(--m-moutarde, #F5A623) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233A2410' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M12 6v8M12 18v.5'/%3E%3C/svg%3E") center / 13px no-repeat; }
.creer-recettes fieldset { border: 0; padding: 0; margin: 0; }
.creer-recettes legend { font-weight: 700; padding: 0; margin-bottom: var(--esp-2); }
.creer-recettes legend .aide { font-weight: 600; }
.creer-recettes .puces { margin-top: 0; }
.creer-recettes #nombre-ia { max-width: 8em; }
.compte { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--secondaire-doux); color: var(--secondaire); font-size: .85rem; vertical-align: middle; }
.actions-ligne { display: inline-flex; flex-wrap: wrap; gap: var(--esp-2); justify-content: flex-end; margin: 0; }
.donnees td small { color: var(--texte-doux); }
.avancement-etapes li.echec { color: var(--erreur, #B3261E); }
.avancement-etapes li.echec::before { border-color: var(--erreur, #B3261E); background: var(--erreur, #B3261E); }
.avancement [data-creation-fin] { margin: 0; }
.avancement [hidden] { display: none; }
.moteur-ia > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-3); cursor: pointer; list-style: none; }
.moteur-ia > summary h2 { margin: 0; }
.moteur-ia[open] > summary { margin-bottom: var(--esp-4); }
.etapes-office { margin: 0; padding-left: 1.4em; display: grid; gap: var(--esp-2); }
.etapes-office small { color: var(--texte-doux); }
.indicateur .mijo b { width: 40px; height: 40px; }
.creer-recettes > fieldset, .creer-recettes > .grille-2 { margin-top: var(--esp-4); }
.creer-recettes > fieldset:first-of-type { margin-top: 0; }
.statut.statut-long { white-space: normal; display: inline-flex; align-items: baseline; line-height: 1.35; padding-block: 6px; }
/* Audit charte : cibles de 44 px au moins, titres de résumé qui ne se coupent pas */
.office .puce span, .office a.puce { min-height: 44px; }
details.carte > summary { min-height: 44px; }
.moteur-ia > summary { flex-wrap: wrap; }
.moteur-ia > summary h2 { white-space: nowrap; }
.pagination .aide { white-space: nowrap; }
