:root {
  --fond: #f4f6f9; --carte: #fff; --texte: #18222e; --doux: #5b6878; --trait: #d9e0e8;
  --bleu: #1f4e78; --bleu-clair: #e6eef6; --or: #f2a900; --vert: #1b7a43; --vert-fond: #e3f4ea;
  --rouge: #b3261e; --rouge-fond: #fbe9e7; --ambre-fond: #fff4d6;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fond); color: var(--texte); }
a { color: var(--bleu); }
header.barre { background: var(--bleu); color: #fff; padding: .6rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
header.barre a { color: #fff; text-decoration: none; }
header.barre .marque { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
header.barre .marque b { color: var(--or); }
header.barre nav { margin-left: auto; display: flex; gap: 1rem; align-items: center; font-size: .92rem; }
header.barre form { margin: 0; }
header.barre button.lien { background: none; border: 0; color: #fff; font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
main { max-width: 1000px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.4rem; margin: .4rem 0 .8rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
.fil { font-size: .9rem; color: var(--doux); margin-bottom: .2rem; }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.tuile { display: block; background: var(--bleu-clair); border-radius: 8px; padding: .8rem; text-decoration: none; color: var(--texte); border: 1px solid transparent; }
.tuile:hover, .tuile:focus { border-color: var(--bleu); }
.tuile strong { display: block; color: var(--bleu); }
.tuile small, .doux { color: var(--doux); }
.code { font-family: ui-monospace, Consolas, monospace; background: var(--ambre-fond); padding: .1rem .4rem; border-radius: 4px; letter-spacing: .1em; font-weight: 700; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .6rem 0; }
.bouton, button { display: inline-block; background: var(--bleu); color: #fff; border: 1px solid var(--bleu); border-radius: 8px; padding: .55rem .9rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.bouton.clair, button.clair { background: #fff; color: var(--bleu); }
.bouton.danger, button.danger { background: #fff; color: var(--rouge); border-color: var(--rouge); }
button.petit { padding: .35rem .6rem; font-size: .92rem; background: #fff; color: var(--bleu); }
button.petit.discret { border-color: var(--trait); color: var(--doux); font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
form p { margin: 0 0 .8rem; }
form label { display: block; font-weight: 600; margin-bottom: .2rem; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; max-width: 460px; padding: .55rem .6rem; border: 1px solid #aab4c0; border-radius: 8px; font: inherit; background: #fff; color: var(--texte); }
textarea { max-width: 100%; }
.helptext { display: block; color: var(--doux); font-size: .88rem; }
ul.errorlist { color: var(--rouge); margin: 0 0 .3rem; padding-left: 1.1rem; font-size: .92rem; }
ul.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.messages li { padding: .6rem .8rem; border-radius: 8px; background: var(--vert-fond); color: #0f4d29; margin-bottom: .4rem; }
ul.messages li.warning, ul.messages li.info { background: var(--ambre-fond); color: #5c4300; }
.defile { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { border-bottom: 1px solid var(--trait); padding: .4rem .5rem; text-align: center; white-space: nowrap; }
th { background: var(--bleu-clair); color: var(--bleu); font-size: .82rem; white-space: normal; vertical-align: bottom; }
td.nom, th.nom { text-align: left; white-space: normal; }
td.num { color: var(--doux); width: 3rem; }
td.fort { font-weight: 700; }
td.bas { color: var(--rouge); }
.onglets { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .8rem; }
.onglets a { padding: .4rem .8rem; border-radius: 999px; text-decoration: none; border: 1px solid var(--trait); background: #fff; }
.onglets a.actif { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.stats { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .95rem; margin-top: .8rem; }
.stats b { display: block; font-size: 1.2rem; color: var(--bleu); }
.evals { list-style: none; margin: 0; padding: 0; }
.evals li { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .5rem 0; border-bottom: 1px solid var(--trait); }
.evals li:last-child { border: 0; }
.evals .titre { flex: 1 1 220px; }
.evals a.bouton { padding: .35rem .7rem; font-size: .9rem; }

/* Page de saisie */
.outils { position: sticky; top: 0; z-index: 5; background: var(--fond); padding: .5rem 0; }
.ligne-micro { display: flex; gap: .6rem; align-items: stretch; flex-wrap: wrap; }
#micro { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; padding: .7rem 1.1rem; border-radius: 999px; }
#micro .point { width: .9rem; height: .9rem; border-radius: 50%; background: #fff; }
#micro.actif { background: var(--rouge); border-color: var(--rouge); }
#micro.actif .point { animation: pouls 1s infinite; }
@keyframes pouls { 50% { opacity: .25; } }
#form-phrase { flex: 1 1 260px; display: flex; gap: .4rem; }
#form-phrase input { max-width: none; }
.modes { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin: .5rem 0 .2rem; font-size: .95rem; }
.modes label { display: inline-flex; gap: .3rem; align-items: center; font-weight: 500; }
#aide-mode, #entendu { font-size: .88rem; color: var(--doux); margin: .15rem 0; min-height: 1.2em; }
.bandeau { border-radius: 8px; padding: .55rem .8rem; margin-top: .4rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-weight: 600; min-height: 2.6rem; background: var(--bleu-clair); }
.bandeau.ok { background: var(--vert-fond); color: #0f4d29; }
.bandeau.erreur { background: var(--rouge-fond); color: var(--rouge); }
.bandeau.question { background: var(--ambre-fond); color: #5c4300; }
.bandeau span { flex: 1 1 100%; }
.compteurs { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .9rem; margin-top: .4rem; }
.etat.ok { color: var(--vert); } .etat.attente { color: #8a5a00; font-weight: 700; }
#carte-appel { background: var(--bleu); color: #fff; border-radius: 10px; padding: .7rem 1rem; margin-top: .5rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
#carte-appel[hidden] { display: none; }
#appel-nom { font-size: 1.25rem; font-weight: 700; flex: 1 1 200px; }
#appel-note { color: #ffe08a; }
#carte-appel button { background: #fff; color: var(--bleu); padding: .35rem .7rem; }
input.note { width: 5.2rem; text-align: center; padding: .4rem; font-weight: 700; font-size: 1rem; }
input.note.invalide { border-color: var(--rouge); background: var(--rouge-fond); }
tr.courant td { background: #fff7dc; }
tr.flash td { animation: flash 1.2s; }
@keyframes flash { from { background: #b9ecc9; } }
@media (prefers-reduced-motion: reduce) { tr.flash td, #micro.actif .point { animation: none; } }
details { margin-top: .6rem; } summary { cursor: pointer; font-weight: 600; color: var(--bleu); }
@media (max-width: 560px) { main { padding: .7rem; } th, td { padding: .35rem .3rem; } h1 { font-size: 1.2rem; } }
@media print { header.barre, .actions, .onglets, .outils { display: none; } body { background: #fff; } }
tfoot td { font-weight: 700; background: var(--bleu-clair); border-top: 2px solid var(--bleu); }
.reseau { padding: .5rem 1rem; text-align: center; font-weight: 600; font-size: .92rem; }
.reseau.hors { background: var(--ambre-fond); color: #5c4300; }
header.barre button#installer { border: 1px solid #fff; border-radius: 999px; padding: .2rem .7rem; text-decoration: none; }
