/* Le panneau de Workers-TauMah. Aucune dépendance : il doit s'ouvrir sur
   un serveur sans accès à l'extérieur.

   LE TÉLÉPHONE D'ABORD. Les règles de base décrivent l'écran étroit, tenu
   d'une main : onglets en bas, sous le pouce ; cibles de 44 px ; champs
   en 16 px (en dessous, iOS zoome à chaque saisie). Le grand écran n'est
   qu'un @media en fin de fichier, qui desserre et pose les onglets à
   gauche. */
:root {
  --fond: #f3f4f8; --surface: #ffffff; --creux: #f6f7fa; --texte: #171a22; --discret: #5b6375;
  --trait: #e2e5ed; --trait-fort: #c9cedb; --neutre-fond: #eceef4;
  --accent: #3b4fe0; --accent-doux: #e9ecff; --sur-accent: #ffffff;
  --ok: #12754a; --ok-fond: #e1f5ea; --alerte: #b3261e; --alerte-fond: #fce8e6;
  --attente: #875800; --attente-fond: #fdf0cf;
  --ombre: 0 1px 2px rgba(18, 22, 40, .05), 0 6px 20px rgba(18, 22, 40, .05);
  --rayon: 14px; --rayon-petit: 10px;
  --h-entete: 56px; --h-onglets: 62px;
  --bas: env(safe-area-inset-bottom, 0px);
  --cote-g: env(safe-area-inset-left, 0px); --cote-d: env(safe-area-inset-right, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0e1016; --surface: #171a23; --creux: #1d212c; --texte: #e9ebf2; --discret: #979eb0;
    --trait: #282d3a; --trait-fort: #3a4152; --neutre-fond: #242935;
    --accent: #8fa0ff; --accent-doux: #222a55; --sur-accent: #0b0f26;
    --ok: #6ddba3; --ok-fond: #143024; --alerte: #ff8f85; --alerte-fond: #3b1b19;
    --attente: #f3c669; --attente-fond: #382d12;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent; overflow-wrap: break-word; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
h2 { font-size: 17px; line-height: 1.3; margin: 0; }
p { margin: 0; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86em; }
small { display: block; color: var(--discret); font-size: 13px; font-weight: 400; }
.discret { color: var(--discret); font-size: 14px; }
.note { margin-top: 10px; }
.grand { font-size: 28px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.erreur { color: var(--alerte); }
.message { font-size: 14px; padding: 10px 12px; border-radius: var(--rayon-petit); }
.message.erreur { background: var(--alerte-fond); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.planche { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ------------------------------------------------------------------
   Boutons et champs
   ------------------------------------------------------------------ */
input, select, textarea, button { font: inherit; color: inherit; margin: 0; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--rayon-petit);
  background: var(--accent); color: var(--sur-accent); font-weight: 600; font-size: 15px;
  white-space: nowrap; cursor: pointer; touch-action: manipulation;
  transition: filter .12s, transform .08s, background-color .12s; }
button:hover { filter: brightness(1.07); }
button:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: default; filter: none; transform: none; }
button.second { background: var(--neutre-fond); color: var(--texte); }
button.danger { background: var(--alerte-fond); color: var(--alerte); }
button.petit { min-height: 36px; padding: 0 12px; font-size: 14px; }
button.large { width: 100%; }
button.icone { width: 44px; padding: 0; background: none; color: var(--discret); }
button.icone:hover { background: var(--neutre-fond); color: var(--texte); filter: none; }
button.occupe { position: relative; color: transparent; pointer-events: none; }
button.occupe::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--sur-accent); border-right-color: transparent; animation: tourne .7s linear infinite; }
button.second.occupe::after { border-color: var(--texte); border-right-color: transparent; }

input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; min-width: 0; min-height: 44px; padding: 0 12px;
  background: var(--creux); border: 1px solid var(--trait-fort); border-radius: var(--rayon-petit);
  transition: border-color .12s, box-shadow .12s; }
textarea { padding: 10px 12px; resize: vertical; line-height: 1.45; display: block; }
input::placeholder, textarea::placeholder { color: var(--discret); opacity: .8; }
input:not([type=checkbox]):focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
input[type=checkbox] { accent-color: var(--accent); }

.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.champ > span:first-child, .champ > legend { font-size: 13px; font-weight: 600; color: var(--discret); padding: 0; }
.champ > legend { margin-bottom: 6px; }
.avec-bouton { position: relative; display: flex; }
.avec-bouton input { padding-right: 48px !important; }
.avec-bouton button { position: absolute; right: 0; top: 0; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer;
  border-top: 1px solid var(--trait); }
