/* LES ÉCRANS DE kv2 — l'ergonomie d'un assistant moderne (mission #7.1, maquette validée par Guillaume le 27/09),
   aux couleurs de Kaordia. ⛔ Aucune marque, aucun logo, aucun élément graphique d'un tiers. Jetons : charte.css. */
* { box-sizing: border-box; }
/* ⛔ Sans cette ligne, « display: flex » l'emporte sur l'attribut hidden : une vue cachée prend
   quand même la moitié de l'écran (vu au banc d'écran du 27/09). */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-body); font-size: var(--text-base); color: var(--text-primary);
       background: var(--bg-primary); line-height: var(--leading-normal); }
button, input, textarea, kv-selecteur { font: inherit; color: inherit; }

.bouton { border: 1px solid var(--border-default); background: var(--bg-secondary); border-radius: var(--radius-md);
          padding: var(--space-2) var(--space-4); cursor: pointer; font-weight: var(--font-medium);
          transition: background var(--duration-fast); }
.bouton:hover:not(:disabled) { background: var(--bg-hover); }
.bouton:disabled { opacity: .45; cursor: not-allowed; }
.bouton-principal { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.bouton-principal:hover:not(:disabled) { background: var(--accent-hover); }
/* (#59.1) le geste qu'on ne défait pas : en rouge (la barre de sélection de l'Historique ; la modale a le sien) */
.bouton-danger { background: var(--color-error); border-color: var(--color-error); color: #fff; }
.bouton-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--color-error) 85%, #000); }
.refus { color: var(--color-error); background: color-mix(in srgb, var(--color-error) 8%, transparent);
         border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); margin: 0; font-size: var(--text-sm); }
.bouton-icone { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; background: none;
                border-radius: var(--radius-md); cursor: pointer; color: var(--text-secondary); }
.bouton-icone:hover { background: var(--bg-hover); }
svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6;
      stroke-linecap: round; stroke-linejoin: round; }

/* ── Connexion ─────────────────────────────────────────────────────────── */
.page-connexion { display: grid; place-items: center; }
.carte-connexion { width: min(380px, 92vw); background: var(--bg-secondary); border: 1px solid var(--border-light);
                   border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: var(--space-8); }
.connexion-marque { display: block; width: 220px; margin: 0 auto; }
.connexion-sous-titre { text-align: center; color: var(--text-muted); font-size: var(--text-sm); margin: 0 0 var(--space-6); }
.carte-connexion form { display: grid; gap: var(--space-4); }
.carte-connexion label { display: grid; gap: var(--space-1); font-size: var(--text-sm); color: var(--text-secondary); }
.carte-connexion input { border: 1px solid var(--border-default); border-radius: var(--radius-md);
                         padding: var(--space-2) var(--space-3); background: var(--bg-secondary); }
.carte-connexion input:focus { outline: 2px solid var(--accent-border); outline-offset: 0; }

/* ── La coquille : le volet sobre + le principal ───────────────────────── */
.coquille { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.volet { width: 204px; min-width: 204px; display: flex; flex-direction: column; gap: var(--space-2);
         background: var(--bg-volet); border-right: 1px solid var(--border-light); padding: var(--space-3) var(--space-2); }
.volet-marque { display: flex; align-items: center; gap: var(--space-1); padding: 0 0 var(--space-2); }
.volet-marque img { width: 24px; height: 24px; }
.marque-sombre, html[data-mode="sombre"] .marque-clair { display: none; }
html[data-mode="sombre"] .marque-sombre { display: block; }
.volet-marque span { font-weight: var(--font-semibold); color: var(--titre); letter-spacing: -.01em; }
/* ⭐ (mission #59.1) Le volet ne liste plus les conversations (page Historique) : le pied se pose en bas seul. */
.volet-pied { margin-top: auto; border-top: 1px solid var(--border-light); padding-top: var(--space-2); display: grid; gap: 2px; }
.volet-item { display: flex; align-items: center; gap: var(--space-2); text-align: left; border: 0; background: none;
              border-radius: var(--radius-md); padding: 6px var(--space-2); cursor: pointer; font-size: var(--text-sm);
              color: var(--text-secondary); }
.volet-item:hover { background: var(--bg-hover-volet); }
.volet-item.actif { background: var(--accent-soft); color: var(--text-primary); font-weight: var(--font-medium); }
.personne-zone { position: relative; }
.personne { display: flex; align-items: center; gap: var(--space-2); width: 100%; border: 0; background: none; cursor: pointer;
            padding: 6px var(--space-2); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--text-primary); }
