/* Vigie — habillage. Identité : calme clinique, sarcelle profonde, beaucoup
   d'air. L'utilisateur est un soignant, pas un développeur : aucune donnée
   brute, une hiérarchie nette, des mots français. */

/* Palette « pétrole & ambre ». Les neutres sont franchement froids et sans
   dominante verte — c'est elle qui donnait un air d'hôpital. L'accent est un
   pétrole profond (la vigie, la mer), et le chaud est réservé à ce qui
   demande l'attention : alertes, rétractations, incidents. Tous les petits
   textes sont vérifiés à ≥ 4,5:1 sur leur fond. */
:root {
  --fond: #f4f6f8;
  --cote-fond: #e9edf1;
  --carte: #ffffff;
  --carte-douce: #eef1f5;
  --encre: #16202b;
  --encre-douce: #55616f;
  /* Assez sombre pour tenir ≥ 4,5:1 non seulement sur les cartes blanches
     mais aussi sur le fond plus dense de la barre latérale. */
  --encre-tenue: #5d6a78;
  --accent: #0d5c6a;
  --accent-vif: #0f7385;
  --accent-fond: #dceef1;
  --alerte: #a8571b;
  --alerte-fond: #fbeddd;
  /* Encre posée sur un fond accent/alerte. En sombre, l'accent devient
     CLAIR : du blanc dessus tomberait à 2,4:1 — il faut une encre sombre. */
  --sur-accent: #ffffff;
  --sur-alerte: #ffffff;
  --bord: #d9e0e7;
  --ombre: 0 1px 2px rgba(22, 32, 43, .06), 0 4px 16px rgba(22, 32, 43, .05);
  --ombre-haute: 0 2px 6px rgba(22, 32, 43, .09), 0 12px 32px rgba(22, 32, 43, .11);
  --rayon: 14px;
  --largeur-cote: 264px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f141a;
    --cote-fond: #0a0e13;
    --carte: #182029;
    --carte-douce: #1f2831;
    --encre: #e6ebf0;
    --encre-douce: #9aa8b8;
    --encre-tenue: #808d9c;
    --accent: #4fb3c9;
    --accent-vif: #6bc9dd;
    --accent-fond: #16323b;
    --alerte: #e0a260;
    --alerte-fond: #33261a;
    --sur-accent: #0f141a;
    --sur-alerte: #0f141a;
    --bord: #28323d;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --ombre-haute: 0 2px 6px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
/* Garde-fou : une règle auteur `display:` bat toujours la règle user-agent
   `[hidden] { display: none }`, quelle que soit la spécificité. Sans ce
   !important, un élément portant à la fois `hidden` et une classe qui pose un
   display resterait visible en permanence — et tout le JS qui bascule
   `.hidden` deviendrait silencieusement inopérant. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 16px/1.6 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}
h1 { font-size: 1.65rem; font-weight: 650; letter-spacing: -.015em; margin: 0 0 .4rem; }
h2 { font-size: 1.1rem; font-weight: 650; margin: 1.4rem 0 .5rem; }
.sous-texte { color: var(--encre-douce); font-size: .93rem; margin: .2rem 0 1.3rem; }
.option { color: var(--encre-tenue); font-weight: 400; }
.colonne-etroite { max-width: 640px; }

/* ── ossature ───────────────────────────────────────────────────────────── */

.app { display: flex; min-height: 100vh; }
.zone { flex: 1; min-width: 0; display: flex; flex-direction: column;
        transition: padding-right .18s ease; }
/* Centré dans l'espace disponible : calé à gauche, un grand écran laissait
   tout le flanc droit mort. */
main { flex: 1; max-width: 860px; width: 100%; padding: 2.2rem 1.6rem 3rem;
       margin-inline: auto; }
footer {
  max-width: 860px;
  width: 100%;
  margin-inline: auto;
  padding: 0 1.6rem 2rem;
  color: var(--encre-tenue);
  font-size: .83rem;
}
/* Panneau d'analyse ouvert : le contenu se recentre dans ce qui RESTE,
   au lieu de laisser un trou entre les cartes et le volet. */
@media (min-width: 1200px) {
  body.panneau-ouvert .zone { padding-right: min(480px, 94vw); }
}

/* ── barre latérale ─────────────────────────────────────────────────────── */

.cote {
  width: var(--largeur-cote);
  flex-shrink: 0;
  background: var(--cote-fond);
  border-right: 1px solid var(--bord);
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.cote-tete {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .55rem 1rem;
}
.logo { font-size: 1.3rem; }
img.logo { width: 1.65rem; height: 1.65rem; border-radius: 6px; display: block; }
.nom-app { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; flex: 1; }
.ferme-cote { display: none; border: none; background: none; font-size: 1.1rem;
              color: var(--encre-douce); cursor: pointer; }

.cote-nav { display: flex; flex-direction: column; gap: .15rem; }
.lien {
  font: inherit;
  font-size: .93rem;
  text-align: left;
  border: none;
  background: none;
  color: var(--encre-douce);
  padding: .5rem .6rem;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
}
.lien:hover { background: var(--carte); color: var(--encre); }
.lien.actif { background: var(--accent-fond); color: var(--accent); font-weight: 600; }
.lien .ic { font-size: .95rem; width: 1.2rem; text-align: center; }
.badge {
  margin-left: auto;
  background: var(--alerte);
  color: var(--sur-alerte);
  font-size: .71rem;
  font-weight: 700;
  border-radius: 99px;
  padding: .04rem .42rem;
  min-width: 1.15rem;
  text-align: center;
}
.badge.calme { background: var(--accent); }

/* overflow-y : sans lui, une longue liste de veilles DÉBORDE de sa zone
   flex (min-height 0) et le pied de barre se peint par-dessus (vécu avec
   34 veilles) ; ici la liste scrolle, la navigation et le profil restent. */
.cote-section { margin-top: 1.3rem; flex: 1; min-height: 0;
                overflow-y: auto; scrollbar-width: thin; }
.cote-titre {
  display: flex;
  justify-content: space-between;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--encre-tenue);
  padding: 0 .6rem .45rem;
}
.veille-lien {
  font: inherit;
  font-size: .91rem;
  text-align: left;
  border: none;
  background: none;
  color: var(--encre-douce);
  padding: .42rem .6rem;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
}
.veille-lien:hover { background: var(--carte); color: var(--encre); }
.veille-lien.actif { background: var(--accent-fond); color: var(--accent); font-weight: 600; }
.veille-lien .nom {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.veille-lien.pause .nom { opacity: .55; font-style: italic; }
.ajouter {
  font: inherit;
  font-size: .91rem;
  width: 100%;
  text-align: left;
  margin-top: .5rem;
  padding: .45rem .6rem;
  border: 1px dashed var(--bord);
  border-radius: 9px;
  background: none;
  color: var(--encre-douce);
  cursor: pointer;
  display: flex;
  gap: .5rem;
  align-items: center;
}
.ajouter:hover { border-color: var(--accent); color: var(--accent); border-style: solid; }
.ajouter[disabled] { opacity: .45; cursor: not-allowed; }
.quota { font-size: .76rem; color: var(--encre-tenue); padding: .35rem .6rem 0; margin: 0; }
.cote-pied { border-top: 1px solid var(--bord); padding-top: .5rem; margin-top: .5rem; }

.barre-mobile { display: none; }

/* ── boutons et champs ──────────────────────────────────────────────────── */

button {
  font: inherit;
  font-size: .92rem;
  padding: .5rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--bord);
  background: var(--carte);
  color: var(--encre);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
}
button:hover { border-color: var(--accent); color: var(--accent); }
button:active { transform: translateY(1px); }
button.principal {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--sur-accent);
  font-weight: 600;
}
button.principal:hover { background: var(--accent-vif); border-color: var(--accent-vif); color: var(--sur-accent); }
button.discret { border-color: transparent; background: none; color: var(--encre-douce); }
button.discret:hover { color: var(--encre); background: var(--carte-douce); border-color: transparent; }
button.danger:hover { color: var(--alerte); background: var(--alerte-fond); }
button:disabled { opacity: .55; cursor: wait; transform: none; }
.rangee-boutons { display: flex; gap: .6rem; margin: 1.1rem 0; align-items: center; flex-wrap: wrap; }
.rangee-boutons.separee { border-top: 1px solid var(--bord); padding-top: 1.1rem; justify-content: space-between; }
.confirme { color: var(--accent); font-size: .9rem; font-weight: 600; }

