:root{--accent:#154a30;--accent-texte:#154a30;--vert:var(--accent);--accent-clair:#dcebdc;--vert-clair:var(--accent-clair);--jaune:#fff2d4;--bleu:#e3ebf7;--rouge-fond:#fde9e7;--rouge:#a4231d;--ambre:#e8a317;--fond:#f2f4f1;--carte:#fff;--texte:#16241c;--gris:#66736b;--bord:#e0e5e1;--chip:#e1e6e2}
body.sombre{--accent-texte:#8fd1a9;--accent-clair:#1f3a2b;--jaune:#3a3220;--bleu:#1e2a3d;--rouge-fond:#3a1f1d;--rouge:#ff8a80;--fond:#0f1713;--carte:#18231d;--texte:#e8efe9;--gris:#9aa8a0;--bord:#27352d;--chip:#223028}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:system-ui,sans-serif;background:var(--fond);color:var(--texte);padding-bottom:100px}
#app{padding:16px}
h1.titre{font-size:30px;font-weight:800;margin-bottom:14px}
.sur-titre{font-size:13px;color:var(--gris);margin-bottom:2px}
.entete{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.entete h1{font-size:24px}
.retour,.chip-btn{background:var(--chip);color:var(--texte);border:0;border-radius:14px;padding:10px 16px;font-size:14px;font-weight:600}

.hero{background:var(--accent);color:#fff;margin:-16px -16px 16px;padding:18px 18px 22px;border-radius:0 0 28px 28px}
.hero-haut{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.avatar{width:44px;height:44px;border-radius:50%;background:#fff;color:var(--accent);display:grid;place-items:center;font-weight:800}
.ico{position:relative;width:44px;height:44px;border-radius:50%;border:0;background:rgba(255,255,255,.18);color:#fff;font-size:18px}
.ico.contour{border:2px solid #fff;background:none}
.pastille{position:absolute;top:2px;right:2px;min-width:14px;height:14px;border-radius:7px;background:var(--ambre);font-size:9px;display:grid;place-items:center;color:#000;padding:0 3px}
.gros{font-size:56px;font-weight:800;line-height:1}
.hero small{opacity:.85}
.progress{height:8px;border-radius:4px;background:rgba(255,255,255,.2);margin-top:8px;overflow:hidden}
.progress i{display:block;height:100%;background:var(--ambre)}

.actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:16px}
.actions button{padding:20px 16px;border:0;border-radius:18px;background:var(--accent-clair);color:var(--texte);font-size:15px;font-weight:600;text-align:left}
.actions button.j{background:var(--jaune)}
.actions button.b{background:var(--bleu)}
h2.section{font-size:20px;margin:18px 0 10px}
.alerte{border-radius:18px;padding:16px;margin-bottom:10px;background:var(--chip)}
.alerte.rouge{background:var(--rouge-fond)}
.alerte.rouge h3{color:var(--rouge)}
.alerte.jaune{background:var(--jaune)}
.alerte h3{font-size:17px;margin-bottom:4px}
.semaine{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.jour{border-radius:16px;padding:12px;background:var(--accent-clair);font-size:13px}
.jour.j{background:var(--jaune)}
.jour.b{background:var(--bleu)}
.jour b{display:block;margin-bottom:4px;font-size:15px}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px}
.stat{background:var(--carte);border-radius:18px;padding:14px}
.stat small{color:var(--gris)}
.stat b{display:block;font-size:30px}

.carte{background:var(--carte);border-radius:20px;padding:16px;margin-bottom:12px}
.carte h2{font-size:17px;margin-bottom:8px}
.carte.verte{background:var(--accent-clair)}
.photo{height:180px;border-radius:20px;background:var(--accent-clair);color:var(--accent-texte);display:grid;place-items:center;font-weight:700;margin-bottom:12px}
.rond{display:block;width:100%;max-width:240px;aspect-ratio:1;border-radius:50%;object-fit:cover;margin:8px auto 12px}
.rond.petit{width:56px;height:56px;max-width:none;aspect-ratio:auto;margin:0}
.score{display:flex;align-items:center;gap:14px}
.score .nb{font-size:52px;font-weight:800}
.score .nb small{font-size:20px;color:var(--gris)}
.chip{display:inline-block;padding:8px 16px;border-radius:16px;background:var(--accent);color:#fff;font-size:14px;font-weight:600;margin:2px 0}
.chip.clair{background:var(--accent-clair);color:var(--accent-texte)}
.crit{margin-bottom:12px}
.crit div{display:flex;justify-content:space-between;margin-bottom:4px}
.piste{height:6px;border-radius:3px;background:var(--chip);overflow:hidden}
.piste i{display:block;height:100%;background:var(--accent)}

.onglets{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px}
.onglets button{padding:14px;border:0;border-radius:16px;background:var(--chip);color:var(--texte);font-weight:600}
.onglets button.actif{background:var(--accent);color:#fff}
.graph{display:flex;align-items:flex-end;gap:8px;height:170px}
.graph .col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%}
.graph .paire{display:flex;align-items:flex-end;gap:3px;height:140px}
.graph .paire i{width:12px;border-radius:4px 4px 0 0;display:block}
.graph .rec{background:var(--accent)}
.graph .dep{background:var(--ambre)}
.graph small{margin-top:6px;color:var(--gris)}
.legende{display:flex;gap:16px;margin-top:10px;font-size:13px}
.legende span:before{content:"";display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:6px;vertical-align:-1px}
.legende .r:before{background:var(--accent)}
.legende .d:before{background:var(--ambre)}
.duo{display:grid;grid-template-columns:1fr 1fr;gap:10px}

.pastilles{display:flex;gap:12px;margin-top:8px}
.pastilles button{width:44px;height:44px;border-radius:50%;border:3px solid transparent}
.pastilles button.actif{border-color:var(--texte)}
.interrupteur{width:46px;height:28px;accent-color:var(--accent)}

label{display:block;font-size:13px;margin:10px 0 4px;color:var(--gris)}
input,select,textarea{width:100%;padding:12px;border:1px solid var(--bord);border-radius:12px;font-size:15px;background:var(--carte);color:var(--texte)}
.btn{width:100%;padding:14px;border:0;border-radius:16px;background:var(--accent);color:#fff;font-size:16px;font-weight:600;margin-top:12px}
.btn.rouge{background:#c62828}
.ligne{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:1px solid var(--bord)}
.ligne:last-child{border-bottom:0}
.ligne button{background:var(--chip);color:var(--texte);border:0;border-radius:10px;padding:6px 10px}
.badge{padding:3px 10px;border-radius:10px;font-size:12px;background:var(--accent-clair);color:var(--accent-texte)}
.arbre{display:grid;grid-template-columns:1fr 1fr 1fr;grid-template-rows:repeat(4,auto);gap:6px;align-items:center}
.ped{background:var(--carte);border:1px solid var(--bord);border-radius:10px;padding:6px;font-size:11px;text-align:center;color:var(--gris)}
.ped b{color:var(--texte);font-size:13px}
.ped.ok{border-color:var(--accent);background:var(--accent-clair)}
.ped.vide{opacity:.5}

.bottombar{position:fixed;bottom:0;left:0;right:0;display:flex;align-items:flex-end;justify-content:space-around;padding:8px 6px 12px;background:var(--carte);border-top:1px solid var(--bord);z-index:10}
.bottombar button{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;border:0;background:none;color:var(--gris);font-size:11px;font-weight:500;padding:4px 0}
.bottombar button.active{color:var(--accent-texte);font-weight:700}
.bottombar button svg{width:26px;height:26px}
.bottombar .plus{flex:0 0 60px;width:60px;height:60px;border-radius:50%;background:var(--accent);color:#fff;border:5px solid var(--carte);box-shadow:0 3px 10px rgba(0,0,0,.2);justify-content:center;padding:0;transform:translateY(-14px)}
.bottombar .plus.active{color:#fff}
.bottombar .plus svg{width:28px;height:28px}

.ico{display:grid;place-items:center}
.ico svg{width:20px;height:20px}
.etiquette{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--gris);margin:6px 0 10px}
.etiquette-hero{font-size:12px;letter-spacing:.08em;text-transform:uppercase;opacity:.75}
.meteo{font-size:14px;opacity:.9;margin:8px 0 14px}
.meteo svg{width:18px;height:18px;vertical-align:-4px}
.meteo a{color:#fff}
.terrain{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:16px}
.terrain button{display:flex;flex-direction:column;align-items:center;gap:6px;padding:14px 4px;background:var(--carte);border:1px solid var(--bord);border-radius:16px;font-size:12px;font-weight:600}
.terrain svg{width:24px;height:24px}
.terrain .t-v{color:var(--accent-texte)}
.terrain .t-o{color:#c2571a}
.terrain .t-r{color:var(--rouge)}
#splash{position:fixed;inset:0;background:var(--fond);display:grid;place-items:center;z-index:100;transition:opacity .4s}
#splash img{width:110px;height:110px;border-radius:25px}
#splash.cache{opacity:0;pointer-events:none}
.btn.social{display:flex;align-items:center;justify-content:center;gap:10px;background:var(--carte);color:var(--texte);border:1px solid var(--bord);margin-top:10px}
.btn.social svg{width:20px;height:20px}
*,*::before,*::after{box-sizing:border-box}
html,body{max-width:100%;overflow-x:hidden}
img,video,canvas,svg{max-width:100%;height:auto}
input,select,textarea,button{max-width:100%;font-size:16px}
body{min-height:100dvh;-webkit-text-size-adjust:100%}
h1,h2,h3,p,span,div,td,th{overflow-wrap:anywhere}
table{display:block;overflow-x:auto;max-width:100%}
main,#app,.page{width:100%;max-width:640px;margin-inline:auto}
nav,.nav,.barre{padding-bottom:env(safe-area-inset-bottom)}
@media (max-width:360px){
  body{font-size:14px}
  .carte,.card{padding:12px}
}
@media (min-width:768px){
  main,#app,.page{max-width:820px}
}
.rond{width:96px;height:96px;aspect-ratio:1;border-radius:50%;object-fit:cover;flex:none}
.rond.petit{width:48px;height:48px}
.rec-fond{position:fixed;inset:0;background:rgba(15,26,20,.88);z-index:9999;display:flex;align-items:center;justify-content:center;padding:16px}
.rec-boite{background:#fff;border-radius:20px;padding:20px;width:100%;max-width:360px;text-align:center}
.rec-boite h3{margin:0 0 14px}
.rec-zone{position:relative;width:300px;max-width:100%;height:300px;margin:0 auto;background:#16241c;overflow:hidden;border-radius:12px}
.rec-zone canvas{display:block;touch-action:none}
.rec-masque{position:absolute;inset:0;border-radius:50%;box-shadow:0 0 0 600px rgba(15,26,20,.65);border:3px solid #fff;pointer-events:none}
.rec-boite input[type=range]{width:100%;margin:18px 0}
.rec-btns{display:flex;gap:10px}
.rec-btns button{flex:1;height:52px;border-radius:16px;border:0;font-weight:700;font-size:16px;background:#e1e6e2;color:#16241c}
.rec-btns .rec-ok{background:#154a30;color:#fff}