.personne:hover { background: var(--bg-hover-volet); }
.initiales { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: var(--radius-full);
             background: var(--fond-marque); color: #fff; font-size: 11px; font-weight: var(--font-semibold); letter-spacing: .03em; }
.prenom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--font-medium); }
.personne-menu { position: absolute; bottom: calc(100% + 4px); left: 0; right: 0; background: var(--bg-secondary);
                 border: 1px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
                 padding: var(--space-1); display: grid; z-index: 20; }
/* ⭐ (mission #30.1) Le menu du nom, porte des réglages : l'en-tête, les sections à icône fine, un séparateur. */
.personne-menu { min-width: 220px; }
.personne-entete { display: grid; padding: var(--space-2) var(--space-2) var(--space-1); }
.personne-entete kv-selecteur { justify-self: start; max-width: 100%; margin-left: -4px; }   /* (#79.4) l'organisation active */
.personne-organisation { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-primary);
                         overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.personne-compte { font-size: var(--text-xs); color: var(--text-muted); }
.menu-item { display: flex; align-items: center; gap: var(--space-2); text-align: left; border: 0; background: none;
             cursor: pointer; padding: 6px var(--space-2); border-radius: var(--radius-md); font-size: var(--text-sm);
             color: var(--text-primary); }
.menu-item svg { color: var(--text-secondary); }
.menu-item:hover { background: var(--bg-hover); }
a.menu-item { text-decoration: none; }
.menu-separateur { border: 0; border-top: 1px solid var(--border-light); margin: var(--space-1) 0; }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.barre-mobile, .voile { display: none; }
.vue { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ── La conversation : centrée, étroite, aérée ─────────────────────────── */
.fil-defilement { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.fil { width: 100%; max-width: var(--largeur-fil); margin: 0 auto; padding: var(--space-8) var(--space-5) var(--space-6);
       display: flex; flex-direction: column; gap: var(--space-6); }
.accueil { text-align: center; margin-top: 18vh; }
.accueil h1 { font-size: var(--text-2xl); font-weight: var(--font-semibold); color: var(--titre); margin: 0 0 var(--space-2); letter-spacing: -.01em; }
.accueil p { color: var(--text-muted); margin: 0; }

.message-personne { align-self: flex-end; max-width: 85%; background: var(--bulle-personne); border-radius: var(--radius-xl);
                    padding: var(--space-2) var(--space-4); white-space: pre-wrap; overflow-wrap: anywhere; line-height: var(--leading-relaxed); }
.reponse { line-height: var(--leading-relaxed); overflow-wrap: anywhere; outline: none; }
.reponse-agent { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-muted);
                 font-weight: var(--font-medium); margin-bottom: var(--space-1); }
.reponse-agent::before { content: ""; width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--accent); }
.reponse-texte p { margin: 0 0 var(--space-3); }
.reponse-texte ul { margin: 0 0 var(--space-3); padding-left: var(--space-5); }
.reponse-texte > :last-child { margin-bottom: 0; }
.reponse-texte code { font-family: var(--font-mono); font-size: .88em; background: var(--bg-surface); padding: .1em .3em; border-radius: var(--radius-sm); }
.reponse-texte pre { background: var(--bg-surface); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); overflow-x: auto; margin: 0 0 var(--space-3); }
.reponse-texte pre code { background: none; padding: 0; }
/* ⭐ Les détails techniques n'apparaissent qu'au SURVOL (ou au focus : clavier, toucher).
   ⛔ Les montrer en permanence fait rougir le banc d'écran — c'est son sabotage (./banc-ecran.sh). */
.reponse-details { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--text-muted);
                   font-variant-numeric: tabular-nums; opacity: 0; visibility: hidden;
                   transition: opacity var(--duration-fast), visibility var(--duration-fast); }
