/* discussion.css - LE STYLE DU CHAT, repris tel quel de Poevai4 (discussion.html, maquette du 2026-09-25), sorti dans son propre fichier. */
/* L'UI de la discussion (maquette du 2026-09-25) : un rail à gauche, un fil d'Ariane en tête, la conversation dans
   une carte, la saisie dans une carte blanche, le panneau des raisonnements à droite. L'UI seulement : les
   pièces jointes, le dossier lié, les projets, « Fichiers » et « Détails » sont dessinés, pas branchés. */
:root {
  --fond: #ffffff; --surface: #ffffff; --carte: #f4f4f5; --texte: #141416; --doux: #6f6f78;
  --bord: #e6e6ea; --accent: #141416; --accent-texte: #ffffff; --bulle-ia: transparent; --bulle-moi: #ffffff;
  --erreur: #b91c1c; --piste: #ececef; --rail: 60px; --rayon: 22px; --ombre: 0 2px 10px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0f0f11; --surface: #18181b; --carte: #1d1d21; --texte: #ececef; --doux: #9a9aa3;
    --bord: #2c2c31; --accent: #ececef; --accent-texte: #0f0f11; --bulle-moi: #26262b;
    --erreur: #f87171; --piste: #26262b; --ombre: 0 2px 10px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
    --fond: #0f0f11; --surface: #18181b; --carte: #1d1d21; --texte: #ececef; --doux: #9a9aa3;
    --bord: #2c2c31; --accent: #ececef; --accent-texte: #0f0f11; --bulle-moi: #26262b;
    --erreur: #f87171; --piste: #26262b; --ombre: 0 2px 10px rgba(0,0,0,.4);
  }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--fond); color: var(--texte);
  /* La police de l'app Hdplio (assets/css/01-tokens.css, --font-sans) : celle du système, sans fonte en ligne. */
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: grid; grid-template-columns: var(--rail) 1fr; grid-template-rows: 56px 1fr; height: 100%;
}
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Le champ de saisie ne porte pas d'anneau au focus (décision du 2026-09-25) : la carte de saisie suffit à le situer. */
#message:focus, #message:focus-visible { outline: none; box-shadow: none; }

/* Le rail : des boutons ronds, sans fonction pour l'instant (sauf « Nouvelle »). */
.rail { grid-row: 1 / 3; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0; }
.rail .bas { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.rond { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--carte); color: var(--doux); display: grid; place-items: center; padding: 0; }
.rond:hover { color: var(--texte); background: color-mix(in srgb, var(--texte) 8%, var(--carte)); }
.rond.marque-icone { background: none; overflow: hidden; }
/* « Nouvelle » et « Discussions » dans une même carte, séparés d'un trait fin (décision du 2026-09-26). */
.groupe { display: flex; flex-direction: column; align-items: center; padding: 3px; border-radius: 14px; background: var(--carte); }
.groupe .rond { background: transparent; width: 36px; height: 36px; border-radius: 10px; }
.groupe .rond:hover { background: color-mix(in srgb, var(--texte) 8%, var(--carte)); }
.groupe .rond[aria-pressed="true"] { color: var(--texte); background: color-mix(in srgb, var(--texte) 10%, var(--carte)); }
.groupe hr { width: 20px; margin: 3px 0; border: 0; border-top: 1px solid color-mix(in srgb, var(--texte) 12%, transparent); }
.rond svg, .icone svg { display: block; }
.rond.marque-icone img { width: 40px; height: 40px; display: block; }

header {
  grid-column: 2; display: flex; align-items: center; gap: 10px; padding: 0 20px 0 6px; font-size: 14px;
}
header .marque { font-weight: 700; font-size: 16px; }
header .droite { margin-left: auto; display: flex; align-items: center; gap: 14px; }
/* Le badge du transport (« SharedArrayBuffer · 8 workers ») ne s'affiche plus (décision du 2026-09-25) ; le script l'écrit encore, il reste dans le DOM pour ses infobulles. */
#transport { display: none; }
.lien { background: transparent; border: 0; color: var(--doux); padding: 4px 2px; font-size: 13px; text-decoration: none; }
.lien:hover { color: var(--texte); }

/* L'encart de la discussion descend jusqu'au bas de la fenêtre : arrondi en haut seulement. */
.corps { grid-column: 2; min-height: 0; display: flex; gap: 16px; padding: 0 20px 0 6px; }
.chat {
  flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column;
  background: var(--carte); border-radius: var(--rayon) var(--rayon) 0 0; overflow: hidden;
}

#fil { flex: 1; overflow-y: auto; padding: 20px 24px 10px; display: flex; flex-direction: column; gap: 10px; }
/* La barre de défilement du fil : un fin trait discret, sans flèches ni fond, qui se marque au survol et au geste ;
   dans la carte grise, collée au bord droit avec sa marge. */
#fil { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--texte) 14%, transparent) transparent; scrollbar-gutter: stable; }
#fil::-webkit-scrollbar { width: 12px; }
#fil::-webkit-scrollbar-track { background: transparent; margin: 14px 0; }
#fil::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--texte) 14%, transparent); border-radius: 999px;
  border: 4px solid transparent; background-clip: content-box; min-height: 40px; transition: background-color .2s;
}
#fil:hover::-webkit-scrollbar-thumb { background-color: color-mix(in srgb, var(--texte) 26%, transparent); }
#fil::-webkit-scrollbar-thumb:hover, #fil::-webkit-scrollbar-thumb:active { background-color: color-mix(in srgb, var(--texte) 45%, transparent); }
#fil::-webkit-scrollbar-button { display: none; height: 0; }
#fil > * { width: 100%; }
.ligne { display: flex; flex-direction: column; align-items: flex-start; }
.ligne.moi { align-items: flex-end; }
.msg { max-width: 70%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.moi { background: var(--bulle-moi); border-bottom-right-radius: 6px; }
/* Un repère discret devant chaque réponse de Poevai : un point gris, pour que l'œil sache qui parle sans bulle. */
.msg.ia  { background: var(--bulle-ia); position: relative; padding-left: 16px; padding-right: 0; cursor: pointer; }
.msg.ia::before { content: ""; position: absolute; left: 0; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--texte) 35%, transparent); }
.msg.erreur::before, .msg.arrete::before { display: none; }
.msg.ia.choisie { color: var(--texte); }  /* la réponse ouverte dans le panneau ne se marque plus (décision du 2026-09-25) */
/* La mention sous chaque réponse (« prouvé, recalculable », la provenance) ne s'affiche plus (décision du 2026-09-25) :
   le panneau des raisonnements la porte déjà. Elle reste dans le DOM. */