textarea, input, select {
  font: inherit;
  width: 100%;
  padding: .65rem .8rem;
  border-radius: 10px;
  border: 1px solid var(--bord);
  background: var(--carte);
  color: var(--encre);
}
textarea { resize: vertical; }
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.champ { display: block; font-size: .88rem; color: var(--encre-douce); margin: .9rem 0; }
.champ input, .champ textarea { margin-top: .3rem; }
.rangee-champ { display: flex; gap: .5rem; margin-top: .3rem; }
.rangee-champ input { flex: 1; }
.rangee-champ button { white-space: nowrap; }
.aide-terme { font-size: .84rem; color: var(--encre-tenue); margin: -.4rem 0 .8rem; }
select { width: auto; padding: .4rem .6rem; font-size: .88rem; }

fieldset {
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  background: var(--carte);
  margin: 1rem 0;
  padding: .9rem 1.1rem;
}
legend { font-weight: 650; font-size: .92rem; padding: 0 .4rem; }
fieldset label, .cases label {
  display: flex;
  gap: .6rem;
  align-items: baseline;
  margin: .55rem 0;
  cursor: pointer;
  font-size: .93rem;
  color: var(--encre-douce);
}
fieldset label strong, .cases label strong { color: var(--encre); font-weight: 600; }
fieldset input[type=radio], fieldset input[type=checkbox],
.cases input { width: auto; accent-color: var(--accent); }
.note-fixe {
  font-size: .85rem;
  color: var(--alerte);
  background: var(--alerte-fond);
  border-radius: 9px;
  padding: .5rem .7rem;
  margin: .8rem 0 0;
}
.cases { display: grid; gap: .1rem; }
.cases.radios { gap: .1rem; }