.reponse:hover .reponse-details, .reponse:focus .reponse-details { opacity: 1; visibility: visible; }
.attente { display: inline-flex; gap: 5px; align-items: center; color: var(--text-muted); font-size: var(--text-sm); }
.attente i { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--accent); animation: pouls 1.2s infinite ease-in-out; }
.attente i:nth-child(2) { animation-delay: .15s; }
.attente i:nth-child(3) { animation-delay: .3s; }
.attente-texte { margin-left: 4px; }
@keyframes pouls { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* ── La zone de saisie ÉPURÉE — la maquette validée par Guillaume (27/09, 13 h 28) fait foi ─────────
   zone : coins 18 px, padding 10 px (16 à gauche), bordure 1 px NEUTRE — ⛔ aucun vert sur la bordure, jamais,
   même au focus (le banc d'écran le mesure, dans les deux thèmes ; son sabotage la remet verte) ;
   champ : une ligne, 15 px, grandit jusqu'à 120 px puis défile ; envoi 32×32, rayon 10, neutre au repos,
   à la couleur de la charte seulement quand il y a du texte ; dessous, à 8 px, en 13 px gris : joindre et
   dicter à gauche, l'agent en texte simple à droite. Plus de ligne d'aide : l'infobulle suffit. */
.saisie-zone { flex: none; width: 100%; max-width: var(--largeur-fil); margin: 0 auto; padding: 0 var(--space-5) var(--space-4); }
.saisie { display: flex; align-items: flex-end; gap: 8px; background: var(--saisie-fond); border: 1px solid var(--saisie-bordure);
          border-radius: 18px; padding: 10px 10px 10px 16px; transition: border-color var(--duration-fast); }
.saisie:focus-within { border-color: var(--saisie-bordure-focus); }
.saisie textarea { flex: 1; min-width: 0; display: block; resize: none; border: 0; outline: none; background: none; padding: 5px 0;
                   font-size: 15px; line-height: 22px; min-height: 32px; max-height: 120px; overflow-y: auto; color: var(--text-primary); }
.saisie textarea::placeholder { color: var(--text-muted); }
.envoi { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 0; border-radius: 10px;
         background: var(--envoi-repos); color: var(--envoi-icone); cursor: default;
         transition: background var(--duration-fast), color var(--duration-fast); }
.envoi svg { width: 16px; height: 16px; stroke-width: 2.2; }
.envoi.pret { background: var(--accent); color: var(--accent-text); cursor: pointer; }
.envoi.pret:hover { background: var(--accent-hover); }
.saisie-sous { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
               margin-top: 8px; padding: 0 4px 0 6px; font-size: 13px; color: var(--text-muted); }
.saisie-outils { display: flex; gap: 2px; }
.outil { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; border-radius: var(--radius-md);
         color: var(--text-muted); cursor: default; }
.outil svg { width: 17px; height: 17px; }
.outil:hover { background: var(--bg-hover-volet); }
.saisie-choix { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
/* ⭐ (mission #42.1) Le sélecteur commun, en variante « discret » : du texte simple, la liste au-dessus. */
.choix-agent { display: inline-flex; align-items: center; min-width: 0; color: var(--text-muted); }
.choix-agent kv-selecteur { font-size: 13px; max-width: 220px; }
.choix-modele kv-selecteur { max-width: 190px; }

/* ── Les paramètres : une tuile par brique (l'esprit des tuiles d'agents de Kaordia) ── */
.vue-parametres, .vue-taches { overflow-y: auto; overflow-x: hidden; }
.parametres { width: 100%; max-width: 1040px; margin: 0 auto; padding: var(--space-8) var(--space-6); }
.parametres h1 { font-size: var(--text-2xl); font-weight: var(--font-semibold); color: var(--titre); margin: 0 0 var(--space-1); letter-spacing: -.01em; }
.parametres h2 { font-size: var(--text-xs); font-weight: var(--font-semibold); color: var(--text-muted);
                 text-transform: uppercase; letter-spacing: .05em; margin: var(--space-8) 0 var(--space-3); }
.parametres .sous { color: var(--text-muted); margin: 0; font-size: var(--text-sm); overflow-wrap: anywhere; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-3); }
.tuile { display: flex; flex-direction: column; gap: var(--space-3); text-align: left; background: var(--bg-secondary);
         border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: var(--space-4); cursor: pointer;
         box-shadow: var(--shadow-sm); transition: border-color var(--duration-fast), box-shadow var(--duration-fast); min-width: 0; }
.tuile:hover, .tuile:focus-visible { border-color: var(--accent-border); box-shadow: var(--shadow-md); outline: none; }
.tuile-tete { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.tuile-icone { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--radius-lg);
               background: var(--accent-soft); color: var(--accent-active); font-weight: var(--font-semibold); }
.tuile-orchestrateur .tuile-icone { background: var(--fond-marque); color: #fff; }
.tuile-nom { flex: 1; min-width: 0; }
.tuile-nom b { display: block; font-size: var(--text-sm); font-weight: var(--font-semibold); }
.tuile-nom small { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
                   white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statut-actif { font-size: var(--text-xs); font-weight: var(--font-medium); color: var(--color-success); white-space: nowrap; }
.tuile-desc { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; display: -webkit-box; -webkit-line-clamp: 2;
              line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tuile-badges { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.badge { font-size: 11px; padding: 1px var(--space-2); border-radius: var(--radius-full); background: var(--bg-surface);
         color: var(--text-secondary); white-space: nowrap; }
.badge-role { background: var(--accent-soft); color: var(--accent-active); font-weight: var(--font-medium); }
.badge-modele { font-family: var(--font-mono); border-radius: var(--radius-sm); }
.tuile-chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2);
                  border-top: 1px solid var(--border-light); padding-top: var(--space-3); }
.chiffre b { display: block; font-size: var(--text-base); font-weight: var(--font-semibold); font-variant-numeric: tabular-nums; }
.chiffre span { font-size: 11px; color: var(--text-muted); }
.refus-montage { display: grid; gap: var(--space-2); }

/* ── Les sections des Paramètres (mission #7.2) : une section à la fois. ⭐ (mission #30.1) Plus de second volet :
      des onglets en haut de page, le contenu en pleine largeur. ── */
.parametres-coquille { display: flex; flex-direction: column; gap: var(--space-6); width: 100%; max-width: 1180px;
                       margin: 0 auto; padding: var(--space-6) var(--space-6) var(--space-8); }
.parametres-coquille .parametres { flex: 1; min-width: 0; max-width: none; margin: 0; padding: 0; }
.parametres-nav { display: flex; flex-wrap: wrap; gap: var(--space-1); border-bottom: 1px solid var(--border-light); }
.parametres-nav a { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3);
                    margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: var(--text-sm);
                    color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.parametres-nav a:hover { color: var(--text-primary); }
.parametres-nav a.actif { border-bottom-color: var(--accent); color: var(--text-primary); font-weight: var(--font-medium); }
.bientot { font-size: 10px; color: var(--text-muted); border: 1px solid var(--border-light); border-radius: var(--radius-full);
           padding: 0 6px; font-weight: var(--font-normal); }
.section-parametres h1 { margin-top: 0; }
.section-parametres > .sous { margin-bottom: var(--space-5); }
.retour { display: inline-block; font-size: var(--text-sm); color: var(--text-secondary); text-decoration: none;
          margin-bottom: var(--space-4); }
.retour:hover { color: var(--accent-active); }
.agent-tete { display: flex; align-items: center; gap: var(--space-3); }
.agent-tete h1 { margin: 0; font-size: var(--text-xl); }
.agent-tete .tuile-nom small { white-space: normal; }
.agent-desc { color: var(--text-secondary); font-size: var(--text-sm); margin: var(--space-3) 0 var(--space-5); }
.section-parametres .onglets { padding: 0; }
.section-parametres .onglet-contenu { padding: var(--space-5) 0; }
.a-venir { display: flex; gap: var(--space-3); align-items: flex-start; background: var(--bg-secondary);
           border: 1px dashed var(--border-default); border-radius: var(--radius-lg); padding: var(--space-5); }
.a-venir p { margin: 0; color: var(--text-secondary); font-size: var(--text-sm); }

/* Utilisateurs */
.invitation { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; background: var(--bg-secondary);
              border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: var(--space-4);
              margin: var(--space-5) 0 var(--space-3); box-shadow: var(--shadow-sm); }
.invitation label { display: grid; gap: var(--space-1); font-size: var(--text-xs); color: var(--text-muted); }
.invitation label:first-child { flex: 1 1 240px; }
.invitation input { border: 1px solid var(--border-default); border-radius: var(--radius-md);
                    padding: 7px var(--space-3); background: var(--bg-secondary); font-size: var(--text-sm); min-width: 0; }
.invitation input:focus { outline: 2px solid var(--accent-border); }
.invitation kv-selecteur { min-width: 170px; font-size: var(--text-sm); color: var(--text-primary); }
.invitation kv-selecteur::part(bouton) { padding: 7px var(--space-3); background: var(--bg-secondary); }
.lien-transmis { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--radius-lg);
                 padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); font-size: var(--text-sm); }
.lien-transmis p { margin: 0 0 var(--space-2); }
.lien-ligne { display: flex; gap: var(--space-2); }
.lien-ligne input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: var(--text-xs); border: 1px solid var(--border-default);
                    border-radius: var(--radius-md); padding: 6px var(--space-2); background: var(--bg-secondary); }
.comptes { list-style: none; margin: var(--space-4) 0 0; padding: 0; border: 1px solid var(--border-light);
           border-radius: var(--radius-lg); background: var(--bg-secondary); overflow: hidden; }
.compte { display: grid; grid-template-columns: 28px minmax(0, 2fr) auto minmax(0, 2fr) auto; gap: var(--space-3);
          align-items: center; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border-light); }