.note { display: none; }
/* Sauf la mention de RÉSERVE (CDC_ABONNEMENTS, A9, décision du propriétaire du 2026-09-26) : un savoir servi en
   passage, ou plus profond que la réserve ; dite sous la bulle, jamais dans la réponse. */
.note.note-reserve { display: block; margin: -4px 0 4px 16px; font-size: 12px; color: var(--doux); }
.msg.erreur { color: var(--erreur); background: transparent; padding: 0 0 0 16px; font-size: 13px; cursor: pointer; }
.msg.arrete { color: var(--doux); background: transparent; padding: 0; font-size: 13px; font-style: italic; cursor: pointer; }
#vide { margin: auto; color: var(--doux); text-align: center; }

/* LA LISTE DES DISCUSSIONS (bouton « Discussions » du rail) : elle prend la place du fil et de la saisie. */
#liste { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
#liste[hidden] { display: none; }
#liste h2 { margin: 0 0 10px; font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
#liste h2 button { width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--doux); display: grid; place-items: center; padding: 0; }
#liste h2 button:hover { background: var(--surface); color: var(--texte); }
#liste .dc { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--texte); text-align: left; }
#liste .dc:hover { background: var(--surface); }
#liste .dc[aria-current="true"] { background: var(--surface); }
#liste .dc > svg { flex-shrink: 0; color: var(--doux); }
#liste .dc span { min-width: 0; display: grid; }
#liste .dc b { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#liste .dc small { color: var(--doux); font-size: 12px; }
#liste p { color: var(--doux); margin: 8px 10px; }
#liste h2 .etire { flex: 1; }
#liste h2 .ajout { width: auto; padding: 0 10px 0 8px; gap: 6px; display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 550; color: var(--texte); }
/* Un DOSSIER : son en-tête (chevron, icône, titre, nombre, actions) puis ses discussions, en retrait. */
.groupe-dc { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.tete { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 4px; border-radius: 10px; color: var(--doux); font-size: 12.5px; font-weight: 600; }
.tete.cible { background: color-mix(in srgb, var(--texte) 10%, var(--carte)); color: var(--texte); }
.tete .plier { width: 24px; height: 24px; border: 0; background: transparent; color: inherit; display: grid; place-items: center; padding: 0; border-radius: 7px; }
.tete .plier svg { transition: transform .15s; }
.groupe-dc:not(.plie) .tete .plier svg { transform: rotate(90deg); }
.tete .nom { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; }
.tete .nom b { font-weight: 600; color: var(--texte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tete .nombre { font-weight: 500; }
/* Replié : ses discussions (la ligne entière, bouton de menu compris) disparaissent ; l'id l'emporte sur « #liste .dc ». */
#liste .groupe-dc.plie .ligne-dc { display: none; }
#liste .groupe-dc.dans-dossier .dc { padding-left: 34px; }
.act { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--doux); display: grid; place-items: center; padding: 0; opacity: 0; transition: opacity .12s; flex-shrink: 0; }
.tete:hover .act, .ligne-dc:hover .act, .act:focus-visible, .act[aria-expanded="true"] { opacity: 1; }
.act:hover { background: var(--surface); color: var(--texte); }
.ligne-dc { position: relative; display: flex; align-items: center; gap: 2px; }
.ligne-dc .dc { flex: 1; min-width: 0; }
.ligne-dc.glisse { opacity: .45; }
.renomme { flex: 1; min-width: 0; font: inherit; font-weight: 550; color: var(--texte); background: var(--surface); border: 1px solid var(--bord); border-radius: 7px; padding: 3px 7px; }
/* Le petit menu d'une discussion : renommer, ranger dans un dossier. */
.menu-dc { position: absolute; right: 0; top: calc(100% + 2px); z-index: 5; min-width: 210px; padding: 5px; border-radius: 12px; background: var(--surface); box-shadow: 0 8px 28px rgba(0,0,0,.14), 0 0 0 1px var(--bord); display: grid; gap: 1px; }
.menu-dc button { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--texte); text-align: left; font-size: 13px; }
.menu-dc button:hover { background: var(--carte); }
.menu-dc button[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--doux); }
.menu-dc small { padding: 6px 9px 2px; color: var(--doux); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.menu-dc hr { border: 0; border-top: 1px solid var(--bord); margin: 4px 2px; }
.menu-dc svg { color: var(--doux); flex-shrink: 0; }
.chat.en-liste #fil, .chat.en-liste form, .chat.en-liste #bandeau { display: none; }

/* Le message en attente (« je cherche ») : une carte flottante au-dessus de la saisie. */
#bandeau {
  position: absolute; right: 28px; bottom: 142px; z-index: 2; max-width: 360px;
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--ombre); font-size: 12px; color: var(--doux);
}
#bandeau::before { content: ""; width: 22px; height: 22px; border-radius: 7px; background: var(--accent); flex-shrink: 0; }
#bandeau[hidden] { display: none; }
#bandeau button { padding: 4px 10px; border: 1px solid var(--bord); border-radius: 8px; background: transparent; color: var(--texte); font-weight: 600; font-size: 12px; }

/* La saisie : une carte blanche, compacte. Le champ en haut sur toute la largeur ; en dessous, une seule ligne
   d'outils : les icônes (trombone, micro), l'état des pièces jointes en petit, le bouton noir à droite. */
form { padding: 0 16px 16px; }
form > div {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px 12px 16px; background: var(--surface); border-radius: 18px;
}
input {
  width: 100%; min-width: 0; padding: 4px 0 0; font: inherit; color: var(--texte);
  background: transparent; border: 0; outline: none;
}
/* LE MODE APPRENTISSAGE : sa couleur propre (un violet, en clair et en sombre), un bandeau en tête de la saisie, le badge
   « /learn » en pastille, une entrée animée. */