.option:first-of-type { border-top: 0; }
.option input { width: 20px; height: 20px; margin-top: 2px; flex: none; }

.ligne { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ligne .etire { flex: 1 1 180px; }
.pile { display: flex; flex-direction: column; gap: 10px; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: start; }
.grille.deux { grid-template-columns: 1fr 1fr; }

/* L'interrupteur : une case à cocher, dessinée. */
input.interrupteur { appearance: none; -webkit-appearance: none; flex: none; position: relative;
  width: 42px; height: 26px; border-radius: 99px; background: var(--trait-fort); cursor: pointer;
  transition: background-color .18s; }
input.interrupteur::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s; }
input.interrupteur:checked { background: var(--accent); }
input.interrupteur:checked::after { transform: translateX(16px); }

/* La puce à cocher : la case est là (clavier, lecteur d'écran), c'est
   son voisin qu'on voit. */
.puce { position: relative; display: inline-flex; cursor: pointer; }
.puce input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.puce span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--trait-fort); color: var(--discret); font-size: 14px; font-weight: 600;
  transition: background-color .12s, color .12s, border-color .12s; }
.puce input:checked + span { background: var(--accent-doux); border-color: var(--accent); color: var(--accent); }
.puce input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------
   La porte
   ------------------------------------------------------------------ */
#porte { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.porte { width: 100%; max-width: 384px; display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: 20px;
  padding: 28px 22px; box-shadow: var(--ombre); }
.porte h1 { font-size: 24px; }
.sceau { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--accent); color: var(--sur-accent); }
.sceau svg { width: 24px; height: 24px; }
.sceau.petit { width: 30px; height: 30px; border-radius: 9px; }
.sceau.petit svg { width: 16px; height: 16px; }
.secoue { animation: secoue .32s; }

/* ------------------------------------------------------------------
   L'ossature : en-tête, onglets, contenu
   ------------------------------------------------------------------ */
.entete { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  height: var(--h-entete); padding: 0 calc(6px + var(--cote-d)) 0 calc(16px + var(--cote-g));
  background: var(--surface); border-bottom: 1px solid var(--trait); }
.marque { display: flex; align-items: center; gap: 10px; min-width: 0; }
.marque strong { font-size: 16px; white-space: nowrap; }
.marque .discret { font-size: 12px; white-space: nowrap; }
.direct { margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--discret); white-space: nowrap; }
.direct i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: bat 2.4s ease-out infinite; }
.direct.coupe { color: var(--alerte); }
.direct.coupe i { background: var(--alerte); animation: none; }

#onglets { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  height: calc(var(--h-onglets) + var(--bas));
  padding: 0 var(--cote-d) var(--bas) var(--cote-g);
  background: var(--surface); border-top: 1px solid var(--trait); }
#onglets button { flex-direction: column; gap: 2px; min-height: 0; padding: 0; border-radius: 0;
  background: none; color: var(--discret); font-size: 11px; font-weight: 500; letter-spacing: .01em; }
#onglets button:hover { filter: none; color: var(--texte); }
#onglets button:active { transform: none; }
#onglets .ico { position: relative; display: grid; place-items: center; width: 48px; height: 28px;
  border-radius: 99px; transition: background-color .15s, color .15s; }
#onglets button[aria-current] { color: var(--texte); font-weight: 700; }
#onglets button[aria-current] .ico { background: var(--accent-doux); color: var(--accent); }
#onglets .long { display: none; }
.pastille { position: absolute; top: -4px; left: 28px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; background: var(--accent); color: var(--sur-accent);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface); font-variant-numeric: tabular-nums; }
.pastille.attente { background: var(--attente); color: var(--surface); }
.pastille.alerte { background: var(--alerte); color: var(--surface); }

main { padding: 20px calc(16px + var(--cote-d)) calc(var(--h-onglets) + var(--bas) + 28px) calc(16px + var(--cote-g)); }
main > section { display: flex; flex-direction: column; gap: 14px; animation: parait .18s ease-out; }
.vue-tete { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; }
.vue-tete > p { grid-column: 1 / -1; }
.bloc-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
main > section > .bloc-tete { margin-top: 8px; }
.carte > .bloc-tete { margin-bottom: 10px; }

.bandeau { position: sticky; top: calc(var(--h-entete) + 8px); z-index: 5; margin-bottom: 14px;
  padding: 10px 14px; border-radius: var(--rayon-petit); text-align: center; font-size: 14px; font-weight: 600;
  background: var(--alerte-fond); color: var(--alerte); border: 1px solid var(--alerte); box-shadow: var(--ombre); }