.compte:first-child { border-top: 0; }
.compte-nom, .compte-etat { min-width: 0; display: grid; }
.compte-nom b { font-size: var(--text-sm); font-weight: var(--font-semibold); }
.compte-nom small, .compte-etat small { font-size: var(--text-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statut-compte { font-size: var(--text-xs); font-weight: var(--font-medium); }
.statut-ouvert { color: var(--color-success); }
.statut-invite { color: var(--color-warning); }
.statut-expire { color: var(--color-error); }
.statut-secours { color: var(--text-muted); }
.compte .bouton { font-size: var(--text-xs); padding: 4px var(--space-3); white-space: nowrap; }

.onglets { display: flex; gap: var(--space-1); padding: 0 var(--space-6); border-bottom: 1px solid var(--border-light); overflow-x: auto; flex: none; }
.onglet { border: 0; background: none; cursor: pointer; padding: var(--space-2) var(--space-3); font-size: var(--text-sm);
          color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.onglet.actif { color: var(--accent-active); border-bottom-color: var(--accent); font-weight: var(--font-medium); }
.onglet-contenu { padding: var(--space-5) var(--space-6); overflow-y: auto; font-size: var(--text-sm); }
.onglet-contenu pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: var(--text-xs);
                      background: var(--bg-primary); border: 1px solid var(--border-light); padding: var(--space-4);
                      border-radius: var(--radius-lg); margin: 0; }
.onglet-contenu dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.onglet-contenu dt { color: var(--text-muted); }
.onglet-contenu dd { margin: 0; overflow-wrap: anywhere; }
.travaux-tableau { overflow-x: auto; }
table.travaux { width: 100%; border-collapse: collapse; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
table.travaux th, table.travaux td { text-align: left; padding: 6px var(--space-2); border-bottom: 1px solid var(--border-light); white-space: nowrap; }
table.travaux th { color: var(--text-muted); font-weight: var(--font-medium); }
.statut-refuse { color: var(--color-error); }
.statut-fait { color: var(--color-success); }
.vide { color: var(--text-muted); margin: 0; }


/* ── Personnalisation (mission #7.3) : l'apparence de CHACUN, et le nom affiché de l'organisation ──── */
.reglage { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-4); align-items: start;
           padding: var(--space-5) 0; border-top: 1px solid var(--border-light); }
.reglage:first-of-type { border-top: 0; }
.reglage-nom b { display: block; font-size: var(--text-sm); font-weight: var(--font-semibold); }
.reglage-nom small { display: block; font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.segments { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--radius-lg);
            background: var(--bg-surface); border: 1px solid var(--border-light); }
.segments button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer;
                   padding: 5px var(--space-3); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--text-secondary); }