/* ── écran d'accueil ────────────────────────────────────────────────────── */

.voile {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--fond) 92%, black);
  display: grid;
  place-items: center;
  padding: 1.2rem;
  overflow-y: auto;
}
.modale {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 18px;
  box-shadow: var(--ombre-haute);
  padding: 2rem 2.1rem;
  max-width: 520px;
  width: 100%;
}
.logo-grand { font-size: 2.6rem; display: block; margin-bottom: .4rem; }

/* ── fil d'étapes de l'assistant ────────────────────────────────────────── */

.fil-etapes {
  display: flex;
  gap: .4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.8rem;
  flex-wrap: wrap;
}
.fil-etapes li {
  font-size: .78rem;
  color: var(--encre-tenue);
  display: flex;
  align-items: center;
  gap: .35rem;
}
.fil-etapes li::after { content: "›"; margin-left: .3rem; color: var(--bord); }
.fil-etapes li:last-child::after { content: ""; }
.fil-etapes .puce {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--bord);
  font-weight: 700;
  font-size: .72rem;
}
.fil-etapes .courante { color: var(--accent); font-weight: 650; }
.fil-etapes .courante .puce { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.fil-etapes .faite .puce { background: var(--accent-fond); border-color: var(--accent); color: var(--accent); }

/* ── cartes ─────────────────────────────────────────────────────────────── */

.carte, .comprehension {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.15rem 1.3rem;
  margin: 1rem 0;
}
.comprehension { border-left: 4px solid var(--accent); }

.carte-article {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.1rem 1.3rem;
  margin-bottom: .9rem;
}
.carte-article.alerte { border-left: 4px solid var(--alerte); }
.carte-article.digest { border-left: 4px solid var(--accent); }
.article-tete { display: flex; gap: .5rem; align-items: center; margin-bottom: .45rem; flex-wrap: wrap; }
.origine {
  font-size: .82rem;
  color: var(--accent);
  background: var(--accent-fond);
  border-radius: 99px;
  padding: .16rem .7rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.origine:hover { background: var(--accent); color: var(--sur-accent); }
.article-titre { font-weight: 650; font-size: 1.02rem; line-height: 1.4; margin: 0 0 .3rem; }
.article-source { color: var(--encre-douce); font-size: .85rem; margin-bottom: .55rem; }
.article-source a { color: var(--encre-douce); }
.article-source a:hover { color: var(--accent); }
.accroche {
  font-size: .95rem;
  background: var(--carte-douce);
  border-radius: 10px;
  padding: .6rem .85rem;
  margin: .5rem 0;
}
.accroche::before { content: "→ "; color: var(--accent); font-weight: 700; }

details.analyse { margin-top: .6rem; }
details.analyse summary { cursor: pointer; color: var(--accent); font-size: .9rem; font-weight: 600; }
details.analyse summary:hover { text-decoration: underline; }
.analyse-grille {
  display: grid;
  gap: .7rem;
  margin-top: .8rem;
  padding: .9rem 1rem;
  background: var(--carte-douce);
  border-radius: 10px;
  font-size: .92rem;
}
.analyse-grille .etiquette {
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--encre-tenue);
  margin-bottom: .1rem;
}
.pourquoi {
  color: var(--encre-tenue);
  font-size: .83rem;
  border-top: 1px dashed var(--bord);
  margin-top: .7rem;
  padding-top: .55rem;
}
.pieds-article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  margin-top: .7rem;
  flex-wrap: wrap;
}
/* flex-wrap : quatre boutons (Garder + Utile + Pas pertinent + Masquer) ne
   tiennent pas sur un écran de téléphone — sans repli, toute la page
   défilerait horizontalement. */
/* flex:1 : le groupe occupe toute la ligne (même après repli sous un motif
   long), condition pour que margin-left:auto colle la suppression à droite. */
.feedback { display: flex; gap: .35rem; flex-wrap: wrap; flex: 1 1 auto; }
.feedback button { font-size: .84rem; padding: .32rem .7rem; border-radius: 99px; }
.feedback .actif { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }

.pastille {
  font-size: .78rem;
  border-radius: 99px;
  padding: .16rem .65rem;
  background: var(--carte-douce);
  color: var(--encre-douce);
}
.pastille.accent { background: var(--accent-fond); color: var(--accent); font-weight: 600; }
.pastille.alerte { background: var(--alerte-fond); color: var(--alerte); font-weight: 600; }

/* ── notifications ──────────────────────────────────────────────────────── */

.carte-notif {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-left: 4px solid var(--accent);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.1rem 1.3rem;
  margin-bottom: .9rem;
}
.carte-notif.lue { opacity: .6; border-left-color: var(--bord); box-shadow: none; }
.carte-notif .quand { font-size: .8rem; color: var(--encre-tenue); margin-bottom: .25rem; }
.carte-notif h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.notif-corps { font-size: .94rem; }
.notif-corps p { margin: .5rem 0; }
.notif-corps ul { margin: .5rem 0; padding-left: 1.1rem; }
.notif-corps li { margin: .55rem 0; }
.notif-corps li::marker { color: var(--accent); }
.notif-corps a { color: var(--accent); }
.notif-corps .incident { color: var(--alerte); font-weight: 600; }
.separateur-lues { color: var(--encre-tenue); font-size: .84rem; text-align: center; margin: 1.6rem 0 .9rem; }

/* ── aperçu d'articles (étape 5) ────────────────────────────────────────── */