.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; }
.carte > h2 { margin-bottom: 6px; }
.carte > h2 + .discret, .carte > .bloc-tete + .discret { margin-bottom: 12px; }
.carte > button { margin-top: 12px; }
.vide { color: var(--discret); text-align: center; padding: 22px 12px; font-size: 15px; }
.vide small { margin-top: 2px; }

/* ------------------------------------------------------------------
   Parc
   ------------------------------------------------------------------ */
.appel { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--rayon);
  background: var(--attente-fond); border: 1px solid var(--attente); }
.appel svg { width: 24px; height: 24px; color: var(--attente); }
.appel div { flex: 1; min-width: 0; }
.appel b { display: block; }
.appel p { font-size: 13px; color: var(--discret); }

.tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tuile { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 10px 4px; text-align: center; min-width: 0; }
.tuile b { display: block; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tuile span { display: block; color: var(--discret); font-size: 11.5px; line-height: 1.3; }

/* Sur un téléphone, la rangée de filtres défile jusqu'aux bords de l'écran. */
.segments { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  flex: 0 0 calc(100% + 32px); margin: 0 -16px; padding: 2px 16px; }
.segments::-webkit-scrollbar { display: none; }
.segments button { min-height: 36px; padding: 0 12px; border-radius: 99px; font-size: 14px; font-weight: 500;
  background: var(--surface); color: var(--discret); border: 1px solid var(--trait); }
.segments button b { font-weight: 600; font-variant-numeric: tabular-nums; opacity: .75; }
.segments button[aria-pressed=true] { background: var(--texte); border-color: var(--texte); color: var(--fond); font-weight: 600; }

/* Dans une fenêtre : deux choix qui se partagent la largeur. */
.segments.pleins { flex: none; margin: 0; padding: 0; overflow: visible; }
.segments.pleins button { flex: 1; min-height: 40px; }
.message.attente { background: var(--attente-fond); color: var(--attente); }

.cartes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }

/* LA FICHE : une machine, ou un projet. Ce qu'on lit en haut, ce qu'on
   règle au milieu, ce qu'on décide en bas. */
.fiche { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); }
.fiche[data-ton=attente] { border-color: var(--attente); background:
  linear-gradient(var(--attente-fond), var(--attente-fond)) top / 100% 4px no-repeat, var(--surface); }
.fiche[data-ton=alerte] { border-color: var(--alerte); }
.fiche-tete { display: flex; align-items: flex-start; gap: 10px; }
.fiche-titre { flex: 1; min-width: 0; }
.fiche-titre b { display: block; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.fiche-titre small { overflow-wrap: anywhere; }
.fiche-detail { font-size: 14px; color: var(--discret); padding: 8px 10px; border-radius: 8px; background: var(--creux); }
.fiche[data-ton=alerte] .fiche-detail { background: var(--alerte-fond); color: var(--alerte); }
.fiche-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fiche-actions button { flex: 1 1 auto; }
.fiche.eteinte .fiche-titre, .fiche.eteinte .mesures, .fiche.eteinte .voyant, .fiche.eteinte .fiche-chiffres { opacity: .6; }

.voyant { flex: none; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--trait-fort); }
.voyant.ok { background: var(--ok); }
.voyant.attente { background: var(--attente); }
.voyant.alerte { background: var(--alerte); }
.voyant.actif { animation: bat 1.6s ease-out infinite; }

.etat { display: inline-flex; align-items: center; flex: none; min-height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--neutre-fond); color: var(--discret); }
.etat.ok { background: var(--ok-fond); color: var(--ok); }
.etat.attente { background: var(--attente-fond); color: var(--attente); }
.etat.alerte { background: var(--alerte-fond); color: var(--alerte); }
.etat.accent { background: var(--accent-doux); color: var(--accent); }

.mesures { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0; }
.mesures > div { min-width: 0; }
.mesures .pleine { grid-column: 1 / -1; }
.mesures dt { font-size: 12px; color: var(--discret); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.mesures dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mesures dd .jauge { margin: 7px 0 5px; }

.jauge { height: 6px; border-radius: 99px; background: var(--neutre-fond); overflow: hidden; }
.jauge i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent);
  transition: width .6s ease; }
.jauge.pleine-presque i { background: var(--attente); }
.suivi { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--discret);
  font-variant-numeric: tabular-nums; }
.carte > .suivi { margin-top: 12px; }