.segments button svg { width: 15px; height: 15px; }
.segments button[aria-pressed="true"] { background: var(--bg-secondary); color: var(--text-primary); font-weight: var(--font-medium);
                                        box-shadow: var(--shadow-sm); }
.teintes { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.teinte { width: 28px; height: 28px; border-radius: var(--radius-full); border: 2px solid var(--bg-primary); cursor: pointer;
          box-shadow: 0 0 0 1px var(--border-default); display: grid; place-items: center; color: #fff; }
.teinte[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text-primary); }
.teinte svg { width: 14px; height: 14px; stroke-width: 2.4; }
.teinte-libre { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--text-muted);
                margin-left: var(--space-2); }
.teinte-libre input { width: 32px; height: 28px; padding: 0; border: 1px solid var(--border-default); border-radius: var(--radius-md);
                      background: none; cursor: pointer; }
.champ-nom { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.champ-nom input { flex: 1 1 200px; min-width: 0; border: 1px solid var(--border-default); border-radius: var(--radius-md);
                   padding: 7px var(--space-3); background: var(--bg-secondary); font-size: var(--text-sm); }
.champ-nom input:focus { outline: 2px solid var(--accent-border); }
.enregistre { font-size: var(--text-xs); color: var(--color-success); margin-left: var(--space-2); }
.bientot-ligne { font-size: var(--text-sm); color: var(--text-muted); }

/* ── La consommation d'un agent (mission #7.3) — dans l'esprit de la page Consommation de Kaordia ────── */
.conso-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.conso-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-5); }
.conso-chiffre { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); }
.conso-chiffre b { display: block; font-size: var(--text-lg); font-weight: var(--font-semibold); font-variant-numeric: tabular-nums; }
.conso-chiffre span { font-size: var(--text-xs); color: var(--text-muted); }
.conso-bloc { margin-bottom: var(--space-5); }
.conso-bloc h3 { font-size: var(--text-sm); font-weight: var(--font-semibold); margin: 0 0 var(--space-2); }
/* L'histogramme « jetons par jour » : une seule série, pas de légende (le titre la nomme) ; barres fines ancrées
   sur la ligne de base, coin haut arrondi 4 px, 2 px entre elles ; une infobulle par barre ; le pic est ÉCRIT
   (l'accent clair fait 2,96:1 sur le fond — sous 3:1, le guide de visualisation exige des valeurs visibles),
   et l'historique ci-dessous en est la vue en tableau. */
