:root { --ink: #1c2a26; --mute: #5b6b66; --bg: #f4f7f5; --card: #fff; --accent: #1f5f4a; --line: #d5dfdb; }
@media (prefers-color-scheme: dark) { :root { --ink: #e8efec; --mute: #9db0aa; --bg: #121a17; --card: #1b2622; --accent: #5fc4a0; --line: #2f3d38; } }
* { box-sizing: border-box; }
body { margin: 0; font: 17px/1.45 system-ui, sans-serif; background: var(--bg); color: var(--ink); }
main { max-width: 520px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
header h1 { margin: 0; font-size: 20px; color: var(--accent); }
header p { margin: 2px 0 0; color: var(--mute); font-size: 14px; }
.carte { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.carte h2 { margin: 0 0 8px; font-size: 16px; }
.qr { width: min(300px, 80vw); margin: 8px auto; background: #fff; padding: 6px; border-radius: 8px; }
.qr svg { display: block; width: 100%; height: auto; }
.bouton { display: block; width: 100%; padding: 16px; border-radius: 12px; border: 0; background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; text-decoration: none; text-align: center; }
.bouton.second { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.petit { color: var(--mute); font-size: 14px; }
.equipe { font-size: 15px; color: var(--mute); }
.equipe b { font-size: 28px; color: var(--accent); }
.erreur { color: #b3261e; }

/* ---- application enquêteur */
body.app { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.plein { max-width: 520px; margin: 0 auto; padding: 16px; }
.vue { max-width: 560px; margin: 0 auto; }
#v-accueil, #v-revoir h2 { padding: 16px 16px 0; }
#v-accueil { display: grid; gap: 14px; padding-bottom: 16px; }
#v-revoir h2 { margin: 0; font-size: 18px; }
#onglets { position: fixed; inset: auto 0 0 0; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 1000; }
#onglets button { border: 0; background: none; color: var(--mute); font: inherit; font-weight: 600; padding: 18px 4px; }
#onglets button.on { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.pastille { background: #e08a00; color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 13px; }

#chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; }
#chips button { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 18px;
  padding: 8px 14px; font: inherit; font-weight: 600; }
#chips button small { color: var(--mute); font-weight: 400; margin-left: 4px; }
#chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
#chips button.on small { color: #d8efe6; }
#carte-wrap { height: 30dvh; min-height: 170px; }
#carte { height: 100%; }
#fiche { padding: 10px 12px; display: grid; gap: 10px; }
.adresse { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; touch-action: pan-y; }
.adresse .rang { color: var(--mute); font-size: 14px; }
.adresse .gros { font-size: 28px; line-height: 1.15; font-weight: 700; margin: 4px 0; overflow-wrap: anywhere; }
.adresse .etat { display: inline-block; color: var(--c); font-weight: 600; }
.issues { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.issues button { padding: 13px 4px; border-radius: 12px; border: 2px solid var(--c); background: transparent; color: var(--ink); font: inherit; font-weight: 600; }
.issues button.on { background: var(--c); color: #fff; }
.pas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pas button { padding: 16px 4px; border-radius: 12px; border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 18px; }
.pas button:disabled { opacity: .35; }
.outils { display: flex; justify-content: space-between; gap: 12px; }
.outils a { color: var(--accent); font-weight: 600; padding: 8px 0; }
#liste-box button, .liste button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card);
  border: 0; border-bottom: 1px solid var(--line); padding: 14px 8px; font: inherit; color: var(--ink); }
#liste-box button.on { font-weight: 700; }
#liste-box i, .liste i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.liste { margin-top: 8px; }
.liste small { display: block; color: var(--mute); }
#toast { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); background: #222; color: #fff; border-radius: 10px;
  padding: 12px 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 2000; }
#toast.on { opacity: 1; pointer-events: auto; }
#toast a { color: #8fd9b8; font-weight: 700; margin-left: 8px; }

[hidden] { display: none !important; }
.titre-revoir { align-self: center; font-weight: 700; font-size: 17px; padding: 6px 4px; }
.titre-revoir small { color: var(--mute); font-weight: 400; }
#liste-box h3 { margin: 4px 0; }
#liste-box small { margin-left: auto; color: var(--mute); }
