/* static/admin.css — Interface ADMINISTRATION, direction « Rail ardoise ».
 *
 * Portable 17 pouces (1536 × 864), densité pensée souris. Le rail sombre reste
 * visible en permanence à gauche, le contenu respire à droite.
 *
 * Couleurs, police et vocabulaire sont ceux de l'appli actuelle : aucune teinte
 * inventée. Les paires en service dans le projet — ambre #fef6e4/#b9770e,
 * vert #e8f8f0/#1e8449, bleu #eaf4fe/#2980b9, rouge #fdecea/#c0392b,
 * neutre #eee/#666 — servent ici au même sens qu'ailleurs.
 *
 * Le magasin a SA feuille (magasin.css) : les deux peuvent diverger sans se
 * gêner, ce sont deux métiers et deux appareils.
 */

:root {
  --fond: #f4f6f9;
  --surface: #ffffff;
  --ardoise: #2c3e50;
  --ardoise-clair: #34495e;
  --ardoise-pale: #95a5a6;
  --texte: #2c3e50;
  --gris-fonce: #666666;
  --gris-moyen: #999999;
  --bordure: #dddddd;
  --fond-clair: #eeeeee;
  --accent: #2980b9;
  --accent-pale: #eaf4fe;
  /* Les teintes de sens, reprises telles quelles de coquille/modules.py :
     aucune n'est inventee, chacune a deja un role dans l'appli. */
  --vert: #1e8449;        --vert-pale: #e8f8f0;      /* ce qui est regle */
  --ambre: #b9770e;       --ambre-pale: #fef6e4;     /* ce qui demande un oeil */
  --rouge: #c0392b;       --rouge-pale: #fdecea;     /* ce qui est refuse */
  /* Les trois teintes de TYPE DE NICOTINE, reprises telles quelles de
     LiquidFinder (static/style.css). Elles ne disent pas un etat mais une
     NATURE : sels de nicotine, hybride, classique. Sans elles, les ronds du
     melangeur perdaient leur couleur en silence — var() inconnue = propriete
     invalide, aucune erreur, juste du blanc sur rien (releve par Romain le
     16/09 : « blanc sur vert c'est illisible »). */
  --bleu: #3498db;        /* NS, sels de nicotine */
  --violet: #9b59b6;      /* NSHY, hybride */
  --vert-nicotine: #27ae60;   /* classique */
  --jaune: #f39c12;           /* repris tel quel de LiquidFinder (static/style.css) */
  --orange: #e67e22;      /* le booster, bouton actif */
  --rail: 252px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; }