.apercu {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: .85rem 1rem;
  margin-bottom: .7rem;
}
.apercu .titre-apercu { font-weight: 600; font-size: .96rem; line-height: 1.4; }
.apercu .meta { color: var(--encre-douce); font-size: .83rem; margin-top: .2rem; }
.apercu .choix { display: flex; gap: .4rem; margin-top: .6rem; }
.apercu .choix button { font-size: .84rem; padding: .3rem .75rem; border-radius: 99px; }
.apercu .choix .oui.actif { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.apercu .choix .non.actif { background: var(--alerte); border-color: var(--alerte); color: var(--sur-alerte); }

/* ── divers ─────────────────────────────────────────────────────────────── */

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0; }
.chip {
  font-size: .82rem;
  background: var(--accent-fond);
  color: var(--accent);
  border-radius: 99px;
  padding: .18rem .7rem;
  display: inline-flex;
  gap: .4rem;
  align-items: center;
}
.chip button {
  border: none; background: none; padding: 0; font-size: .9rem;
  color: inherit; cursor: pointer; line-height: 1;
}
.chip button:hover { color: var(--alerte); background: none; }
button.chip.cliquable {
  border: 1px solid transparent;
  text-align: left;
  font-family: inherit;
}
button.chip.cliquable:hover {
  background: var(--accent);
  color: var(--sur-accent);
  border-color: var(--accent);
}
.orcid {
  display: flex;
  gap: .8rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: .88rem;
  background: var(--carte-douce);
  border-radius: 10px;
  padding: .5rem .75rem;
  margin: .4rem 0;
}
.orcid a { color: var(--accent); font-weight: 600; }
.orcid em { color: var(--encre-douce); font-style: normal; }
details.technique { margin: .6rem 0 1rem; }
details.technique summary { cursor: pointer; color: var(--encre-douce); font-size: .86rem; }
details.technique code {
  display: block;
  font-size: .8rem;
  background: var(--carte-douce);
  border-radius: 8px;
  padding: .6rem .8rem;
  margin-top: .4rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.avertissement {
  color: var(--alerte);
  background: var(--alerte-fond);
  border-radius: 10px;
  padding: .55rem .8rem;
  font-size: .88rem;
  margin: .5rem 0;
}
.proposition {
  background: var(--accent-fond);
  color: var(--accent);
  border-radius: 10px;
  padding: .7rem .9rem;
  font-size: .93rem;
  font-weight: 550;
}
.attente { display: flex; align-items: center; gap: .6rem; color: var(--encre-douce); font-style: italic; margin: 1rem 0; }
.pulseur { width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.75); } }
@media (prefers-reduced-motion: reduce) {
  .pulseur { animation: none; }
  html { scroll-behavior: auto; }
}
.vide {
  text-align: center;
  color: var(--encre-douce);
  padding: 3.2rem 1rem;
  border: 1.5px dashed var(--bord);
  border-radius: var(--rayon);
}
.vide .grand { font-size: 2.2rem; margin-bottom: .5rem; }
.panne {
  background: var(--alerte-fond);
  border: 1px solid var(--alerte);
  border-radius: var(--rayon);
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.amorce {
  background: var(--accent-fond);
  border-radius: var(--rayon);
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.amorce-tete { display: flex; align-items: center; gap: .6rem; color: var(--accent); }
.amorce .sous-texte { margin: .4rem 0 .7rem; }
.jauge {
  height: 5px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  overflow: hidden;
}
.jauge-barre {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width .4s ease;
}
.veille-entete { margin-bottom: 1.4rem; }
.veille-reglages { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .8rem 0 .3rem; }
/* ── bibliothèque ───────────────────────────────────────────────────────── */

.lien .compte {
  margin-left: auto;
  font-size: .74rem;
  color: var(--encre-tenue);
  font-variant-numeric: tabular-nums;
}
.lien.actif .compte { color: var(--accent); }
/* Les collections s'alignent sous « Bibliothèque » : le décalage dit
   l'appartenance sans qu'il faille l'écrire. */
.collection-lien {
  padding-left: 1.85rem;
  font-size: .87rem;
}
.collection-lien .ic { font-size: .85rem; width: 1rem; }
.collection-lien .nom {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.biblio-entete { margin-bottom: 1rem; }
.biblio-barre {
  font-size: .85rem;
  color: var(--encre-tenue);
  font-variant-numeric: tabular-nums;
}
.rangee-collections {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 1rem 0 .4rem;
}
button.chip.cliquable.actif {
  background: var(--accent);
  color: var(--sur-accent);
  border-color: var(--accent);
  font-weight: 600;
}
button.chip.ajout {
  background: none;
  border: 1px dashed var(--bord);
  color: var(--encre-tenue);
  cursor: pointer;
  font-family: inherit;
  font-size: .82rem;
  border-radius: 99px;
  padding: .18rem .7rem;
}
button.chip.ajout:hover { border-color: var(--accent); color: var(--accent); }
button.chip.danger {
  background: none;
  border: 1px solid transparent;
  color: var(--encre-tenue);
  cursor: pointer;
  font-family: inherit;
  font-size: .82rem;
  border-radius: 99px;
  padding: .18rem .7rem;
  margin-left: auto;
}
button.chip.danger:hover { color: var(--alerte); background: var(--alerte-fond); }

.panneau-export { margin: .8rem 0 1.4rem; }
.export-corps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 1.1rem 1.2rem;
  margin-top: .6rem;
}
.export-bloc h3 { font-size: .95rem; margin: 0 0 .35rem; }
.export-bloc .rangee-boutons { margin: .6rem 0 0; }
.compte-rendu { margin-bottom: .6rem; }

/* Le marque-page dit un ÉTAT (mis de côté), pas un jugement : il reste plus
   discret que « Utile » / « Pas pertinent », qui eux nourrissent le tri. */
/* Le bouton d'enregistrement vit en haut à droite de la carte : dernier
   enfant de la tête (flex), poussé par margin-left auto. */
.article-tete .marquepage {
  margin-left: auto;
  font-size: .84rem;
  padding: .32rem .7rem;
  border-radius: 99px;
}
.marquepage.actif {
  background: var(--accent-fond);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
/* La suppression est le geste destructeur : à l'écart des 👍/👎, tout au
   bord droit du pied de carte, et discrète tant qu'on ne la vise pas. */
.feedback .supprimer-fil { margin-left: auto; color: var(--encre-douce); }
.feedback .supprimer-fil:hover { color: var(--alerte); border-color: var(--alerte); }

/* ── panneau d'analyse (volet droit) ─────────────────────────────────────── */
.carte-article { cursor: pointer; }
.carte-article.ouverte { border-color: var(--accent); }
.panneau-article {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(480px, 94vw);
  background: var(--carte);
  border-left: 1px solid var(--bord);
  box-shadow: -18px 0 48px rgba(0, 0, 0, .38);
  padding: 1.1rem 1.4rem 2rem;
  overflow-y: auto;
  z-index: 60;
}
.panneau-article .article-titre { margin: .35rem 0 .3rem; }
.panneau-article .analyse-grille { margin-top: .9rem; }
.panneau-article .pourquoi { margin-top: .8rem; }
.panneau-tete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .4rem;
}
.ferme-panneau {
  border: none;
  background: none;
  color: var(--encre-douce);
  font-size: 1.05rem;
  cursor: pointer;
  padding: .3rem .5rem;
}
.ferme-panneau:hover { color: var(--encre); }
.pastille.doux { background: none; border: 1px solid var(--bord); }

.carte-article.gardee { border-left: 4px solid var(--accent-fond); }
.carte-article.gardee.lue { opacity: .72; }
.carte-article.gardee .note {
  margin-top: .5rem;
  font-size: .88rem;
  background: var(--carte-douce);
  border-style: dashed;
  resize: vertical;
}
.carte-article.gardee .note:focus { border-style: solid; background: var(--carte); }
.resume-brut {
  font-size: .88rem;
  color: var(--encre-douce);
  background: var(--carte-douce);
  border-radius: 8px;
  padding: .7rem .85rem;
  margin: .4rem 0 0;
}
.case-lu {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--encre-douce);
  cursor: pointer;
}
.case-lu input { width: auto; accent-color: var(--accent); margin: 0; }
select.ranger {
  /* Largeur FIXE, pas un simple plafond : la largeur intrinsèque d'un select
     suit sa plus longue option (un nom de collection de 80 caractères), et en
     flexbox c'est elle — max-width ignoré — qui fixe le minimum de la rangée.
     Résultat mesuré sans cela : toute la page défilait sur téléphone. */
  width: 15rem;
  max-width: 100%;
  min-width: 0;
  font-size: .82rem;
  padding: .3rem 1.6rem .3rem .7rem;
  border-radius: 99px;
}

/* ── question clinique ──────────────────────────────────────────────────── */

/* L'onglet vedette : c'est la fonctionnalité phare, elle doit se voir dans
   la barre latérale sans crier. */
.lien-vedette {
  background: var(--accent-fond);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 650;
  margin: .35rem 0;
}
.lien-vedette:hover { background: var(--accent); color: var(--sur-accent); }
.lien-vedette.actif { background: var(--accent); color: var(--sur-accent); }

.cote-titre-suite { margin-top: 1.1rem; }

/* La vue Question est un assistant : le fil défile, la saisie vit en bas.
   La colonne s'élargit pour loger l'écran scindé des sources. */
main:has(#vue-question:not([hidden])) {
  max-width: 1600px;
  padding-bottom: 1rem;
}
.zone:has(#vue-question:not([hidden])) footer { display: none; }
/* Trois colonnes sur ordi : la barre latérale (navigation), l'assistant au
   centre, et une bande de notifications à droite — l'œil sur la veille. */
#vue-question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 1.4rem;
  height: calc(100dvh - 3.4rem);
  min-height: 0;
}
.q-colonne {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
/* L'historique des questions vit à droite, comme la barre d'un LLM
   classique : « Nouvelle question » en tête, puis une entrée par question. */
.q-historique {
  overflow-y: auto;
  padding: .2rem .1rem;
  border-left: 1px solid var(--bord);
  padding-left: 1.2rem;
  scrollbar-width: thin;
}
.q-historique .etiquette { margin: .3rem 0 .6rem; }
.q-nouvelle-question {
  display: block;
  width: 100%;
  text-align: left;
  border-style: dashed;
  margin-bottom: .8rem;
}
.q-nouvelle-question.actif {
  border-style: solid;
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.q-hist {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 10px;
  padding: .5rem 1.6rem .5rem .7rem;
  margin: 0 0 .5rem;
  font: inherit;
  cursor: pointer;
}
.q-hist:hover { border-color: var(--accent); }
.q-hist.actif { border-color: var(--accent); background: var(--accent-fond); }
.q-hist-titre {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.4;
}
.q-hist-quand {
  display: block;
  font-size: .74rem;
  color: var(--encre-tenue);
  margin-top: .15rem;
}
.q-hist-fermer {
  position: absolute;
  top: .35rem;
  right: .45rem;
  font-size: .78rem;
  opacity: .55;
  cursor: pointer;
}
.q-hist-fermer:hover { opacity: 1; color: var(--alerte); }
.q-historique-vide { font-size: .84rem; color: var(--encre-tenue); }
/* Écran étroit : l'historique devient une bande horizontale AU-DESSUS de la
   conversation — le perdre couperait l'accès aux questions passées. */
@media (max-width: 1380px) {
  #vue-question { grid-template-columns: minmax(0, 1fr); }
  .q-historique {
    order: -1;
    display: flex;
    gap: .45rem;
    overflow-x: auto;
    overflow-y: hidden;
    border-left: none;
    padding: .1rem .1rem .6rem;
  }
  .q-historique .etiquette,
  .q-hist-quand,
  .q-historique-vide { display: none; }
  .q-nouvelle-question { width: auto; flex-shrink: 0; margin: 0; }
  .q-hist { flex-shrink: 0; max-width: 230px; margin: 0; }
  .q-hist-titre { -webkit-line-clamp: 1; max-width: 180px; }
}
.q-fil {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 .2rem 1rem;
  scroll-behavior: smooth;
}

/* La relance : préciser une question déjà répondue. */
#q-suite-zone { display: flex; justify-content: flex-start; }
#q-suite-zone:not(:empty) { margin-bottom: .45rem; }
.q-suite-bouton { font-size: .82rem; padding: .3rem .8rem; }
.q-suite-actif {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--accent);
  background: var(--accent-fond);
  border: 1px solid var(--accent);
  border-radius: 99px;
  padding: .3rem .8rem;
}
.q-suite-annuler {
  border: none;
  background: none;
  color: inherit;
  padding: 0 .1rem;
  font-size: .8rem;
  cursor: pointer;
}
.q-suite-note {
  display: block;
  border: none;
  background: none;
  font: inherit;
  font-size: .8rem;
  color: var(--encre-tenue);
  padding: 0 .2rem;
  margin: .2rem 0 .35rem;
  text-align: left;
  cursor: pointer;
}
.q-suite-note:hover { color: var(--accent); }

/* Un avis par étude : la source en tête, le constat, la nuance dessous. */
.q-avis {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-left: 4px solid var(--accent-fond);
  border-radius: var(--rayon);
  padding: .85rem 1.05rem;
  margin: .65rem 0;
}
.q-avis-tete {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: .45rem;
}
button.q-avis-source {
  border: none;
  background: none;
  padding: 0;
  font-size: .87rem;
  font-weight: 650;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}
button.q-avis-source:hover { text-decoration: underline; background: none; }
.q-avis-constat { margin: 0; line-height: 1.6; }
.q-avis-nuance {
  margin: .45rem 0 0;
  font-size: .86rem;
  color: var(--encre-douce);
}
/* Les chiffres qui portent la réponse : bande dédiée, chiffres tabulaires. */
.q-chiffres {
  margin: .5rem 0 0;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
  background: var(--accent-fond);
  color: var(--encre);
  border-radius: 8px;
  padding: .4rem .7rem;
  display: inline-block;
}
.q-intention {
  display: flex;
  gap: .6rem;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: .8rem;
}
.q-intention-texte { font-size: .88rem; color: var(--encre-douce); }

/* L'état des lieux : de la prose, presque nue — le texte porte. */
.q-section { margin: 0 0 1.15rem; }
.q-section-titre {
  font-size: 1.02rem;
  font-weight: 650;
  margin: 0 0 .3rem;
}
.q-section-texte { margin: 0; line-height: 1.65; }
.q-section-pied {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: .4rem;
}

/* La fiche de lecture : le verdict méthodologique en triptyque. */
.q-fiche-triptyque {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin-bottom: .9rem;
}
.q-verdict {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 10px;
  padding: .55rem .75rem;
}
.q-verdict-valeur { font-weight: 650; font-size: .95rem; margin-top: .1rem; }
.q-verdict.bon .q-verdict-valeur { color: var(--accent); }
.q-verdict.mauvais .q-verdict-valeur { color: var(--alerte); }
.q-fiche-grille { margin-bottom: .9rem; }
@media (max-width: 700px) {
  .q-fiche-triptyque { grid-template-columns: 1fr; }
}

/* Les exemples de l'accueil : un par intention, cliquables. */
.q-exemples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .6rem;
  margin-top: 1.4rem;
  text-align: left;
}
.q-exemple {
  font: inherit;
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: .65rem .85rem;
  cursor: pointer;
  text-align: left;
}
.q-exemple:hover { border-color: var(--accent); }
.q-exemple-type {
  display: block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .2rem;
}
.q-exemple-texte { font-size: .86rem; color: var(--encre-douce); line-height: 1.45; }
.q-lead .etiquette { margin-bottom: .25rem; }
.q-intro {
  text-align: center;
  max-width: 560px;
  margin: 1.5rem auto 2rem;
  color: var(--encre-douce);
}
.q-intro-logo { font-size: 2.4rem; margin-bottom: .4rem; }
.q-intro h1 { font-size: 1.35rem; }

/* ── les bulles ── */
.q-echange {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin: 1.1rem 0;
}
.bulle {
  max-width: 76%;
  padding: .65rem 1rem;
  border-radius: 16px;
  line-height: 1.55;
  font-size: .97rem;
}
.bulle.moi {
  align-self: flex-end;
  background: var(--accent);
  color: var(--sur-accent);
  border-bottom-right-radius: 5px;
}
.bulle.vigie {
  align-self: flex-start;
  background: var(--carte);
  border: 1px solid var(--bord);
  border-bottom-left-radius: 5px;
  box-shadow: var(--ombre);
}
.q-bulle-texte { margin: 0; }
.q-bulle-texte.incident { color: var(--alerte); font-weight: 600; }
.q-bulle-note { margin: .45rem 0 0; font-size: .85rem; color: var(--encre-tenue); }
.q-bulle-actions { margin-top: .55rem; }
.bulle .attente { display: flex; gap: .5rem; align-items: center; }
.q-vif-pico .chips { margin: .5rem 0 0; }
.q-detail {
  margin-top: .4rem;
  border-top: 1px solid var(--bord);
  padding-top: .9rem;
}

/* ── la barre de saisie ── */
.q-zone-barre { flex-shrink: 0; padding-top: .4rem; }
#q-conseil-zone .avertissement { margin: .3rem 0 .5rem; }
.q-barre {
  display: flex;
  gap: .6rem;
  align-items: flex-end;
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 18px;
  padding: .5rem .55rem .5rem 1.05rem;
  box-shadow: var(--ombre-haute);
}
.q-barre textarea {
  border: none;
  background: none;
  resize: none;
  padding: .4rem 0;
  max-height: 150px;
  font-size: 1rem;
  line-height: 1.5;
}
.q-barre textarea:focus { outline: none; box-shadow: none; }
button.q-envoyer {
  border-radius: 13px;
  padding: .5rem .85rem;
  font-size: 1.05rem;
  line-height: 1.2;
  flex-shrink: 0;
}
.q-barre-note {
  font-size: .78rem;
  color: var(--encre-tenue);
  text-align: center;
  margin: .5rem 0 0;
}

.q-scinde {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}
/* Le volet des articles défile pour son propre compte : la réponse reste
   en regard des sources, c'est tout l'intérêt de l'écran scindé. */
.q-droite {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding-right: .2rem;
}

.q-lead {
  font-size: 1.08rem;
  line-height: 1.65;
  background: var(--accent-fond);
  color: var(--encre);
  border-left: 4px solid var(--accent);
  border-radius: var(--rayon);
  padding: 1rem 1.2rem;
  margin-bottom: .8rem;
}
.q-convergence { font-size: .88rem; color: var(--encre-douce); margin: .2rem 0 1rem; }
.q-convergence.partage, .q-convergence.insuffisant { color: var(--alerte); font-weight: 600; }

.q-ref {
  font-size: .74rem;
  font-weight: 700;
  min-width: 1.35rem;
  padding: .05rem .3rem;
  margin: 0 .1rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent-fond);
  color: var(--accent);
  cursor: pointer;
  vertical-align: super;
  line-height: 1.2;
}
.q-ref:hover { background: var(--accent); color: var(--sur-accent); }
/* Un extrait que le code n'a PAS retrouvé dans la source : le signal doit
   être impossible à confondre avec une citation vérifiée. */
