:root {
  --fond: #f6f5f2;
  --texte: #222;
  --bordure: #d6d3cc;
  --carte: #fff;
  --accent: #3b5b8c;
  --ok: #2e7d32;
  --vigilance: #e08a00;
  --danger: #c62828;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, sans-serif; background: var(--fond); color: var(--texte); }
a { color: var(--accent); }
button { font: inherit; padding: .4rem .9rem; cursor: pointer; }

.entete { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1rem;
  background: var(--carte); border-bottom: 1px solid var(--bordure); flex-wrap: wrap; }
.entete nav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.entete nav .actif { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--accent); }
.entete .bientot { color: #999; cursor: default; }
.entete .bientot small { font-size: .7em; }
.deconnexion { margin: 0; }

.panneaux { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem; align-items: start; }
@media (max-width: 900px) { .panneaux { grid-template-columns: 1fr; } }
.panneaux > section { background: var(--carte); border: 1px solid var(--bordure);
  border-radius: 6px; padding: 1rem; min-width: 0; }

.bandeau { padding: .5rem .8rem; border-radius: 4px; border-left: 6px solid var(--bordure); background: #eee; }
.bandeau.ok { background: #e6f4e7; border-color: var(--ok); }
.bandeau.vigilance { background: #fff3dc; border-color: var(--vigilance); }
.bandeau.danger { background: #fde7e7; border-color: var(--danger); }
.desengagee { font-style: italic; border: 1px dashed var(--danger); padding: .6rem; border-radius: 4px; }
.rejete { background: #fff1b8; outline: 2px solid var(--vigilance); border-radius: 2px; }

.message { padding: .6rem .8rem; margin: .5rem 0; border-radius: 8px; max-width: 90%; cursor: pointer; white-space: pre-wrap; }
.message.patient { background: #e3ecf8; margin-left: auto; }
.message.agent { background: #f0efe9; margin-right: auto; }

details.etape { border: 1px solid var(--bordure); border-radius: 4px; margin: .5rem 0; padding: .3rem .6rem; }
details.etape > summary { cursor: pointer; font-weight: 600; }
pre { overflow-x: auto; background: #f3f2ee; padding: .5rem; border-radius: 4px; }

.carte-connexion { max-width: 22rem; margin: 4rem auto; padding: 1.5rem; background: var(--carte);
  border: 1px solid var(--bordure); border-radius: 6px; }
.carte-connexion label, .carte-connexion input, .carte-connexion button { display: block; width: 100%; margin-bottom: .8rem; }
.carte-connexion input { font: inherit; padding: .4rem; }
.erreur { color: var(--danger); font-weight: 600; }
.totaux { color: #555; font-size: .9em; }
ul.rejetes { list-style: none; padding: 0; }
ul.rejetes li { margin: .3rem 0; padding: .2rem .4rem; }

/* Zone de saisie : toute la largeur du panneau. */
#conversation textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  min-height: 4.5em;
}

/* Page Prompts */
.page { max-width: 64rem; margin: 0 auto; padding: 1rem; }
.tableau { border-collapse: collapse; width: 100%; }
.tableau th, .tableau td { text-align: left; padding: .35rem .6rem; border-bottom: 1px solid #ddd; vertical-align: top; }
.tableau tr.active { background: #eef6ee; }
.editeur label { display: block; margin-top: .8rem; font-weight: 600; }
.editeur textarea { width: 100%; font-family: ui-monospace, monospace; }
.editeur input[type=text] { width: 100%; }
.editeur .case { font-weight: normal; }
.aide { color: #555; font-size: .9em; }
.avertissement { background: #fff4d6; border: 1px solid #e0b800; padding: .5rem .8rem; }
.differences { overflow-x: auto; }
.differences table.diff { font-family: ui-monospace, monospace; font-size: .85em; border-collapse: collapse; }
.differences .diff_header { background: #eee; color: #666; padding: 0 .4rem; }
.differences .diff_add { background: #d6f5d6; }
.differences .diff_chg { background: #fff2b3; }
.differences .diff_sub { background: #f8d0d0; }

/* Page Modèles */
.etape-modele { border: 1px solid #ddd; padding: .6rem .9rem; margin-top: 1rem; }
.etape-modele legend { font-weight: 600; }
.etape-modele select, .etape-modele input[type=text] { width: 100%; }
.etape-modele .parametres { display: flex; gap: 1rem; flex-wrap: wrap; }
.etape-modele .parametres label { display: block; font-weight: normal; }
.profil form { display: inline; }

.comparaison td.different { background: #fff2b3; }
.comparaison pre { margin: 0; white-space: pre-wrap; }
.comparaison td.varie { color: #777; }

/* Banc */
.banc { max-width: none; }
.banc-defilement { overflow-x: auto; }
.banc-tableau td, .banc-tableau th { min-width: 16rem; }
.banc-tableau pre { white-space: pre-wrap; max-height: 20rem; overflow-y: auto; font-size: .85em; }
.banc-tableau blockquote { margin: 0; white-space: pre-wrap; }
.cellule.statut-invalide, .cellule.statut-erreur { border-left: 4px solid var(--danger); padding-left: .4rem; }
.annotation { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.annotation textarea { width: 100%; font: inherit; }
.progression progress { width: 12rem; vertical-align: middle; }
.en-ligne { display: inline; }
