:root {
  --fond: #f7f8f7; --carte: #ffffff; --texte: #18211f; --doux: #55625e; --bord: #d9dfdc;
  --accent: #0f766e; --accent-texte: #ffffff;
  --eleve: #b42318; --eleve-fond: #fdecea; --moyen: #9a5b00; --moyen-fond: #fff4e0;
  --faible: #1d6b3a; --faible-fond: #e7f5ec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #111614; --carte: #1a211f; --texte: #e8edeb; --doux: #a3b0ab; --bord: #2c3633;
    --accent: #2dd4bf; --accent-texte: #06201c;
    --eleve: #ff8a80; --eleve-fond: #3a1714; --moyen: #ffc46b; --moyen-fond: #33250c;
    --faible: #7ee2a1; --faible-fond: #12301e;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--bord); background: var(--carte); }
.marque { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); }
.marque span { color: var(--texte); }
.langues { display: flex; gap: 4px; }
.langues button { border: 1px solid var(--bord); background: transparent; color: var(--doux); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.langues button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
main { max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 8px; }
.intro { color: var(--doux); margin: 0 0 20px; }
textarea { width: 100%; padding: 12px; border: 1px solid var(--bord); border-radius: 12px; background: var(--carte); color: var(--texte); font: inherit; resize: vertical; }
textarea:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.aide { font-size: 14px; color: var(--doux); margin: 6px 0 14px; }
#verifier { width: 100%; padding: 14px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-texte); font: inherit; font-weight: 700; cursor: pointer; }
#verifier:disabled { opacity: .6; cursor: progress; }
.resultat { margin-top: 24px; padding: 18px; border-radius: 14px; background: var(--carte); border: 1px solid var(--bord); }
.resultat h2 { font-size: 1rem; margin: 16px 0 6px; }
.resultat ul { margin: 0; padding-left: 20px; }
.resultat li { margin: 4px 0; }
.niveau { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 700; }
.niveau.eleve { background: var(--eleve-fond); color: var(--eleve); }
.niveau.moyen { background: var(--moyen-fond); color: var(--moyen); }
.niveau.faible { background: var(--faible-fond); color: var(--faible); }
.reflexes li::marker { content: "✓  "; color: var(--accent); }
.erreur { margin-top: 16px; color: var(--eleve); }
.conseils { margin-top: 32px; padding: 16px; border-radius: 14px; border: 1px dashed var(--bord); }
.conseils h2 { font-size: 1rem; margin: 0 0 8px; }
.conseils ol { margin: 0; padding-left: 20px; }
footer { text-align: center; color: var(--doux); font-size: 14px; padding: 16px; border-top: 1px solid var(--bord); }
footer p { margin: 4px 0; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Page d'alerte des liens protégés (/l/…) */
.alerte h2 { font-size: 1.1rem; margin: 20px 0 6px; }
.alerte ul { margin: 0; padding-left: 22px; }
.alerte .adresse { font-family: ui-monospace, monospace; word-break: break-all; }
.alerte .retour { margin-top: 24px; padding: 14px; border-radius: 12px; background: var(--carte); border: 1px solid var(--bord); }
.alerte .continuer { margin-top: 18px; font-size: 14px; }
.alerte .continuer a { color: var(--doux); }
.alerte .resultat { margin-top: 0; }
.alerte .resultat h1 { font-size: 1.4rem; }
.alerte .resultat.eleve { background: var(--eleve-fond); border-color: var(--eleve); color: var(--eleve); }
.alerte .resultat.moyen { background: var(--moyen-fond); border-color: var(--moyen); color: var(--moyen); }
.alerte .resultat p { color: var(--texte); margin: 0; }

/* Application web installable : onglets, formulaires, protection */
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.entete { position: sticky; top: 0; z-index: 5; padding-top: calc(12px + env(safe-area-inset-top)); }
.principal { display: block; width: 100%; padding: 14px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-texte); font: inherit; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; }
.principal:disabled { opacity: .6; cursor: progress; }
.secondaire { padding: 10px 14px; border: 1px solid var(--accent); border-radius: 12px; background: transparent; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.resultat .secondaire { margin-top: 16px; width: 100%; }
.discret { border: 0; background: transparent; color: var(--doux); font: inherit; cursor: pointer; padding: 8px; }
.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--carte); border-top: 1px solid var(--bord); padding-bottom: env(safe-area-inset-bottom); }
.onglets a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 10px; color: var(--doux); text-decoration: none; font-size: 12px; }
.onglets a[aria-current] { color: var(--accent); font-weight: 700; }
.onglets svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.champs { display: grid; gap: 14px; }
.champs label { display: grid; gap: 6px; font-size: 15px; font-weight: 600; }
.champs input, .champs select, .champs textarea { width: 100%; padding: 12px; border: 1px solid var(--bord); border-radius: 12px; background: var(--carte); color: var(--texte); font: inherit; font-weight: 400; }
.champs fieldset { border: 1px dashed var(--bord); border-radius: 12px; padding: 12px; display: grid; gap: 12px; margin: 0; }
.champs legend { font-size: 15px; font-weight: 600; padding: 0 6px; }
.message { min-height: 1.4em; margin: 0; }
.message.succes { color: var(--faible); font-weight: 600; }
.message.erreur { color: var(--eleve); }
.suivis { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.suivis li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; }
.suivis li div { display: grid; min-width: 0; }
.suivis strong { font-family: ui-monospace, monospace; }
.suivis .aide { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statut { font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--moyen-fond); color: var(--moyen); }
.statut.valide { background: var(--faible-fond); color: var(--faible); }
.statut.non_retenu, .statut.inconnu, .statut.erreur { background: transparent; color: var(--doux); }
.bloc { margin-top: 20px; padding: 16px; border-radius: 14px; background: var(--carte); border: 1px solid var(--bord); }
.bloc h2 { font-size: 1.1rem; margin: 0 0 8px; }
.bloc h2 + ol, .bloc ol { padding-left: 20px; }
.bloc li { margin: 6px 0; }
.bloc .bouton { margin: 14px 0 8px; }
.bloc h2:not(:first-child) { margin-top: 20px; }
.hote { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hote code { font-size: 15px; padding: 8px 10px; border-radius: 8px; background: var(--fond); border: 1px solid var(--bord); word-break: break-all; }
.installer { max-width: 640px; margin: 12px auto 0; padding: 12px 16px; border-radius: 12px; background: var(--faible-fond); color: var(--texte); display: grid; gap: 8px; }
.installer p { margin: 0; font-size: 15px; }
.installer-actions { display: flex; gap: 8px; justify-content: flex-end; }
.installer-actions button:first-child { padding: 8px 14px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-texte); font: inherit; font-weight: 700; }
[hidden] { display: none !important; }
@media (min-width: 760px) {
  .onglets { left: 50%; right: auto; width: 640px; transform: translateX(-50%); border: 1px solid var(--bord); border-bottom: 0; border-radius: 14px 14px 0 0; }
}

/* Preuves (captures) jointes au signalement */
.champs .ajout-preuve { display: block; text-align: center; font-size: 15px; }
.ajout-preuve:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.preuves .aide { margin: 0; }
.vignettes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vignettes:empty { display: none; }
.vignettes li { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; border: 1px solid var(--bord); background: var(--fond, transparent); }
.vignettes img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignettes button { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff; font: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.champs .ajout-preuve[hidden] { display: none; }