.fiche-modele b { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.vram { display: flex; align-items: center; gap: 10px; }
.vram > span { font-size: 12px; font-weight: 600; color: var(--discret); letter-spacing: .05em; }
.vram .jauge { flex: 1; min-width: 32px; }
.vram small { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fiche-chiffres { font-size: 13.5px; color: var(--discret); font-variant-numeric: tabular-nums; }
.fiche-pied { display: flex; align-items: center; gap: 10px; }
.rappel { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }

.reglages { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; border-top: 1px solid var(--trait);
  animation: parait .18s ease-out; }
.bascules { display: flex; flex-direction: column; background: var(--creux);
  border: 1px solid var(--trait); border-radius: var(--rayon-petit); }
.bascule { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; cursor: pointer;
  border-top: 1px solid var(--trait); }
.bascule:first-child { border-top: 0; }
.bascule > span { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; }

.droits { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------
   Listes : file, versions, dépôts
   ------------------------------------------------------------------ */
.rangees { list-style: none; margin: 0; padding: 0; }
.rangees li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--trait); min-width: 0; }
.rangees li:first-child { border-top: 0; padding-top: 4px; }
.rangees li:last-child { padding-bottom: 4px; }
.rangees.compact li { padding: 8px 0; font-size: 14px; }
.rangees.compact:empty { display: none; }
.rangees .corps { flex: 1; min-width: 0; }
.rangees .corps b { display: block; overflow-wrap: anywhere; }
.rangees .corps .jauge { margin-top: 8px; }
.rangees .corps .etat { margin: 4px 6px 0 0; }
.rangees .fin { flex: none; text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--discret); }
.rang { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--neutre-fond); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.carte > .rangees + button, .depot + .rangees { margin-top: 10px; }
/* Une rangée au nom long (un fichier de modèle) : sur un téléphone, le
   nom prend toute la largeur, le chiffre et le bouton passent dessous. */
.rangees li.longue { flex-wrap: wrap; row-gap: 8px; }
.rangees li.longue .corps { flex: 1 1 100%; }
.rangees li.longue .fin { flex: 1; text-align: left; }
.rangees li.longue .fin small { display: inline; margin-left: 6px; }

.depot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 22px 16px; border: 2px dashed var(--trait-fort); border-radius: var(--rayon); cursor: pointer;
  transition: border-color .12s, background-color .12s; }
.depot svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 4px; }
.depot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.depot:hover, .depot.survol { border-color: var(--accent); background: var(--accent-doux); }
.depot:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------
   Essais
   ------------------------------------------------------------------ */
.reponse { margin-top: 12px; padding: 12px 14px; border-radius: var(--rayon-petit);
  background: var(--creux); border: 1px solid var(--trait); }
.reponse p { white-space: pre-wrap; }
.reponse small { margin-top: 8px; }
.reponse.attend p { color: var(--discret); animation: respire 1.2s ease-in-out infinite; }
.code { margin: 0; padding: 12px 14px; border-radius: var(--rayon-petit); background: var(--creux);
  border: 1px solid var(--trait); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
#essai-image-resultat { display: block; max-width: 100%; max-height: 70vh; margin: 12px auto 0;
  border-radius: var(--rayon-petit); animation: parait .3s ease-out; }

/* ------------------------------------------------------------------
   Journal
   ------------------------------------------------------------------ */
.fil { list-style: none; margin: 0; padding: 0; }
.fil li { position: relative; padding: 0 0 20px 26px; }
.fil li::before { content: ""; position: absolute; left: 0; top: 6px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--discret); box-shadow: 0 0 0 3px var(--fond); z-index: 1; }
.fil li::after { content: ""; position: absolute; left: 5px; top: 10px; bottom: -6px; width: 1px; background: var(--trait-fort); }
.fil li:last-child::after { display: none; }
.fil li.ok::before { background: var(--ok); }
.fil li.alerte::before { background: var(--alerte); }
.fil time { display: block; font-size: 13px; color: var(--discret); }
.fil b { overflow-wrap: anywhere; }
.fil b .etat { margin-left: 8px; vertical-align: 1px; }
.fil p { margin-top: 4px; font-size: 14px; color: var(--discret); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------
   Fenêtres et annonces
   ------------------------------------------------------------------ */
dialog { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 0; border: 0;
  border-radius: 20px 20px 0 0; background: var(--surface); color: var(--texte);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .25); overflow-y: auto; overscroll-behavior: contain; }
