:root {
  --fond: #f4f5f7;
  --carte: #ffffff;
  --texte: #1c1e21;
  --doux: #55595f;
  --bord: #d5d8dc;
  --accent: #1f5fbf;
  --accent-texte: #ffffff;
  --vert: #1d7a3a;
  --vert-fond: #e3f4e8;
  --rouge: #b42318;
  --rouge-fond: #fde8e6;
  --orange: #9a5b00;
  --orange-fond: #fff1d6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #16181b;
    --carte: #22252a;
    --texte: #eceef1;
    --doux: #a9aeb5;
    --bord: #3a3f46;
    --accent: #5b9bf0;
    --accent-texte: #0d1117;
    --vert: #6fd08c;
    --vert-fond: #173322;
    --rouge: #ff8a80;
    --rouge-fond: #3b1a18;
    --orange: #ffc266;
    --orange-fond: #3a2a10;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 18px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 40rem; margin: 0 auto; padding: 1rem 1rem 2rem; }
h1 { font-size: 1.6rem; margin: 0.5rem 0 1rem; overflow-wrap: anywhere; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }
.carte h2 { margin-top: 0; }
p { margin: 0.4rem 0; }
a { color: var(--accent); }

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  padding: 0.5rem;
  background: var(--carte);
  border-bottom: 1px solid var(--bord);
}
.menu a {
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--texte);
  font-weight: 600;
}
.menu a[aria-current="page"] { background: var(--accent); color: var(--accent-texte); }

.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 0.75rem;
  padding: 1rem;
  margin: 0 0 1rem;
}
.carte.retard { border-left: 6px solid var(--rouge); }
.total { text-align: center; }
.gros { font-size: 2.2rem; font-weight: 700; margin: 0; }
.petit { font-size: 0.9rem; color: var(--doux); }
.aide { font-size: 0.95rem; color: var(--doux); }
ul.aide { padding-left: 1.2rem; margin: 0.4rem 0; }
.montant { font-weight: 700; white-space: nowrap; }
.ligne-titre { display: flex; justify-content: space-between; gap: 1rem; overflow-wrap: anywhere; }

.liste { list-style: none; margin: 0 0 1rem; padding: 0; background: var(--carte);
         border: 1px solid var(--bord); border-radius: 0.75rem; }
.liste li { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
            padding: 0.8rem 1rem; border-top: 1px solid var(--bord); overflow-wrap: anywhere; }
.liste li:first-child { border-top: 0; }
.liste.liens li { padding: 0; }
.liste.liens a { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
                 width: 100%; padding: 0.8rem 1rem; color: var(--texte); text-decoration: none; }
.liste .somme { font-weight: 700; }

.message { padding: 0.8rem 1rem; border-radius: 0.75rem; margin: 0 0 1rem; font-weight: 600; }
.message.ok { background: var(--vert-fond); color: var(--vert); }
.message.erreur { background: var(--rouge-fond); color: var(--rouge); }

.etiquette { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 1rem; font-size: 0.85rem;
             font-weight: 700; white-space: nowrap; }
.etiquette.rouge { background: var(--rouge-fond); color: var(--rouge); }
.etiquette.vert { background: var(--vert-fond); color: var(--vert); }
.etiquette.orange { background: var(--orange-fond); color: var(--orange); }
.etiquette.gris { background: var(--fond); color: var(--doux); border: 1px solid var(--bord); }

label { display: block; font-weight: 600; margin: 0.8rem 0 0.3rem; }
label.choix { font-weight: 400; display: flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; margin: 0; }
input[type="radio"] { width: 1.4rem; height: 1.4rem; }
input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  font: inherit;
  padding: 0.7rem;
  border: 1px solid var(--bord);
  border-radius: 0.5rem;
  background: var(--fond);
  color: var(--texte);
}
textarea { resize: vertical; }

.bouton {
  display: inline-block;
  width: 100%;
  min-height: 3rem;
  margin-top: 0.8rem;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border-radius: 0.6rem;
  border: 2px solid var(--accent);
  background: var(--carte);
  color: var(--accent);
  cursor: pointer;
}
.bouton.plein { background: var(--accent); color: var(--accent-texte); }
.bouton.danger { border-color: var(--rouge); color: var(--rouge); background: var(--carte); }
.bouton.discret { border-color: var(--bord); color: var(--doux); }

footer { max-width: 40rem; margin: 0 auto; padding: 0 1rem 2rem; }