.bandeau-vue {
  position: sticky; top: 0; z-index: 10;
  background: #fef6e4; color: #b9770e;
  padding: 11px 24px; font-size: 0.9em;
  border-bottom: 1px solid #f0dfbb;
}
.bandeau-vue a { color: #b9770e; text-decoration: underline; margin-left: 10px; }

/* ─────────────────────── Le rail ─────────────────────── */

.admin { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.menu {
  background: var(--ardoise);
  color: #bdc3c7;
  padding: 22px 12px 18px;
  display: flex; flex-direction: column; gap: 1px;
  font-size: 0.93em;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.menu::-webkit-scrollbar { width: 8px; }
.menu::-webkit-scrollbar-thumb { background: var(--ardoise-clair); border-radius: 4px; }

.menu > b {
  color: #fff; font-size: 1.12em; letter-spacing: -.01em;
  padding: 0 12px 4px;
}
.menu > .marque {
  color: var(--ardoise-pale); font-size: 0.8em;
  padding: 0 12px 18px; border-bottom: 1px solid var(--ardoise-clair); margin-bottom: 14px;
}

.menu .rub {
  padding: 16px 12px 5px;
  font-size: 0.73em; font-weight: 700; letter-spacing: .07em;
  color: var(--ardoise-pale); text-transform: uppercase;
}
.menu .lien {
  padding: 8px 12px; border-radius: 7px; display: flex; gap: 9px; align-items: center;
  border-left: 3px solid transparent;
}
.menu .lien .p { font-size: 0.85em; opacity: .85; flex: none; }
/* Le compteur d'un outil (« 3 à regarder ») : rouge, comme une lettre non lue. */
.menu-compte {
  flex: none; min-width: 1.5em; padding: 0 6px; border-radius: 999px; text-align: center;
  background: var(--rouge); color: var(--surface); font-size: 0.78em; font-weight: 700; line-height: 1.5em;
}
.menu .lien:hover { background: var(--ardoise-clair); color: #fff; }
.menu .lien.actif {
  background: var(--ardoise-clair); color: #fff; font-weight: 600;
  border-left-color: var(--accent);
}
.menu .bas {
  margin-top: auto; padding-top: 20px; color: var(--ardoise-pale);
  border-top: 1px solid var(--ardoise-clair); margin-top: auto;
}

/* ─────────────────────── Le contenu ─────────────────────── */

.panneau { padding: 30px 40px 80px; min-width: 0; max-width: 1100px; }

.vues {
  font-size: 0.85em; color: var(--gris-moyen);
  margin-bottom: 22px; display: flex; gap: 8px; align-items: center;
}
.vues a {
  color: var(--gris-fonce); border: 1px solid var(--bordure); background: var(--surface);
  padding: 4px 11px; border-radius: 99px;
}
.vues a:hover { border-color: var(--accent); color: var(--accent); }
/* La « tuile nuit » : ce que le programme de nuit a laissé à regarder (serveur.py). */
.alerte-nuit {
  display: block; margin: 0 0 10px; padding: 8px 12px; border-left: 4px solid var(--rouge);
  background: var(--rouge-pale); color: var(--rouge); font-weight: 600; text-decoration: none;
}
.alerte-nuit:hover { text-decoration: underline; }

.vocation { display: grid; gap: 24px; position: relative; }
.vocation > header { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.vocation .fil {
  font-size: 0.76em; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--gris-moyen); margin-bottom: 2px;
}
.vocation h1 { font-size: 2em; letter-spacing: -.015em; }
.vocation h2 {
  font-size: 0.78em; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--gris-moyen); margin-bottom: 10px;
}
.vocation .phrase { font-size: 1.15em; line-height: 1.6; max-width: 70ch; }
.vocation section { border-top: 1px solid var(--bordure); padding-top: 20px; }
.idees { padding-left: 20px; display: grid; gap: 8px; max-width: 78ch; }
.note { color: var(--gris-fonce); max-width: 78ch; }

.etiq {
  font-size: 0.78em; font-weight: 600; padding: 5px 12px;
  border-radius: 99px; white-space: nowrap;
}
.e-idee     { background: var(--fond-clair); color: var(--gris-fonce); }
.e-chantier { background: #fef6e4; color: #b9770e; }
.e-pret     { background: #e8f8f0; color: #1e8449; }

/* ─── La carte des données ─── */

.bases { display: grid; gap: 10px; }
.base {
  background: var(--surface); border: 1px solid var(--bordure);
  border-radius: 8px; padding: 13px 16px;
  display: grid; gap: 4px; border-left: 3px solid var(--bordure);
}
.base .tete { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.base code {
  font-family: "Cascadia Mono", Consolas, monospace; font-size: 0.92em;
  font-weight: 600; color: var(--texte);
}
.base .contenu { font-size: 0.94em; }
.base .utilite { font-size: 0.9em; color: var(--gris-fonce); }
.fam { font-size: 0.72em; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 9px; border-radius: 4px; }
.f-anous    { background: var(--accent-pale); color: var(--accent); }
.f-copie    { background: var(--fond-clair); color: var(--gris-fonce); }
.f-calculee { background: #e8f8f0; color: #1e8449; }
.base.f-b-anous    { border-left-color: var(--accent); }
.base.f-b-calculee { border-left-color: #1e8449; }

/* ─── Les deux icônes de la maquette ─── */

.duo { display: flex; gap: 6px; margin-left: auto; }
.duo-b {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--bordure); background: var(--surface);
  color: var(--gris-fonce); font: inherit; font-size: 0.95em; cursor: pointer;
}
.duo-b:hover { border-color: var(--accent); color: var(--accent); }
.duo-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bulle {
  position: absolute; top: 58px; right: 0; width: min(470px, 94%);
  background: var(--ardoise); color: #eee;
  border-radius: 12px; padding: 18px 22px; display: grid; gap: 9px;
  box-shadow: 0 10px 30px rgba(44, 62, 80, .3); z-index: 5;
}
.bulle h4 { color: #fff; font-size: 1.02em; }
.bulle p { font-size: 0.94em; }
.bulle::before {
  content: ""; position: absolute; top: -9px; right: 24px;
  border: 9px solid transparent; border-top: 0; border-bottom-color: var(--ardoise);
}
/* `hidden` doit gagner : une règle `display` sur .bulle écrase l'attribut HTML
   et les deux bulles s'affichent l'une sur l'autre (constaté le 16/09). */
.bulle[hidden] { display: none; }


/* ─── Réglages : Romain seul ─── */

.reglages {
  background: var(--surface); border: 1px solid var(--bordure);
  border-radius: 8px; padding: 18px 20px; display: grid; gap: 14px;
}
.reglages h2 { border: 0; margin: 0; display: flex; gap: 10px; align-items: baseline; }
.reglages h2 small { font-weight: 400; font-size: 1.05em; letter-spacing: 0; text-transform: none; color: var(--gris-moyen); }
.reglages .ligne { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.reglages .ligne > span { min-width: 7.5em; color: var(--gris-fonce); font-size: 0.92em; }
.opts { display: flex; gap: 6px; flex-wrap: wrap; }
.opt {
  font: inherit; font-size: 0.9em; padding: 7px 14px; border-radius: 7px;
  border: 1px solid var(--bordure); background: var(--surface);
  color: var(--texte); cursor: pointer;
}
.opt:hover { border-color: var(--accent); }
.opt.on { border-color: var(--accent); background: var(--accent-pale); color: var(--accent); font-weight: 600; }
.opt:disabled { opacity: .5; cursor: default; }
.alerte { background: #fef6e4; color: #b9770e; border-radius: 7px; padding: 11px 13px; font-size: 0.9em; }

@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .menu { position: static; height: auto; }
  .panneau { padding: 22px 20px 60px; }
}

/* Le rail est groupé par module. Le module porte l'identité (sa teinte) ; la
   densité, elle, vient de cette feuille — c'est la règle qui évite d'avoir dix
   feuilles de style pour cinq modules et deux interfaces. */
.menu .mod {
  padding: 20px 12px 6px; margin-top: 6px;
  font-size: 0.86em; font-weight: 700; color: #fff;
  border-top: 1px solid var(--ardoise-clair);
  display: flex; align-items: center; gap: 9px;
}
.menu .mod::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--module, var(--accent)); flex: none;
}
.menu .mod:first-child { border-top: 0; margin-top: 0; padding-top: 4px; }
.menu .rub { padding-left: 24px; }
.menu .lien { padding-left: 24px; }
.menu .lien.actif { border-left-color: var(--accent); }

/* La page d'un outil prend la teinte de son module, sans rien changer d'autre. */
.vocation .fil { color: var(--module, var(--gris-moyen)); }
.vocation section { border-top-color: var(--bordure); }

/* Le rouage du menu : a droite de la ligne, et seulement pour les outils qui
   ont des reglages. Discret au repos — ce n'est pas un raccourci quotidien. */
.lien-ligne { display: flex; align-items: center; }
/* L'icône d'un outil dans le menu (coquille/icones.py), la même que sur sa tuile. */
.menu-icone { display: inline-flex; flex: none; }
.menu-icone .icone-svg { width: 1.05em; height: 1.05em; color: currentColor; }
.lien-ligne .lien { flex: 1 1 auto; }
.rouage {
  flex: 0 0 auto; padding: 0 10px; line-height: 1.9;
  color: var(--gris-moyen); text-decoration: none; opacity: 0.45;
}
.lien-ligne:hover .rouage { opacity: 1; }
.rouage:hover { color: var(--accent); }

/* La page des reglages. La phrase de portee vient EN PREMIER : on doit savoir
   ce qu'on engage avant de lire les valeurs. */
.parametres .reglage-portee {
  background: #fef6e4; color: #b9770e; border-radius: 12px;
  padding: 16px 18px; margin: 14px 0 22px; line-height: 1.55;
}
.parametres .reglage-groupe { margin-bottom: 20px; }
.parametres .reglage-groupe h4 { font-size: 1.02em; margin-bottom: 6px; color: var(--accent); }
.parametres .reglage {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 16px;
  padding: 9px 0; border-top: 1px solid var(--fond-clair);
}
.parametres .reglage-valeur { font-weight: 600; font-size: 1.1em; text-align: right; white-space: nowrap; }
.parametres .reglage-valeur small { color: var(--gris-moyen); font-weight: 400; margin-left: 4px; }
.parametres .reglage-aide { grid-column: 1 / -1; color: var(--gris-moyen); font-size: 0.9em; line-height: 1.4; }
.parametres .reglage-lecture, .parametres .reglage-source {
  color: var(--gris-fonce); font-size: 0.92em; line-height: 1.5; margin-top: 14px;
}
.parametres .reglage-source code { background: var(--fond); padding: 2px 6px; border-radius: 6px; }
.retour-outil { margin-top: 24px; }

/* Un outil qui s'ouvre ailleurs le dit : la petite fleche evite de chercher
   pourquoi le panneau de droite n'a pas change. */
.hors { opacity: 0.55; font-size: 0.9em; margin-left: 4px; }

/* Deux colonnes : ce qui est EN SERVICE, et ce qui est CONSEILLE. L'ecart se
   voit sans le chercher — c'est tout l'interet de la seconde colonne. */
.parametres .reglage-entetes {
  display: grid; grid-template-columns: 1fr 11em 7em; gap: 16px;
  font-size: 0.82em; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--gris-moyen); padding-bottom: 6px;
}
.parametres .reglage-entetes span:not(:first-child) { text-align: right; }
.parametres .reglage {
  display: grid; grid-template-columns: 1fr 11em 7em; gap: 4px 16px;
  padding: 9px 0; border-top: 1px solid var(--fond-clair); align-items: center;
}
.parametres .reglage-valeur { text-align: right; white-space: nowrap; }
.parametres .reglage-conseille {
  text-align: right; white-space: nowrap; color: var(--gris-moyen);
}
.parametres .reglage-aide { grid-column: 1 / -1; }

/* Une ligne modifiee se signale : sinon on oublie qu'on a touche a quelque
   chose, et on cherche ailleurs pourquoi un chiffre a bouge. */
.parametres .reglage-change { background: #fef6e4; border-radius: 8px; }
.parametres .reglage-change .reglage-nom::before { content: "• "; color: #b9770e; }

.reglage-champ {
  width: 6.5em; text-align: right; padding: 8px 10px; font-size: 1em;
  border: 1px solid var(--bordure); border-radius: 8px;
  background: var(--surface); color: var(--texte);
}
.reglage-champ:focus { outline: none; border-color: var(--accent); }
.reglage-revenir {
  border: none; background: transparent; cursor: pointer; font-size: 1.1em;
  color: #b9770e; padding: 4px 6px; margin-left: 4px;
}
.parametres .reglage-divergence {
  background: #eaf4fe; color: #2980b9; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 18px; line-height: 1.55;
}

/* ============ LE BANC D'ESSAI ============
   Pastilles de simulation, le temps du developpement. Il doit se voir que
   c'est un echafaudage : d'ou la bande hachuree et le mot « banc d'essai ».
   Le jour ou « Qui est la ? » repond, tout ceci disparait. */
.bandeau-essai {
  display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap;
  padding: 10px 18px; background: #fef6e4; color: #b9770e;
  border-bottom: 1px solid #f0dcb0; font-size: 0.92em;
}
.bandeau-titre {
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 0.85em; opacity: 0.75;
}
.bandeau-groupe { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bandeau-groupe b { color: #8a5a08; }
.bandeau-groupe .manque { color: #c0392b; font-style: italic; }
.pastille {
  display: inline-block; padding: 5px 13px; border-radius: 999px;
  border: 1px solid #e0c48a; background: #fffaf0; color: #b9770e;
  text-decoration: none; line-height: 1.5; white-space: nowrap;
}
.pastille:hover { border-color: #b9770e; }
.pastille.on { background: #b9770e; border-color: #b9770e; color: #fff; font-weight: 600; }

/* ─────────── Le témoin d'activité (pages/coquille.html) ─────────── */
/* En haut, au centre, par-dessus tout : on doit le voir sans le chercher,
   même en ayant fait défiler la page. Assez bas pour ne pas cacher les
   pastilles du banc d'essai, qui restent cliquables pendant l'attente. */
.temoin {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 10px; max-width: min(640px, 92vw);
  padding: 10px 18px; border-radius: 999px;
  background: var(--ardoise); color: #fff; font-size: 0.95em;
  box-shadow: 0 6px 20px rgba(44, 62, 80, .35);
}
.temoin[hidden] { display: none; }
.temoin-texte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.temoin-duree { font-variant-numeric: tabular-nums; opacity: .8; white-space: nowrap; }
.temoin-point {
  flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  animation: temoin-pouls 1s ease-in-out infinite;
}
@keyframes temoin-pouls { 50% { transform: scale(1.6); opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .temoin-point { animation: none; } }

/* Le MESSAGE FLOTTANT d'un geste (Outil.agir) : en bas à droite, visible même
   quand la ligne d'état est hors de vue. Même teinte que la ligne d'état. */
.outil-bulles {
  position: fixed; z-index: 60; right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: grid; gap: 8px; width: min(420px, calc(100vw - 32px));
}
.outil-bulle {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--bordure); border-left: 5px solid var(--gris-fonce);
  background: var(--surface); color: var(--texte); font-weight: 600; font-size: 0.93em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
  animation: outil-bulle-entree .2s ease-out;
}
/* vert = écriture réussie, ambre = suppression réussie, rouge = échec (même partiel) */
.outil-bulle[data-sorte="cours"] { border-left-color: var(--accent); }
.outil-bulle[data-sorte="ecrit"] { border-left-color: var(--vert); background: var(--vert-pale); }
.outil-bulle[data-sorte="supprime"] { border-left-color: var(--ambre); background: var(--ambre-pale); }
.outil-bulle[data-sorte="erreur"] { border-left-color: var(--rouge); background: var(--rouge-pale); }
.outil-bulle-texte { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.outil-bulle-fermer {
  font: inherit; font-size: 1.1em; line-height: 1; padding: 0 2px;
  border: 0; background: none; color: var(--gris-fonce); cursor: pointer;
}
@keyframes outil-bulle-entree { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .outil-bulle { animation: none; } }

/* Un lien qui ECRIT chez Arthur se voit au premier coup d'oeil. */
.f-ecriture { background: var(--rouge-pale); color: var(--rouge); }
.lien-ecrit { border-left: 4px solid var(--rouge); }

/* La coche de suivi du menu (temporaire, voir coquille/outils.py::COCHES).
   Sur le fond ardoise du menu, les teintes VIVES : le vert sombre et l'ambre
   ne s'y liraient pas. */
.coche { margin-left: 6px; font-weight: 700; flex: none; }
.coche-verte { color: var(--vert-nicotine); }
.coche-jaune { color: var(--jaune); }
.coche-orange { color: var(--orange); }

/* ─────────────── Le modèle commun des outils (static/outil.js) ───────────────
   Romain, 16/09 : « tous aux mêmes formats et aux mêmes endroits ». Une seule
   définition pour tous les écrans d'outil : barre, état, tableau triable,
   cases, gestes, blocs, journal. Un outil n'a plus de feuille à lui. */
.outil-barre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.outil-barre .pousse { margin-left: auto; }
.outil-etat { font-weight: 600; min-height: 1.5em; }
/* Les messages d'action (Outil.agir) : la même teinte pour le même sens. */
.outil-etat[data-sorte="cours"],
.outil-etat[data-sorte="consigne"] { color: var(--gris-fonce); }
.outil-etat[data-sorte="ecrit"] { color: var(--vert); }
.outil-etat[data-sorte="supprime"] { color: var(--ambre); }
.outil-etat[data-sorte="erreur"] { color: var(--rouge); }
.outil-champ {
  font: inherit; padding: 7px 10px; min-width: 16rem;
  border: 1px solid var(--bordure); border-radius: 8px;
  background: var(--surface); color: var(--texte);
}
.outil-champ:focus { outline: none; border-color: var(--accent); }
.outil-note { font-size: 0.88em; color: var(--gris-fonce); }

.outil-table-conteneur { overflow-x: auto; }
.outil-table { width: 100%; border-collapse: collapse; font-size: 0.93em; }
.outil-table th {
  text-align: left; font-weight: 600; color: var(--gris-fonce);
  padding: 6px 10px; border-bottom: 2px solid var(--bordure); white-space: nowrap;
}
.outil-table td { padding: 5px 10px; border-bottom: 1px solid var(--fond-clair); vertical-align: middle; }
.outil-table tbody tr:hover td { background: var(--accent-pale); }
.outil-table del { color: var(--gris-moyen); }
/* Le classement : tout l'en-tête se clique, le chevron dit le sens. */
.tri-b {
  font: inherit; font-weight: 600; color: inherit; background: none; border: 0;
  padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.chevron { font-size: 0.8em; opacity: .35; }
.trie .chevron { opacity: 1; color: var(--accent); }
.trie { color: var(--texte); }
.col-choix { width: 28px; }
.outil-choix { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.outil-num { font-family: "Cascadia Mono", Consolas, monospace; font-size: 0.9em; color: var(--gris-fonce); white-space: nowrap; }
.outil-echec td { background: var(--rouge-pale); }
.outil-texte-echec { color: var(--rouge); }
/* Une liste de CARTES (une par élément, ex. une paire de doublons), espacées. */
.outil-cartes { display: grid; gap: 12px; align-content: start; }
.outil-perime { color: var(--ambre); }
.outil-vide { color: var(--gris-moyen); font-style: italic; }
.outil-actions { text-align: right; white-space: nowrap; }
.outil-actions .opt { padding: 4px 10px; }

.outil-gestes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-principal { background: var(--accent); color: var(--surface); border-color: var(--accent); font-weight: 600; }
/* Le bouton ARMÉ : le prochain clic agit. */
.btn-arme { background: var(--ambre); color: var(--surface); border-color: var(--ambre); }

.outil-bloc { border-top: 1px solid var(--bordure); padding-top: 16px; display: grid; gap: 10px; }
.outil-bloc[hidden] { display: none; }
.outil-bloc > h2 { font-size: 0.95em; color: var(--gris-fonce); }
.outil-question { padding: 10px 0; border-top: 1px solid var(--fond-clair); display: grid; gap: 6px; }
.outil-question .outil-barre { gap: 8px; }
.outil-pastille[hidden] { display: none; }
.outil-pastille { display: inline-block; padding: 1px 8px; margin: 1px 2px 1px 0; border-radius: 999px; background: var(--fond); font-size: 0.9em; }
/* Une liste avec son PANNEAU D'ACTIONS à droite, qui reste visible pendant qu'on
   fait défiler (Romain, 17/09). Sur un écran étroit, le panneau passe au-dessus. */
.outil-avec-cote { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.outil-cote {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); display: grid; gap: 12px;
  max-height: calc(100vh - 24px); overflow-y: auto; overflow-x: hidden;   /* jamais plus haut que l'écran */
}
.outil-cote .outil-champ { min-width: 0; width: 100%; box-sizing: border-box; }
.outil-carte {
  display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--bordure);
  border-radius: 10px; background: var(--surface);
}
.vocation .outil-carte { border-top: 1px solid var(--bordure); padding-top: 12px; }
.outil-carte[hidden] { display: none; }
.outil-carte > h2 { font-size: 0.9em; color: var(--gris-fonce); }
.outil-carte .opts > .opt { flex: 1 1 auto; }
@media (max-width: 900px) {
  .outil-avec-cote { grid-template-columns: minmax(0, 1fr); }
  .outil-cote { position: static; order: -1; }
}
/* Une pastille qu'on peut retirer (une écriture reconnue par le dictionnaire). */
.pastille-retirer {
  font: inherit; font-size: 0.9em; line-height: 1; margin-left: 4px; padding: 0 2px;
  border: 0; background: none; color: var(--gris-fonce); cursor: pointer;
}
.pastille-retirer:hover { color: var(--rouge); }
.pastille-retirer.btn-arme { color: var(--surface); border-radius: 999px; padding: 0 4px; }
.outil-appris .outil-champ { background: var(--vert-pale); }

/* Les puces à lettre : classement rapide des longues listes (Romain, 16/09). */
.outil-lettres { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 8px; }
.lettre {
  font: inherit; font-size: 0.82em; font-weight: 600; min-width: 28px; padding: 3px 6px;
  border: 1px solid var(--bordure); border-radius: 6px; background: var(--surface);
  color: var(--texte); cursor: pointer;
}
.lettre.on { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.lettre[disabled] { opacity: .3; cursor: default; }
/* La navigation d'une longue liste, page par page, sous le tableau (mêmes puces). */
.outil-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-top: 8px; }
.outil-pages .outil-note { margin-left: 8px; }
/* Une espace en bord de texte, rendue visible. */
.outil-espace { color: var(--ambre); background: var(--ambre-pale); border-radius: 3px; padding: 0 1px; }

/* La coche « fini » du menu : l'avis de Romain sur une rubrique (17/09).
   Discrète tant qu'elle est vide, et la ligne cochée s'apaise. */
.menu-fini {
  flex: 0 0 auto; margin: 0 2px 0 6px; width: 15px; height: 15px;
  accent-color: var(--vert); cursor: pointer; opacity: 0.45;
}
.menu-fini:hover, .menu-fini:checked { opacity: 1; }
.lien-ligne.fini .lien, .lien-ligne:has(.menu-fini:checked) .lien { color: var(--vert); }

/* Le crayon de revue, à côté de la case « fini ». */
.menu-crayon {
  flex: 0 0 auto; border: 0; background: none; padding: 0 2px; cursor: pointer;
  font-size: 0.85em; line-height: 1; opacity: 0.35; filter: grayscale(1);
}
.menu-crayon:hover { opacity: 1; filter: none; }
.menu-crayon.pleine { opacity: 1; filter: none; }
.note-fenetre {
  border: 1px solid var(--bordure); border-radius: 12px; padding: 18px 20px;
  width: min(560px, 92vw); background: var(--surface); color: var(--texte);
}
.note-fenetre::backdrop { background: rgba(0, 0, 0, 0.35); }
.note-fenetre h2 { font-size: 1.15em; margin-bottom: 4px; }
.note-aide { color: var(--gris-fonce); font-size: 0.9em; margin-bottom: 10px; }
.note-fenetre textarea {
  width: 100%; font: inherit; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--bordure); border-radius: 8px;
}
.note-etat { min-height: 1.2em; margin: 8px 0; color: var(--gris-fonce); font-size: 0.9em; }
.note-actions { display: flex; gap: 8px; flex-wrap: wrap; }