dialog[open] { animation: monte .22s cubic-bezier(.2, .8, .2, 1); }
dialog::backdrop { background: rgba(8, 10, 18, .55); animation: parait .2s; }
.feuille { display: flex; flex-direction: column; gap: 14px; padding: 12px 20px calc(20px + var(--bas)); }
.feuille::before { content: ""; align-self: center; width: 40px; height: 4px; border-radius: 99px; background: var(--trait-fort); }
.feuille > p { color: var(--discret); }
.feuille-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-right: -10px; }
.actions { display: flex; gap: 10px; margin-top: 4px; }
.actions button { flex: 1; }
.cle { display: block; padding: 14px; border-radius: var(--rayon-petit); background: var(--creux);
  border: 1px solid var(--trait-fort); font-size: 15px; user-select: all; word-break: break-all; }

#annonces { position: fixed; z-index: 40; left: 16px; right: 16px;
  bottom: calc(var(--h-onglets) + var(--bas) + 12px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.annonce { max-width: 480px; padding: 11px 16px; border-radius: 12px; font-size: 14.5px; font-weight: 500;
  background: var(--texte); color: var(--fond); box-shadow: var(--ombre); pointer-events: auto;
  animation: monte .2s ease-out; transition: opacity .25s, transform .25s; }
.annonce.erreur { background: var(--alerte-fond); color: var(--alerte); border: 1px solid var(--alerte); }
.annonce.part { opacity: 0; transform: translateY(8px); }

@keyframes bat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes parait { from { opacity: 0; } }
@keyframes monte { from { opacity: 0; transform: translateY(16px); } }
@keyframes respire { 50% { opacity: .45; } }
@keyframes secoue { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------
   Un peu de place : deux colonnes de fiches, tuiles alignées à gauche.
   ------------------------------------------------------------------ */
@media (min-width: 640px) {
  main { padding-left: 24px; padding-right: 24px; }
  .cartes { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
  .tuiles { gap: 12px; }
  .tuile { padding: 14px 16px; text-align: left; }
  .tuile b { font-size: 28px; }
  .tuile span { font-size: 13px; }
  .segments { flex: 0 1 auto; margin: 0; padding: 2px; }
  .rangees li.longue { flex-wrap: nowrap; }
  .rangees li.longue .corps { flex: 1; }
  .rangees li.longue .fin { flex: none; text-align: right; }
  .rangees li.longue .fin small { display: block; margin-left: 0; }
  .fiche-actions button { flex: 0 1 auto; }

  /* Une boîte centrée, plus une feuille. */
  dialog { width: min(480px, calc(100% - 32px)); margin: auto; border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .3); }
  .feuille { padding: 22px; }
  .feuille::before { display: none; }
  .actions { justify-content: flex-end; }
  .actions button { flex: 0 1 auto; }
}

/* ------------------------------------------------------------------
   Le grand écran : les onglets passent à gauche, en colonne.
   ------------------------------------------------------------------ */
@media (min-width: 960px) {
  body { font-size: 15px; }
  #panneau { display: grid; grid-template-columns: 216px minmax(0, 1fr); }
  .entete { grid-column: 1 / -1; padding: 0 12px 0 20px; }
  button { min-height: 38px; font-size: 14px; }
  button.petit { min-height: 32px; }
  button.icone { width: 38px; }
  input:not([type=checkbox]):not([type=file]), select { min-height: 38px; }

  #onglets { position: sticky; top: var(--h-entete); align-self: start;
    display: flex; flex-direction: column; gap: 2px;
    height: calc(100dvh - var(--h-entete)); padding: 16px 12px;
    background: none; border-top: 0; border-right: 1px solid var(--trait); }
  #onglets button { flex-direction: row; justify-content: flex-start; gap: 10px;
    min-height: 40px; padding: 0 10px 0 6px; border-radius: var(--rayon-petit); font-size: 14.5px; }
  #onglets button:hover { background: var(--neutre-fond); }
  #onglets button[aria-current] { background: var(--surface); box-shadow: var(--ombre); }
  #onglets .ico { width: 34px; height: 28px; }
  #onglets button[aria-current] .ico { background: none; }
  #onglets .long { display: inline; }
  #onglets .court { display: none; }
  .pastille { left: 20px; box-shadow: 0 0 0 2px var(--fond); }

  main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 32px 56px; }
  main > section { gap: 16px; }
  .carte, .fiche { padding: 18px; }
  section[data-vue=essais], section[data-vue=maj], section[data-vue=file], section[data-vue=journal] { max-width: 760px; }
  #annonces { bottom: 20px; align-items: flex-end; left: auto; right: 24px; }
}