.histogramme-cadre { width: 100%; }
.histogramme { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 120px;
               border-bottom: 1px solid var(--border-default); padding-top: 18px; }
.barre { position: relative; flex: 1 1 0; min-width: 3px; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.barre i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.barre.vide i { background: var(--border-light); }
.barre:hover i, .barre:focus-visible i { background: var(--accent-hover); }
.barre em { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px;
            color: var(--text-secondary); white-space: nowrap; margin-bottom: 2px; }
.barre .bulle-info { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5;
                     background: var(--text-primary); color: var(--bg-primary); font-size: 11px; padding: 4px 8px; border-radius: var(--radius-md);
                     white-space: nowrap; box-shadow: var(--shadow-md); }
.barre:hover .bulle-info, .barre:focus-visible .bulle-info { display: block; }
.axe-jours { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── La section MCP (mission #7.5) ─────────────────────────────────────────────── */
.mcp-carte { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
             padding: var(--space-4) var(--space-5); margin: var(--space-4) 0; display: grid; gap: var(--space-3); }
.mcp-ligne { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.mcp-adresse { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-secondary); overflow-wrap: anywhere; }
.mcp-etat { font-size: var(--text-sm); font-weight: var(--font-medium); }
.mcp-etat.connecte { color: var(--color-success); }
.mcp-etat.non { color: var(--color-warning); }
.mcp-outils { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.mcp-outils li { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
                 padding: var(--space-3) var(--space-4); }
.mcp-outils b { font-size: var(--text-sm); }
.mcp-outils code { font-family: var(--font-mono); font-size: var(--text-xs); background: var(--bg-surface); padding: 1px 6px;
                   border-radius: var(--radius-sm); margin: 2px 4px 0 0; display: inline-block; }
a.bouton { text-decoration: none; display: inline-block; }

/* ── Le téléphone : le volet se replie derrière un bouton ──────────────── */
@media (max-width: 760px) {
  .volet { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 272px; min-width: 0; transform: translateX(-100%);
           visibility: hidden; transition: transform .2s var(--ease-in-out), visibility .2s; box-shadow: var(--shadow-lg); }
  .coquille.volet-ouvert .volet { transform: none; visibility: visible; }
  .coquille.volet-ouvert .voile { display: block; position: fixed; inset: 0; background: var(--voile); z-index: 30; }
  .barre-mobile { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2);
                  border-bottom: 1px solid var(--border-light); flex: none; }
  .barre-mobile-titre { flex: 1; min-width: 0; text-align: center; font-weight: var(--font-medium); font-size: var(--text-sm);
                        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fil { padding: var(--space-5) var(--space-4); }
  .saisie-zone { padding: 0 var(--space-3) var(--space-3); }
  .choix-modele kv-selecteur { max-width: 130px; }
  .accueil { margin-top: 12vh; }
  .parametres-coquille { gap: var(--space-4); padding: var(--space-4); }
  .parametres-nav { gap: 0; }
  .parametres-nav a { padding: var(--space-2) 10px; }
  .tuiles { grid-template-columns: 1fr; }
  .reglage { grid-template-columns: 1fr; gap: var(--space-2); }
  .compte { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .compte-etat { grid-column: 2 / -1; }
  .compte .bouton { grid-column: 2 / -1; justify-self: start; }
}
.mcp-carte + .mcp-carte { margin-top: var(--space-3); }
.mcp-branches-titre { margin: var(--space-1) 0 0; font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em; }


/* (#974.1) Les Paramètres montés dans /admin (`?cadre=admin`) : la section seule, la coquille de /admin fait le reste. */
.cadre-admin .volet, .cadre-admin .volet-place, .cadre-admin .barre-mobile, .cadre-admin .voile, .cadre-admin .parametres-nav { display: none !important; }

/* ── La marque blanche (everbrain #1020.1) : le logo de l'application dans le volet, l'avatar de la personne ── */
.volet-logo .marque-application { height: 26px; max-width: 132px; object-fit: contain; flex: none; }
.volet-logo.avec-logo .marque-clair, .volet-logo.avec-logo .marque-sombre { display: none !important; }
.initiales.avec-avatar { background: none; overflow: hidden; font-size: 0; }
.initiales img { width: 100%; height: 100%; object-fit: cover; display: block; }
.initiales-grandes { width: 72px; height: 72px; font-size: var(--text-xl); }
.profil-avatar { display: flex; gap: var(--space-4); align-items: center; }
.profil-gestes { display: grid; gap: var(--space-1); min-width: 0; }
.profil-gestes small { color: var(--text-muted); font-size: var(--text-xs); }
.profil-boutons { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.profil-boutons label.bouton { cursor: pointer; }
.connexion-marque { max-height: 64px; max-width: 240px; object-fit: contain; }

/* ── (everbrain #1143.1) Le serveur MCP du projet : ses verbes, leur interrupteur, leurs accès ─────────────────── */
.mcp-titre { font-size: var(--text-md, 15px); margin: var(--space-5) 0 var(--space-2); }
.mcp-verbes { margin-top: var(--space-2); }
.mcp-verbe .mcp-description { margin: var(--space-1) 0; }
.mcp-acces-ligne { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center;
  font-size: var(--text-xs); color: var(--text-secondary); }
.mcp-acces { display: inline-flex; align-items: center; gap: var(--space-1); }
.interrupteur { all: unset; box-sizing: border-box; cursor: pointer; width: 36px; height: 20px; border-radius: 999px; flex: none;
  background: var(--border-default); position: relative; transition: background .15s var(--ease-in-out); }
.interrupteur span { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-primary); box-shadow: var(--shadow-sm); transition: transform .15s var(--ease-in-out); }
.interrupteur[aria-checked="true"] { background: var(--color-success); }
.interrupteur[aria-checked="true"] span { transform: translateX(16px); }
.interrupteur:focus-visible { outline: 2px solid var(--accent-border); outline-offset: 2px; }
.interrupteur:disabled { opacity: .6; cursor: progress; }