:root { --learn: #6d28d9; --learn-doux: #ede9fe; --learn-texte: #4c1d95; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --learn: #a78bfa; --learn-doux: #2e1f55; --learn-texte: #ddd6fe; } }
:root[data-theme="dark"] { --learn: #a78bfa; --learn-doux: #2e1f55; --learn-texte: #ddd6fe; }
.ligne-saisie { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ligne-saisie input { padding-top: 0; }
.commande { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; height: 24px; padding: 0 9px 0 8px; cursor: default; user-select: none; border-radius: 999px; background: var(--learn-doux); color: var(--learn); font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; animation: rw-pop .15s ease-out; }
.commande[hidden] { display: none; }
.commande:focus-visible { outline: 2px solid var(--learn); outline-offset: 2px; }
form[data-mode="apprentissage"] #message::placeholder { color: color-mix(in srgb, var(--learn) 60%, var(--doux)); }
form[data-mode="apprentissage"] button[type=submit] { background: var(--learn); color: #fff; }
@keyframes rw-pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
/* La suggestion des commandes, dès « / » en tête. */
.suggestion { display: grid; gap: 2px; margin-top: -2px; }
.suggestion[hidden] { display: none; }
.suggestion button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 9px; border: 0; border-radius: 10px; background: var(--carte); color: var(--doux); font-size: 12.5px; text-align: left; }
.suggestion button:hover, .suggestion button[aria-selected="true"] { color: var(--texte); background: color-mix(in srgb, var(--learn) 8%, var(--carte)); }
.suggestion .sg-icone { width: 26px; height: 26px; flex-shrink: 0; display: grid; place-items: center; border-radius: 8px; background: var(--learn-doux); color: var(--learn); }
.suggestion .sg-texte { display: flex; flex-direction: column; gap: 1px; }
.suggestion .commande-nom { font: 600 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--learn); }
.suggestion kbd { margin-left: auto; padding: 1px 6px; border: 1px solid var(--bord); border-radius: 5px; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--doux); background: var(--surface); }
/* La bulle d'une demande faite en mode apprentissage : son badge, et un liseré violet. */
.msg.moi .commande { height: 20px; margin-right: 6px; padding: 0 8px 0 6px; vertical-align: 1px; font-size: 11px; animation: none; }
.outils { display: flex; align-items: center; gap: 4px; }
.vignettes { display: flex; gap: 2px; }
.vignettes .icone { width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; color: var(--doux); display: grid; place-items: center; padding: 0; }
.vignettes .icone:hover { background: var(--carte); color: var(--texte); }
.pj { font-size: 12px; color: var(--doux); margin-left: 6px; }
.actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
/* Envoyer : petit, compact, la touche Entrée dessinée ; absent tant que le champ est vide (décision du 2026-09-26). */
form button[type=submit] { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px 0 11px; font-weight: 600; font-size: 12.5px; background: var(--accent); color: var(--accent-texte); border: 0; border-radius: 8px; transition: opacity .15s; }
form button[type=submit][hidden] { display: none; }
form button[type=submit]:hover:not(:disabled) { opacity: .85; }
form button#arreter { height: 28px; padding: 0 10px; font-size: 12.5px; background: transparent; color: var(--texte); border: 1px solid var(--bord); border-radius: 10px; font-weight: 500; }
form button#arreter:hover { border-color: var(--erreur); color: var(--erreur); }

/* Le panneau : ses trois onglets (seul « Raisonnements » est branché), puis le détail. */
.panneau { width: 360px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; }
.pn-onglets { display: flex; gap: 16px; padding: 4px 12px 8px; font-size: 14px; }
.pn-onglets button { background: transparent; border: 0; padding: 4px 0; color: var(--doux); font-weight: 500; }
.pn-onglets button[aria-selected="true"] { color: var(--texte); font-weight: 700; }
#detail { width: auto; flex: 1; border-left: 0; background: transparent; }
#volets { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pn-volet { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pn-volet[hidden] { display: none; }
.pn-volet.vue { overflow-y: auto; padding: 4px 12px 24px; scrollbar-width: thin; }
/* Les onglets du panneau sont ceux de la page (Détails = Demande, État = Système) : ceux de detail.js se cachent. */
#detail .dt-onglets { display: none; }
#detail[hidden] { display: none; }
#fichiers { flex: 1; overflow-y: auto; padding: 4px 12px 24px; font-size: 12.5px; line-height: 1.45; }
#fichiers[hidden] { display: none; }
#fichiers h3 { margin: 18px 0 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--doux); }
#fichiers p { margin: 0; color: var(--doux); }
/* L'attente en direct : ce que Poevai fait, dit sous la demande, à partir des notes des agents. */
.msg.ia .lv-fichiers { display: inline-flex; gap: 6px; margin-top: 6px; }
.msg.ia .lv-fichiers button { padding: 2px 9px; border: 1px solid var(--bord); border-radius: 999px; background: var(--fond); color: var(--texte); font-size: 12px; cursor: pointer; }
/* Les fichiers JOINTS à un message de la personne : leurs noms, en pastilles (lus sur l'appareil, jamais partagés). */
.msg.moi .joints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg.moi .joints span { padding: 2px 9px; border: 1px solid var(--bord); border-radius: 999px; font-size: 12px; color: var(--doux); }
#fichiers ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#fichiers li { padding: 8px 10px; border: 1px solid var(--bord); border-radius: 10px; display: grid; gap: 4px; }
#fichiers li b { font-weight: 600; color: var(--texte); }
#fichiers li .fi-meta { color: var(--doux); font-size: 11.5px; }
#fichiers li .fi-actions { display: flex; gap: 6px; }
#fichiers li .fi-actions button { padding: 3px 10px; border: 1px solid var(--bord); border-radius: 8px; background: transparent; color: var(--texte); font-size: 12px; cursor: pointer; }
#fichiers li pre { margin: 4px 0 0; padding: 8px; border-radius: 8px; background: var(--carte); font-size: 11.5px; max-height: 240px; overflow: auto; white-space: pre-wrap; }
#fichiers li iframe { width: 100%; height: 280px; border: 1px solid var(--bord); border-radius: 8px; background: #fff; }
.msg.ia.attente { color: var(--doux); cursor: default; }
.msg.ia.attente::before { animation: pouls 1.2s ease-in-out infinite; }
@keyframes pouls { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* PROFIL ET PARAMÈTRES (CDC_V1, I.1 ; dans l'encart de la discussion depuis le 2026-09-26) : des volets choisis à
   gauche, un visible à la fois. Le volet Abonnement est masqué pour la version expérimentale. */
#profil { flex: 1; min-height: 0; background: var(--carte); color: var(--texte); }
#profil:not([hidden]) { display: grid; grid-template-columns: 196px 1fr; grid-template-rows: auto minmax(0, 1fr); }
.chat.en-reglages #fil, .chat.en-reglages form, .chat.en-reglages #bandeau, .chat.en-reglages #liste { display: none; }
/* LES PERSONA (CDC_PERSONA) : dans l'encart, comme la liste ; le panneau de droite se cache. */
.chat.en-personas #fil, .chat.en-personas form, .chat.en-personas #bandeau, .chat.en-personas #liste { display: none; }
.corps:has(.chat.en-personas) .panneau { display: none; }
/* Le panneau de droite n'accompagne qu'une discussion : ni la liste, ni les paramètres. */
.corps:has(.chat.en-liste) .panneau, .corps:has(.chat.en-reglages) .panneau { display: none; }
#profil .tete { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--bord); }
#profil h2 { margin: 0; font-size: 16px; }
#profil .fermer { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--doux); font-size: 20px; line-height: 1; }
#profil .fermer:hover { background: var(--surface); color: var(--texte); }
#profil .p-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-right: 1px solid var(--bord); overflow-y: auto; }
#profil .p-nav [role=tab] { padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--doux); font-size: 13.5px; text-align: left; cursor: pointer; }
#profil .p-nav [role=tab]:hover { color: var(--texte); background: color-mix(in srgb, var(--surface) 60%, transparent); }
#profil .p-nav [role=tab][aria-selected=true] { background: var(--surface); color: var(--texte); font-weight: 600; }
#profil .p-legal { margin-top: auto; display: grid; gap: 2px; padding-top: 10px; }
#profil .p-legal a { padding: 4px 10px; font-size: 12px; color: var(--doux); text-decoration: none; }
#profil .p-legal a:hover { color: var(--texte); }
#profil .p-volets { overflow-y: auto; min-height: 0; }
#profil section { padding: 18px 22px; display: grid; gap: 10px; align-content: start; }
#profil section[hidden] { display: none; }
#profil h3 { margin: 0; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
#profil p { margin: 0; font-size: 13px; color: var(--doux); }
#profil .ligne-p { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; }
#profil .actions-p { display: flex; flex-wrap: wrap; gap: 8px; }
#profil .btn { padding: 7px 12px; border: 1px solid var(--bord); border-radius: 10px; background: transparent; color: var(--texte); font-size: 13px; font-weight: 550; text-decoration: none; }
#profil .btn:hover { background: var(--surface); }
#profil .btn.danger { color: var(--erreur); border-color: color-mix(in srgb, var(--erreur) 40%, var(--bord)); }
#profil .choix { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); }
#profil .choix label { padding: 5px 11px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
#profil .choix input { position: absolute; opacity: 0; pointer-events: none; }
#profil .choix label:has(input:checked) { background: var(--carte); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
#profil .choix label:has(input:focus-visible) { outline: 2px solid var(--accent); }
#profil .bascule { position: relative; width: 38px; height: 22px; flex-shrink: 0; appearance: none; border-radius: 999px; background: var(--piste); cursor: pointer; transition: background .15s; }
#profil .bascule::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
#profil .bascule:checked { background: var(--accent); }
#profil .bascule:checked::after { transform: translateX(16px); }
#profil .etat-p { font-size: 12.5px; min-height: 1em; }
#profil .etat-p.erreur { color: var(--erreur); }
#profil input[type=password] { min-height: 34px; padding: 0 10px; border: 1px solid var(--bord); border-radius: 9px; background: var(--fond); color: var(--texte); }
/* Le bouton de profil (décision du 2026-09-26) : un rond ; connecté, l'initiale de la personne sur la couleur d'accent. */
#ouvrir-profil { border-radius: 50%; overflow: hidden; }
#ouvrir-profil.avatar { background: var(--accent); color: var(--accent-texte); font-weight: 700; font-size: 15px; text-transform: uppercase; }
#ouvrir-profil.avatar:hover { background: var(--accent); opacity: .88; }
/* Invité : un « I » sur un rond orange. */
#ouvrir-profil.invite, #ouvrir-profil.invite:hover, #ouvrir-profil.connecte, #ouvrir-profil.connecte:hover { background: #ea580c; color: #ffffff; font-weight: 700; font-size: 15px; }
#ouvrir-profil.connecte { font-size: 13px; letter-spacing: .02em; }
#ouvrir-profil.connecte:hover { opacity: .88; }
#ouvrir-profil.invite:hover { opacity: .88; }
/* Le volet Compte : connecté, une carte ; sinon, Se connecter / Créer un compte / Mot de passe oublié, sur place. */
#profil .p-carte { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--bord); border-radius: 14px; background: var(--fond); }
#profil .p-avatar { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-texte); font-weight: 700; font-size: 18px; text-transform: uppercase; }
#profil .p-carte b { display: block; font-size: 14px; color: var(--texte); overflow: hidden; text-overflow: ellipsis; }
#profil .p-carte span { font-size: 12.5px; color: var(--doux); }
#profil .p-bascule-compte { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 11px; background: var(--surface); }
#profil .p-bascule-compte button { height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--doux); font-size: 13px; font-weight: 550; }
#profil .p-bascule-compte button[aria-selected=true] { background: var(--carte); color: var(--texte); font-weight: 650; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
/* (La règle « form » de la barre de message ne s'applique pas ici.) */
#profil .p-form { display: grid; gap: 12px; max-width: 380px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; position: static; }
#profil .p-form[hidden] { display: none; }
#profil .p-form label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--texte); }
#profil .p-form input[type=email], #profil .p-form input[type=password] { width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--fond); color: var(--texte); font: inherit; font-size: 14px; font-weight: 400; }
#profil .p-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
#profil .p-form .aide { font-size: 12px; font-weight: 400; color: var(--doux); }
#profil .p-form .principal { height: 40px; justify-content: center; padding: 0 16px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-texte); font-size: 14px; font-weight: 650; }
#profil .p-form .principal:hover { opacity: .9; }
#profil .p-form .lien { justify-self: start; padding: 0; border: 0; background: none; color: var(--doux); font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; }
#profil .p-form .lien:hover { color: var(--texte); }
#profil .p-form .etat-p.ok { color: var(--texte); }
/* Le volet Abonnement : la réserve de l'appareil, les offres, trois promesses. */
#profil .abo-intro { font-size: 13.5px; line-height: 1.5; }
/* PARAMÈTRES, deuxième version du design (2026-09-26) : un en-tête léger, une navigation à icônes, une colonne de
   contenu à largeur de lecture, des titres de section lisibles, des encarts sur fond doux. */
#profil:not([hidden]) { grid-template-columns: 224px minmax(0, 1fr); }
#profil .tete { border-bottom: 0; padding: 20px 24px 6px 24px; }
#profil h2 { font-size: 18px; font-weight: 700; color: var(--texte); letter-spacing: -.01em; }
#profil .p-nav { border-right: 0; padding: 10px 12px 16px 16px; gap: 2px; }
#profil .p-nav [role=tab] { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14px; }
#profil .p-nav [role=tab] svg { flex-shrink: 0; opacity: .8; }
#profil .p-nav [role=tab][aria-selected=true] { background: color-mix(in srgb, var(--texte) 7%, transparent); }
#profil .p-nav [role=tab][hidden] { display: none; }
#profil .p-volets { padding: 0 24px 32px 8px; }
#profil section { max-width: 620px; padding: 12px 8px 0; gap: 14px; }
#profil section > h3 { font-size: 16px; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--texte); margin-bottom: 2px; }
#profil .p-carte { border: 0; background: var(--surface); }
#profil .p-bascule-compte { max-width: 400px; }
#profil .p-form { max-width: 400px; }
#profil .abo-actuel { display: grid; gap: 6px; padding: 18px 20px; border-radius: 16px; background: var(--surface); max-width: 400px; }
#profil .abo-etiquette { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
#profil .abo-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#profil .abo-ligne b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
#profil .abo-lumens { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
#profil .abo-actuel p { font-size: 12.5px; line-height: 1.45; }
#v-abonnement > :not(h3):not(.abo-actuel) { display: none; }
/* L'écran Mémoire (CDC_MEMOIRE, §9.4). */
#profil .m-intro { font-size: 13px; line-height: 1.5; color: var(--doux); }
#profil .m-inter { display: grid; gap: 2px; margin: 0; padding: 6px; border: 0; border-radius: 14px; background: var(--surface); }
#profil .m-inter label { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
#profil .m-inter label:hover { background: color-mix(in srgb, var(--texte) 5%, transparent); }
#profil .m-inter input { width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
#profil .m-inter span { display: grid; gap: 1px; }
#profil .m-inter b { font-size: 13.5px; font-weight: 600; }
#profil .m-inter small { font-size: 12px; color: var(--doux); }
#profil .m-onglets { display: flex; flex-wrap: wrap; gap: 6px; }
#profil .m-onglets button { padding: 6px 11px; border: 1px solid var(--bord); border-radius: 999px; background: transparent; color: var(--doux); font-size: 12.5px; font-weight: 550; }
#profil .m-onglets button[aria-selected=true] { background: var(--texte); border-color: var(--texte); color: var(--fond); }
#profil .m-onglets button .m-n { margin-left: 5px; font-variant-numeric: tabular-nums; opacity: .7; }
#profil .m-liste { display: grid; gap: 8px; }
#profil .m-vide { padding: 18px; border-radius: 14px; background: var(--surface); font-size: 13px; color: var(--doux); }
#profil .m-fiche { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface); }
#profil .m-fiche .m-texte { font-size: 13.5px; line-height: 1.45; color: var(--texte); overflow-wrap: anywhere; }
#profil .m-fiche .m-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--doux); }
#profil .m-force { display: inline-flex; align-items: center; gap: 6px; }
#profil .m-force i { display: block; width: 56px; height: 5px; border-radius: 999px; background: var(--piste); overflow: hidden; }
#profil .m-force i b { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
#profil .m-epingle { font-weight: 600; color: var(--texte); }
#profil .m-boutons { display: flex; flex-wrap: wrap; gap: 6px; }
#profil .m-boutons .btn { padding: 4px 10px; font-size: 12px; }
#profil .m-corriger { display: flex; gap: 6px; }
#profil .m-corriger input { flex: 1; min-width: 0; min-height: 32px; padding: 0 10px; border: 1px solid var(--bord); border-radius: 9px; background: var(--fond); color: var(--texte); font: inherit; font-size: 13px; }
#profil .m-actions { align-items: center; }
#profil .m-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
#profil .m-sensibles { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--doux); margin-right: auto; white-space: nowrap; cursor: pointer; }
#profil .m-journal-titre { margin-top: 18px; }
#profil .m-journal { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
#profil .m-journal li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface); font-size: 13px; }
#profil .m-journal li span { color: var(--doux); font-size: 12px; white-space: nowrap; }
#profil .m-sensibles input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
#profil .abo-reserve { display: grid; gap: 6px; padding: 14px; border-radius: 14px; background: var(--surface); }
#profil .abo-reserve .ligne-p b { font-size: 13.5px; }
#profil .abo-reserve .chiffre { font-size: 12.5px; color: var(--doux); font-variant-numeric: tabular-nums; }
#profil .jauge { height: 6px; border-radius: 999px; background: var(--piste); overflow: hidden; }
#profil .jauge i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); }
/* Une offre par ligne : le nom et l'usage, la réserve, le prix. */
#profil .offres { display: grid; gap: 8px; }
#profil .offre { display: grid; grid-template-columns: minmax(0, 1fr) 118px 84px; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--bord); border-radius: 14px; }
#profil .offre.actuelle { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
#profil .offre .quoi { display: grid; gap: 2px; min-width: 0; }
#profil .offre .nom { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
#profil .offre .badge { padding: 2px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-texte); font-size: 10.5px; font-weight: 600; }
#profil .offre p { font-size: 12.5px; line-height: 1.4; }
#profil .offre .reserve { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#profil .offre .reserve small { font-size: 11.5px; font-weight: 500; color: var(--doux); }
#profil .offre .prix { text-align: right; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#profil .offre .prix small { display: block; font-size: 11px; font-weight: 500; color: var(--doux); }
#profil .abo-note { font-size: 12.5px; }
/* Ce que Poevai garde (CDC_ABONNEMENTS, A9) : un Sac par ligne, son origine, son palier, son poids, sa raison. */
#profil .abo-garde { display: grid; gap: 8px; }
#profil .abo-sacs { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
#profil .abo-sacs li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--bord); border-radius: 12px; }
#profil .abo-sacs .s-nom { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
#profil .abo-sacs .s-tag { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--doux); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
#profil .abo-sacs .s-raison { margin: 2px 0 0; font-size: 12px; }
#profil .abo-sacs .s-poids { font-size: 12px; color: var(--doux); font-variant-numeric: tabular-nums; white-space: nowrap; }
#profil .abo-sacs .btn { padding: 4px 10px; font-size: 12px; }
#profil .abo-sacs .vide { display: block; border: 0; padding: 0; font-size: 12.5px; color: var(--doux); }
#profil label.btn { cursor: pointer; }
#profil .promesses { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
#profil .promesses li { position: relative; padding-left: 16px; font-size: 12.5px; color: var(--doux); line-height: 1.45; }
#profil .promesses li::before { content: ""; position: absolute; left: 3px; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--doux); }
@media (max-width: 640px) {
  #profil:not([hidden]) { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0, 1fr); }
  #profil .p-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--bord); padding: 8px 10px; }
  #profil .p-nav [role=tab] { white-space: nowrap; }
  #profil .p-legal { display: none; }
  #profil section { padding: 16px; }
  #profil .offre { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  #profil .offre .reserve { grid-row: 2; }
}

/* Écran étroit : le rail s'efface, la conversation et le panneau se suivent, la page défile. */
@media (max-width: 860px) {
  /* Téléphone (CDC_V1, I.3) : le rail devient une barre en tête, à gauche du titre ; ses boutons restent tous là. */
  body { grid-template-columns: auto 1fr; grid-template-rows: 56px auto; height: auto; min-height: 100%; }
  .rail { grid-row: 1; grid-column: 1; flex-direction: row; align-items: center; gap: 8px; padding: 0 0 0 10px; }
  .rail .marque-icone { display: none; }
  .rail .groupe { flex-direction: row; padding: 2px; }
  .rail .groupe hr { width: 1px; height: 18px; margin: 0 2px; border-top: 0; border-left: 1px solid color-mix(in srgb, var(--texte) 12%, transparent); }
  .rail .bas { margin: 0; flex-direction: row; order: 3; }
  header { grid-column: 2; padding: 0 12px; }
  .corps { grid-column: 1 / -1; }
  .lien, .pj { display: none; }
  .corps { flex-direction: column; padding: 0 8px 8px; }
  .chat { flex: none; height: calc(100dvh - 64px); min-height: 420px; border-radius: var(--rayon); }
  .panneau { width: auto; height: 78vh; }
  #detail { position: static; inset: auto; width: auto; z-index: auto; box-shadow: none; }
  #fil { padding: 16px; }
  .msg { max-width: 88%; }
}

/* Persona et Lumens (CDC_PERSONA_LUMENS, L7) : les fiches de l'écran Mémoire, une aide discrète, l'offre en cours. */
#profil .p-aide { font-size: 12.5px; color: var(--doux); margin: 0 0 10px; }
#profil .lu-actuelle { outline: 1.5px solid var(--accent); }
#profil #lu-solde b { font-size: 18px; }
.dt-cout { font-variant-numeric: tabular-nums; }

/* LES TROIS VUES — paramètres, discussions, Persona — UNE même mise en page (2026-09-30) : le fond des paramètres, le même
   en-tête (titre de 18 px, × à droite pour revenir à la discussion, ← seulement pour revenir d'une fiche), les mêmes marges
   (20 × 24 px), une même colonne de lecture, des titres de section de 16 px, des encarts sur --carte. */
#liste, #personas { background: var(--carte); padding: 20px 24px 32px; gap: 14px; }
#liste > :not(.vue-tete) { width: 100%; max-width: 720px; }
:is(#liste, #personas) .vue-tete { display: flex; align-items: center; gap: 8px; min-height: 32px; }
:is(#liste, #personas) .vue-tete h2 { margin: 0; flex: 1; font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--texte); }
:is(#liste, #personas) .vue-tete :is(.fermer, .retour) { width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 9px; background: transparent; color: var(--doux); display: grid; place-items: center; padding: 0; font-size: 20px; line-height: 1; cursor: pointer; }
:is(#liste, #personas) .vue-tete :is(.fermer, .retour):hover { background: var(--surface); color: var(--texte); }
:is(#liste, #personas) .vue-tete .ajout { height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--bord); border-radius: 10px; background: transparent; color: var(--texte); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 550; cursor: pointer; }
:is(#liste, #personas) .vue-tete .ajout:hover { background: var(--surface); }
:is(#liste, #personas) .vue-titre { margin: 6px 0 8px; font-size: 16px; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--texte); }
:is(#liste, #personas) .vue-intro { margin: 0; font-size: 13px; line-height: 1.5; color: var(--doux); max-width: 620px; }
#liste .dc:hover, #liste .dc[aria-current="true"], #liste .act:hover { background: var(--surface); }
#liste p { margin: 0; font-size: 13px; color: var(--doux); }
#profil .tete h2 { flex: 1; }
/* ← à gauche du titre dans les trois vues (2026-09-30) : les paramètres comme les deux autres. */
#profil .tete { justify-content: flex-start; gap: 8px; }
#profil .tete .retour { width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 9px; background: transparent; color: var(--doux); display: grid; place-items: center; padding: 0; cursor: pointer; }
#profil .tete .retour:hover { background: var(--surface); color: var(--texte); }

/* LES PERSONA — la liste et la fiche, UNE seule grammaire (2026-09-30) : fond --carte, l'en-tête des vues, une colonne
   principale faite de sections (titre 15 px, compte, lien « Voir tout ») et un panneau blanc à droite découpé en parties par
   des filets. Cartes blanches à 12 px de rayon, aucune couleur hors des jetons, aucun empilement d'anciennes couches. */
#personas { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 20px 24px 40px; background: var(--carte); }
#personas[hidden] { display: none; }
#personas .vue-tete h2 { font-size: 18px; }
#personas .vue-tete .ps-fil { color: var(--doux); font-weight: 600; }
#personas .vue-tete .ajout { height: 30px; padding: 0 12px; font-size: 12.5px; background: var(--surface); border-color: transparent; }
#personas .vue-tete .ajout:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--bord); }
#personas .vue-tete .ajout.danger { color: var(--erreur); }
#personas .ps-mise { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 24px; align-items: start; }
#personas .ps-principal { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* Sections. */
#personas .ps-bloc { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#personas .ps-bloc-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
#personas .ps-bloc-tete :is(h3, h4) { margin: 0; display: flex; align-items: center; gap: 6px; color: var(--texte); letter-spacing: -.012em; }
#personas .ps-bloc-tete h3 { font-size: 15px; font-weight: 650; }
#personas .ps-bloc-tete h4 { font-size: 13px; font-weight: 650; }
#personas .ps-compte { min-width: 18px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--surface); display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 600; color: var(--doux); font-variant-numeric: tabular-nums; }
#personas .ps-cote .ps-compte { background: var(--carte); }
#personas .ps-lien { padding: 0; border: 0; background: transparent; font-size: 12px; color: var(--doux); cursor: pointer; }
#personas .ps-lien:hover { color: var(--texte); }
#personas .ps-vide { margin: 0; font-size: 13px; color: var(--doux); }

/* Indicateurs : libellé en petites capitales, un chiffre, une ligne. */
#personas .ps-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
#personas .ps-kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface); }
#personas .ps-kpi b { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#personas .ps-kpi em { font-style: normal; font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; color: var(--texte); font-variant-numeric: tabular-nums; }
#personas .ps-kpi em small { margin-left: 3px; font-size: 11px; font-weight: 500; color: var(--doux); }
#personas .ps-kpi > span { font-size: 11.5px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#personas .ps-lecture { width: 20px; height: 20px; flex-shrink: 0; padding: 0; border: 0; border-radius: 50%; background: var(--carte); color: var(--texte); display: grid; place-items: center; cursor: pointer; }
#personas .ps-barres { display: grid; gap: 3px; padding: 3px 0 2px; }
#personas .ps-barres i { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--texte) var(--p), var(--carte) var(--p)); }

/* Cartes : les Persona, les emplacements d'une Factory. */
#personas .ps-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
#personas .ps-item { display: grid; gap: 3px; min-width: 0; padding: 11px 12px 10px; border: 0; border-radius: 12px; background: var(--surface); color: var(--texte); text-align: left; cursor: pointer; }
#personas .ps-item:hover, #personas .ps-puce:hover, #personas .ps-tuile:hover { box-shadow: inset 0 0 0 1px var(--bord); }
#personas .ps-item-nom { font-size: 13px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#personas .ps-item-nom em { margin-left: 4px; font-style: normal; font-size: 10px; font-weight: 600; color: var(--doux); }
#personas .ps-item-meta { font-size: 11.5px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#personas .ps-vie { display: block; height: 3px; margin-top: 4px; border-radius: 2px; background: var(--carte); overflow: hidden; }
#personas .ps-vie i { display: block; height: 100%; border-radius: 2px; background: var(--texte); }
#personas .ps-vie.basse i { background: var(--doux); }
#personas .ps-attente { height: 64px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px dashed var(--bord); }

/* Pastilles, échanges. */
#personas .ps-puces { display: flex; flex-wrap: wrap; gap: 6px; }
#personas .ps-puce { padding: 5px 11px; border: 0; border-radius: 8px; background: var(--surface); color: var(--texte); font-size: 12.5px; cursor: pointer; }
#personas .ps-puce.actif { background: var(--texte); color: var(--surface); font-weight: 600; box-shadow: none; }
#personas .ps-echanges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#personas .ps-echange { display: grid; gap: 6px; padding: 10px; border-radius: 12px; background: var(--surface); }
#personas .ps-echange > div { display: grid; gap: 3px; padding: 7px 8px; border-radius: 8px; }
#personas .ps-echange .moi { width: 55%; background: var(--carte); }
#personas .ps-echange .ia { width: 80%; justify-self: end; border: .5px solid var(--bord); }
#personas .ps-echange b { font-size: 9px; font-weight: 650; color: var(--doux); }
#personas .ps-echange i { height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--texte) 14%, transparent); }
#personas .ps-echange i:last-child { width: 60%; }

/* Rangs : consignes, achats. */
#personas .ps-rangs { margin: 0; padding: 0; list-style: none; }
#personas .ps-principal .ps-rangs { padding: 2px 12px; border-radius: 12px; background: var(--surface); }
#personas .ps-rangs li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 12.5px; color: var(--texte); }
#personas .ps-rangs li > span:first-child:not(.ps-icone) { flex: 1; }
#personas .ps-rangs li + li { border-top: .5px solid var(--bord); }
#personas .ps-rang-texte { flex: 1; min-width: 0; display: grid; gap: 1px; }
#personas .ps-rang-texte b { font-size: 12.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#personas .ps-rang-texte small { font-size: 11px; color: var(--doux); }

/* Le panneau de droite : blanc, parties séparées d'un filet. */
#personas .ps-cote { position: sticky; top: 0; display: flex; flex-direction: column; padding: 4px 16px; border-radius: 16px; background: var(--surface); }
#personas .ps-cote-tete, #personas .ps-part { padding: 14px 0; }
#personas .ps-cote-tete { display: block; }
#personas .ps-part { display: flex; flex-direction: column; gap: 12px; border-top: .5px solid var(--bord); }
#personas .ps-cote-tete h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.018em; color: var(--texte); }
#personas .ps-cote-tete p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--doux); }
#personas .ps-segments { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--carte); }
#personas .ps-segments button { flex: 1; padding: 5px 4px; border: 0; border-radius: 7px; background: transparent; color: var(--doux); font-size: 11.5px; font-weight: 500; cursor: pointer; }
#personas .ps-segments button.actif { background: var(--surface); color: var(--texte); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
#personas .ps-une { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 14px 14px; border-radius: 12px; background: var(--carte); text-align: center; }
#personas .ps-une small { margin-top: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--doux); }
#personas .ps-une b { font-size: 15px; font-weight: 650; letter-spacing: -.015em; color: var(--texte); }
#personas .ps-une p { margin: 0; font-size: 12px; color: var(--doux); }
#personas .ps-une-pied { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--doux); font-variant-numeric: tabular-nums; }
#personas .ps-icone { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; background: var(--carte); color: var(--texte); display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: -.02em; }
#personas .ps-icone.grande { width: 52px; height: 52px; border-radius: 13px; background: var(--texte); color: var(--surface); font-size: 16px; }
#personas .ps-pilule { flex-shrink: 0; padding: 4px 11px; border: 0; border-radius: 980px; background: var(--carte); color: var(--texte); font-size: 11.5px; font-weight: 600; cursor: pointer; }
#personas .ps-pilule.plein { background: var(--texte); color: var(--surface); }
#personas .ps-pilule:hover { opacity: .85; }
#personas .ps-tuiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#personas .ps-tuile { min-height: 64px; padding: 8px; border: 0; border-radius: 10px; background: var(--carte); color: var(--texte); font-size: 11.5px; font-weight: 550; line-height: 1.3; cursor: pointer; }
#personas .ps-questions { margin: 0; padding: 0; list-style: none; }
#personas .ps-questions li + li { border-top: .5px solid var(--bord); }
#personas .ps-questions button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border: 0; background: transparent; color: var(--texte); font-size: 12.5px; font-weight: 550; text-align: left; cursor: pointer; }
#personas .ps-questions button span { color: var(--doux); font-size: 15px; }
#personas .ps-questions button:hover span { color: var(--texte); }
#personas .ps-sources { display: grid; gap: 6px; }
#personas .ps-source { display: flex; gap: 10px; padding: 10px; border-radius: 10px; background: var(--carte); }
#personas .ps-favicon { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--texte); }
#personas .ps-source div { display: grid; gap: 2px; min-width: 0; }
#personas .ps-source small { font-size: 10.5px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#personas .ps-source b { font-size: 12.5px; font-weight: 650; color: var(--texte); }
#personas .ps-source p { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--doux); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#personas .ps-mots { display: flex; flex-wrap: wrap; gap: 4px; }
#personas .ps-mots button { padding: 3px 8px; border: 0; border-radius: 6px; background: var(--carte); color: var(--texte); font-size: 11.5px; cursor: pointer; }
#personas .ps-mots button:hover { background: color-mix(in srgb, var(--texte) 10%, var(--carte)); }

/* Les données réelles de la fiche (F1-F4) : le compte d'une pastille, les échanges lus, le réglage de l'automatique, ce qui
   est su d'une notion. */
#personas .ps-puce em { margin-left: 6px; font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--doux); font-variant-numeric: tabular-nums; }
#personas .ps-puce.actif em { color: color-mix(in srgb, var(--surface) 70%, transparent); }
#personas button.ps-echange { border: 0; color: var(--texte); text-align: left; cursor: pointer; font: inherit; }
#personas button.ps-echange:hover { box-shadow: inset 0 0 0 1px var(--bord); }
#personas .ps-echange span { font-size: 11.5px; line-height: 1.35; color: var(--texte); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#personas .ps-echange .ia span { color: var(--doux); }
#personas .ps-reglage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: -12px; font-size: 12px; color: var(--doux); }
#personas .ps-reglage label { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; }
#personas .ps-reglage select { padding: 3px 6px; border: 0; border-radius: 7px; background: var(--surface); color: var(--texte); font: inherit; font-size: 12px; }
#personas .ps-kpi .ps-barres { padding: 2px 0; }
#personas .ps-sait { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
#personas .ps-sait li { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--doux); }
#personas .ps-sait b { font-weight: 600; color: var(--texte); text-align: right; }

/* La Factory, les Sacs et le Store branchés (F6-F9) : cases à cocher en cartes, champ du nom, ajout d'un fichier, état. */
#personas .ps-nouvelle { border: 1px dashed var(--bord); background: transparent; }
#personas .ps-nouvelle .ps-item-nom { color: var(--doux); }
#personas .ps-coches { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
#personas .ps-coche { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); cursor: pointer; }
#personas .ps-coche:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--texte); }
#personas .ps-coche input { width: auto; flex: none; display: inline-block; margin: 2px 0 0; accent-color: var(--texte); }
#personas .ps-coche span { display: grid; gap: 1px; min-width: 0; }
#personas .ps-coche b { font-size: 12.5px; font-weight: 600; color: var(--texte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#personas .ps-coche small { font-size: 11px; color: var(--doux); }
#personas .ps-champ { display: grid; gap: 6px; max-width: 360px; font-size: 12px; color: var(--doux); }
#personas .ps-champ input { padding: 9px 12px; border: 0; border-radius: 10px; background: var(--surface); color: var(--texte); font: inherit; font-size: 14px; }
#personas .ps-champ input:focus { outline: 1.5px solid var(--texte); }
#personas .ps-tuiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#personas .ps-tuiles-2 .ps-tuile { min-height: 40px; }
#personas .ps-ajout-sac { cursor: pointer; }
#personas .ps-etat { flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--doux); }
#personas .ps-vide a { color: var(--texte); }

/* Étroit : le panneau passe sous la colonne principale. */
@media (max-width: 1100px) { #personas .ps-echanges { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { #personas .ps-mise { grid-template-columns: minmax(0, 1fr); } #personas .ps-cote { position: static; } }
@media (max-width: 560px) { #personas { padding: 16px 16px 32px; } #personas .ps-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } #personas .ps-echanges, #personas .ps-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