.q-ref.douteuse {
  border-color: var(--alerte);
  background: var(--alerte-fond);
  color: var(--alerte);
  text-decoration: line-through;
}
.pastille.confiance-solide { background: var(--accent-fond); color: var(--accent); font-weight: 600; }
.pastille.confiance-moderee { background: var(--carte-douce); color: var(--encre-douce); font-weight: 600; }
.pastille.confiance-fragile { background: var(--alerte-fond); color: var(--alerte); font-weight: 600; }
.q-noncouvert {
  background: var(--carte-douce);
  border-radius: var(--rayon);
  padding: .7rem 1rem;
  margin: 1rem 0;
  font-size: .92rem;
}

.q-onglets {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: .7rem;
}
.q-onglet {
  font-size: .8rem;
  font-weight: 700;
  padding: .3rem .6rem;
  border-radius: 9px;
  display: inline-flex;
  gap: .35rem;
  align-items: center;
}
.q-onglet-strate { font-weight: 500; font-size: .76rem; color: var(--encre-tenue); }
.q-onglet.actif { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.q-onglet.actif .q-onglet-strate { color: var(--sur-accent); }

.q-article { padding: 1rem 1.2rem; }
.q-article .analyse-grille { margin: .8rem 0; }
.q-resume {
  font-size: .9rem;
  line-height: 1.65;
  color: var(--encre-douce);
  background: var(--carte-douce);
  border-radius: 10px;
  padding: .8rem 1rem;
  white-space: pre-wrap;
}
.q-resume mark.cite {
  background: var(--accent-fond);
  color: var(--encre);
  border-bottom: 2px solid var(--accent);
  padding: .05rem 0;
}
.q-resume mark.appui {
  background: none;
  color: var(--encre);
  border-bottom: 1px dotted var(--encre-tenue);
}
.q-lien-externe {
  font-size: .88rem;
  color: var(--accent);
  align-self: center;
}
.q-pdf {
  width: 100%;
  height: 75vh;
  border: 1px solid var(--bord);
  border-radius: 10px;
  margin-top: .8rem;
  background: var(--carte-douce);
}

@media (max-width: 1050px) {
  .q-scinde { grid-template-columns: 1fr; }
  .q-droite { position: static; max-height: none; overflow: visible; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── petit écran ────────────────────────────────────────────────────────── */

@media (max-width: 820px) {
  .cote {
    position: fixed;
    left: 0; top: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--ombre-haute);
  }
  .cote.ouverte { transform: none; }
  .ferme-cote { display: block; }
  .barre-mobile {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--bord);
    background: var(--carte);
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .barre-mobile button { border: none; background: none; font-size: 1.25rem; padding: .2rem .4rem; }
  .titre-mobile { font-weight: 700; }
  main { padding: 1.4rem 1rem 2.5rem; }
  .rangee-boutons.separee { flex-direction: column-reverse; align-items: stretch; }
  .rangee-boutons.separee button { width: 100%; }
}
