<!doctype html><html lang="fr"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>LE TONNEAU — Visualisez vos problèmes, retrouvez votre équilibre</title><meta name="description" content="LE TONNEAU : identifiez vos difficultés, trouvez des solutions et visualisez votre progression à votre rythme. Premier diagnostic gratuit."><link rel="canonical" href="https://le-tonneau.fr/"><meta property="og:type" content="website"><meta property="og:locale" content="fr_FR"><meta property="og:site_name" content="LE TONNEAU"><meta property="og:title" content="LE TONNEAU — Retrouvez votre équilibre"><meta property="og:description" content="Identifiez vos difficultés, trouvez des solutions et visualisez vos progrès. Essayez votre premier diagnostic gratuitement."><meta property="og:url" content="https://le-tonneau.fr/"><meta property="og:image" content="https://le-tonneau.fr/partage-le-tonneau.png"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="LE TONNEAU — Retrouvez votre équilibre"><meta name="twitter:description" content="Visualisez vos difficultés et vos progrès. Premier diagnostic gratuit."><meta name="twitter:image" content="https://le-tonneau.fr/partage-le-tonneau.png"><style>.item.no-problem{background:#f0f8f5}.item.no-problem .problem{border-color:#8fbe9b}.item.no-problem .idx{color:#36875e}.item.no-problem .progress,.item.no-problem .initial{opacity:.5}</style><style>
:root{font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;color:#30291f;background:#f5f1e9}*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button{cursor:pointer}.mast{background:linear-gradient(110deg,#251d17,#49301e);color:#fff;padding:23px max(22px,calc((100vw - 1350px)/2));display:flex;align-items:center;justify-content:space-between;gap:16px}.brand{font-family:Georgia,serif;letter-spacing:.15em;font-size:29px}.strap{font-size:12px;color:#e0c5a2;margin-top:4px}.version{font-size:11px;letter-spacing:.12em;border:1px solid #a58664;border-radius:30px;padding:9px 13px;white-space:nowrap}main{max-width:1350px;margin:auto;padding:27px 20px 45px}.intro{display:flex;justify-content:space-between;align-items:center;gap:15px;flex-wrap:wrap;margin-bottom:21px}.intro h1{font-family:Georgia,serif;font-size:27px;margin:0 0 7px}.sub{font-size:13px;color:#857767;line-height:1.55}.actions{display:flex;flex-wrap:wrap;gap:8px}button.action{background:#76502f;color:white;border:0;border-radius:9px;padding:11px 13px;font-weight:650;font-size:12px}button.action.alt{background:#fff;border:1px solid #d9cbb8;color:#594530}.layout{display:grid;grid-template-columns:minmax(680px,1.3fr) minmax(410px,1fr);gap:18px;align-items:start}.card{background:#fff;border:1px solid #e9dfd1;border-radius:17px;box-shadow:0 9px 28px #3b2b1710;padding:23px}.card h2{font-size:17px;margin:0 0 7px}.person{display:flex;align-items:center;gap:12px;margin:19px 0}.person label{font-size:12px;font-weight:750}.person input,.item input{border:1px solid #e0d5c7;border-radius:7px;padding:9px 10px;min-width:0;width:100%;background:#fff;color:#30291f}.person input{max-width:290px}.itemhead,.item{display:grid;grid-template-columns:20px minmax(110px,1fr) minmax(135px,1.3fr) 112px 164px;gap:7px;align-items:center}.itemhead{font-size:10px;text-transform:uppercase;letter-spacing:.07em;color:#9a8b79;margin:8px 0 6px}.item{border-top:1px solid #f1eae0;padding:6px 0}.idx{color:#a18e77;font-size:11px}.choices{display:flex;gap:4px}.choice{min-width:25px;height:30px;padding:0 3px;background:#f4efe8;border:1px solid transparent;border-radius:6px;color:#786958;font-size:12px}.choice.active{color:white;background:#76502f;box-shadow:0 2px 8px #76502f33}.choice:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid #c99c64;outline-offset:2px}.metrics{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:17px}.metric{background:#f6f1e9;border-radius:11px;padding:13px}.metric .big{font-size:25px;font-weight:780;color:#674729}.metric .small{font-size:11px;color:#867663;margin-top:2px}.priority{background:#fff7ed;border-left:3px solid #b17b46;padding:11px 13px;margin-top:12px;font-size:12px;line-height:1.55;border-radius:4px}.viz{text-align:center;overflow:hidden}.viz svg{width:100%;max-width:560px;display:block;margin:4px auto 0}.viz h2{margin-bottom:4px}.waternote{font-size:12px;color:#796c5d}.status{font-size:20px;font-family:Georgia,serif;color:#4e3724;margin-top:1px}.statusinfo{font-size:12px;color:#8b7b69;margin-top:6px;line-height:1.5}.legend{display:flex;justify-content:center;flex-wrap:wrap;gap:13px;margin-top:15px;font-size:11px;color:#6c6054}.dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:5px;background:var(--color)}.note{background:#f5f0e8;border-radius:10px;padding:12px;margin-top:15px;text-align:left;font-size:12px;color:#6d5e4c;line-height:1.5}.history{margin-top:18px}.snapshot{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #f0e8dd;padding:12px 0;gap:12px;font-size:12px}.snapshot button{border:1px solid #dfd3c4;background:#fff;border-radius:7px;padding:8px;color:#6a4a30;white-space:nowrap}.foot{text-align:center;color:#9b8b79;font-size:11px;margin-top:20px}@media(max-width:950px){.layout{grid-template-columns:1fr}.mast{padding:20px}.card{padding:16px}}@media(max-width:430px){main{padding:18px 10px}.itemhead,.item{grid-template-columns:20px minmax(110px,1fr) minmax(135px,1.3fr) 112px 164px;gap:6px}.choice{width:27px}.brand{font-size:22px}.version{font-size:9px;padding:7px}}
.waterbar{height:10px;background:#e9e0d5;border-radius:20px;overflow:hidden;margin:13px auto 5px;max-width:350px}.waterbar>div{height:100%;width:25%;background:linear-gradient(90deg,#357a9a,#74cce6);border-radius:20px;transition:width .55s ease}.barlabel{font-size:11px;color:#84725f}.barlabel b{color:#416c7c}.viz svg{filter:drop-shadow(0 13px 14px #3a231b1c)}#staves path{transition:opacity .35s ease}#liquid rect{transition:all .5s ease}.choice:hover{background:#e7d6c1}.choice.active:hover{background:#76502f}.item input{font-size:12px}.item .solution{background:#fcfaf5}.initial{display:flex;gap:3px}.initial button{min-width:23px;padding:0;height:30px;border-radius:5px;border:1px solid #e6d9c7;background:#f7f3ee;color:#69513a}.initial button.active{background:#7b6654;color:#fff}.progress{display:flex;gap:3px}.progress button{padding:0 4px;min-width:29px;height:30px;border:1px solid #e2d6c7;border-radius:6px;background:#f6f0e8;color:#665744;font-size:11px}.progress button.active{background:#3b7c72;color:#fff;border-color:#3b7c72}.sectionhint{margin:9px 0 0;font-size:11px;color:#8c7764}.itemhead{font-size:9px}.viz{position:sticky;top:12px}@media(max-width:950px){.viz{position:static}.itemhead,.item{min-width:650px}#domains{overflow-x:auto}.itemhead{overflow:hidden}}.note{border:1px solid #e9dac8}.card{background:linear-gradient(155deg,#fff,#fffdfa)}@media print{.mast{background:white;color:#30291f}.actions,.choice,.snapshot button{display:none!important}.layout{display:block}.card{box-shadow:none;break-inside:avoid}.viz svg{max-height:450px}.history{display:none}main{padding:10px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
.profiletabs{display:flex;gap:10px;margin:0 0 22px;flex-wrap:wrap}.profiletab{border:1px solid #d9cbb8;background:#fff;color:#6b5139;padding:15px 25px;border-radius:12px;font-size:15px;font-weight:750;box-shadow:0 4px 14px #3b2b170b}.profiletab.active{background:#674429;color:#fff;border-color:#674429;box-shadow:0 7px 18px #67442933}.profiletab:focus-visible{outline:3px solid #c99c64;outline-offset:2px}.profilehelp{font-size:12px;color:#806f5d;margin:-11px 0 20px}.profiletab .mini{font-size:11px;font-weight:450;display:block;margin-top:4px;opacity:.85}@media print{.profiletabs,.profilehelp{display:none}}
/* V8 : accueil et parcours grand public */
.landing{max-width:1150px;margin:0 auto;padding:45px 20px 75px}.hero{display:grid;grid-template-columns:1.1fr .9fr;gap:35px;align-items:center}.hero h1{font:normal clamp(36px,5vw,65px)/1.08 Georgia,serif;color:#422d20;margin:10px 0 20px}.hero p{color:#746454;line-height:1.7;font-size:16px}.eyebrow{letter-spacing:.18em;color:#8d623c;font-size:12px;font-weight:800}.heroart{background:radial-gradient(circle at 50% 40%,#f5dfb8,#e8d8c2 60%,#cdb79b);border-radius:28px;min-height:340px;display:grid;place-items:center;box-shadow:0 20px 50px #46301c20}.heroart svg{width:85%;max-width:340px}.primary{border:0;background:#694329;color:white;border-radius:12px;padding:16px 24px;font-size:15px;font-weight:800}.secondary{border:1px solid #cbb9a3;background:white;color:#674329;border-radius:12px;padding:14px 20px;font-weight:700}.heroactions{display:flex;gap:10px;flex-wrap:wrap;margin:24px 0}.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-top:45px}.step{background:#fff;border:1px solid #e7d8c5;border-radius:16px;padding:22px}.step strong{color:#694329}.step p{color:#796b5c;line-height:1.5;font-size:13px}.pricing{margin-top:24px;background:#eee4d5;border-radius:20px;padding:26px;display:flex;align-items:center;justify-content:space-between;gap:16px}.pricing h2{font:normal 27px Georgia,serif;margin:0 0 8px}.pricing p{margin:0;color:#736453;font-size:13px}.pricing .price{font:normal 35px Georgia,serif;color:#51341f;white-space:nowrap}.flowbar{max-width:1350px;margin:14px auto 0;padding:12px 20px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;background:#fff8ed;border:1px solid #e9d5b9;border-radius:12px}.flowbar .message{font-size:13px;color:#61452e;line-height:1.5}.flowbar button{background:#fff;border:1px solid #cdb9a2;border-radius:8px;padding:9px 12px;color:#61452e}.modalshade{position:fixed;inset:0;background:#1f1816b9;z-index:50;display:grid;place-items:center;padding:18px}.modal{background:white;border-radius:20px;padding:28px;max-width:480px;width:100%;box-shadow:0 20px 80px #0005}.modal h2{font:normal 30px Georgia,serif;margin:0 0 12px}.modal p{line-height:1.6;color:#6f6255}.modalactions{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}.privacy{font-size:12px;color:#7f7162;line-height:1.6}.hidden{display:none!important}@media(max-width:740px){.hero{grid-template-columns:1fr}.heroart{min-height:260px}.steps{grid-template-columns:1fr}.pricing{align-items:flex-start;flex-direction:column}.landing{padding-top:25px}}
/* V9 : identité bleu & bois, cinq niveaux dont la lamelle absente à 0 %. */
:root{background:#f2f7fb;color:#19344d}.mast{background:linear-gradient(110deg,#0c3154,#175f94)}.brand{letter-spacing:.10em}.strap{color:#d6eafb}.version{border-color:#83b8db}.card{border-color:#d9e6f0;background:#fff;box-shadow:0 9px 26px #143c5c12}.heroart{background:#fff;box-shadow:none;border:1px solid #e7eef4}.hero h1{color:#103b61}.hero p,.step p{color:#58728b}.eyebrow{color:#1678b9}.primary,button.action,.profiletab.active{background:#0875be;color:#fff}.primary:hover,button.action:hover{background:#075f9b}.secondary{color:#0e5b8d;border-color:#a5cbe3}.profiletab{border-color:#bfd9ea;color:#205d88}.profiletab.active{border-color:#0875be;box-shadow:0 7px 18px #0875be33}.step{border-color:#d4e7f3}.step strong{color:#105d91}.pricing{background:#e3f1fb}.pricing h2,.pricing .price{color:#114b79}.flowbar{background:#e9f5ff;border-color:#c5e3f7}.flowbar .message{color:#235b80}.choice.active{background:#0875be}.choice.active:hover{background:#075f9b}.progress button.active{background:#0875be;border-color:#0875be}.metric{background:#edf6fc}.metric .big{color:#125e93}.priority{background:#eef7ff;border-color:#2b91cf}.note{background:#f0f8ff;border-color:#d3e7f6}.waternote{color:#427b9e}.status{color:#194b71}.waterbar>div{background:linear-gradient(90deg,#1679bb,#64c7ed)}.itemhead,.item{grid-template-columns:20px minmax(110px,1fr) minmax(135px,1.3fr) 112px 164px}.item .solution{background:#f8fcff}.sectionhint{background:#edf7ff;border-radius:9px;padding:10px;color:#275e82}.viz svg{max-width:560px}.heroart svg{max-width:490px;width:100%}.landing{max-width:1220px}.hero{grid-template-columns:1fr 1fr}.heroart{min-height:400px}.privacy{color:#48718c}@media(max-width:740px){.hero{grid-template-columns:1fr}.heroart{min-height:310px}}@media print{.mast{background:#fff}}
</style><style>
/* V11 — boîte de confirmation intégrée, indépendante des alertes du navigateur */
#resetDialog[hidden]{display:none!important}
#resetDialog{position:fixed;inset:0;z-index:99999;background:rgba(24,36,48,.55);display:flex;align-items:center;justify-content:center;padding:20px}
#resetDialog .reset-panel{background:white;color:#20334a;width:min(100%,480px);padding:26px;border-radius:18px;box-shadow:0 24px 65px #0004;text-align:left}
#resetDialog h2{margin:0 0 12px;font:700 25px Georgia,serif;color:#164a72}
#resetDialog p{font-size:14px;line-height:1.6;margin:0 0 20px}
#resetDialog .reset-buttons{display:flex;gap:12px;justify-content:flex-end;flex-wrap:wrap}
#resetDialog button{border:0;border-radius:9px;padding:12px 17px;font-weight:700}
#resetCancel{background:#eaf2f8;color:#17456b}
#resetConfirm{background:#ba3d32;color:white}
</style><style>
/* V15 — mise en page adaptée aux petits écrans */
html,body{max-width:100%;overflow-x:clip}
@media(max-width:740px){
.mast{padding:15px 16px;gap:8px}.brand{font-size:21px}.strap{font-size:10px}.version{font-size:9px;padding:6px 8px}
main{padding:14px 12px 35px}.landing{padding:20px 15px 45px}.hero{gap:15px}.hero h1{font-size:clamp(31px,9vw,44px)}.heroart{min-height:0;padding:8px}.heroart svg{max-height:310px}
.intro h1{font-size:23px}.actions{width:100%}.actions button{flex:1 1 135px;min-height:42px}
.layout{display:grid;grid-template-columns:minmax(0,1fr);gap:13px}.card{min-width:0;padding:15px 12px}
.person{flex-wrap:wrap}.person input{max-width:100%}.profiletabs{display:grid;grid-template-columns:1fr 1fr;gap:7px}.profiletab{padding:11px 6px;font-size:12px}
.itemhead{display:none!important}#domains{overflow:visible!important}
.item{min-width:0!important;width:100%;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:9px 10px;border:1px solid #dce7ee;border-radius:12px;margin:10px 0;padding:12px;background:#fff}
.item .idx{grid-column:1/-1;font-weight:800;font-size:12px;color:#1c628d}.item .idx::before{content:'PROBLÈME N° '}
.item .problem{grid-column:1/-1;min-width:0;font-size:16px}.item .solution{grid-column:1/-1;min-width:0;font-size:16px}
.item .initial,.item .progress{min-width:0;display:flex;flex-wrap:wrap;align-content:start;gap:4px}
.item .initial::before,.item .progress::before{display:block;flex-basis:100%;font-size:11px;font-weight:750;color:#45677f;margin-bottom:3px}
.item .initial::before{content:'Ce problème me pèse'}.item .progress::before{content:'Solution réalisée'}
.item .initial button,.item .progress button{min-width:30px;min-height:36px;flex:1 1 auto;font-size:12px}
.metrics{grid-template-columns:1fr 1fr}.metric{padding:10px}.metric .big{font-size:23px}
.viz{position:static}.viz svg{width:100%;height:auto;max-width:100%}.history .snapshot{flex-wrap:wrap}.snapshot button{margin-left:auto}
.flowbar{margin:10px 12px;padding:12px}.flowbar button{width:100%}.pricing{padding:18px}.modal{padding:19px}
}
@media(max-width:360px){.item{grid-template-columns:1fr}.item .initial,.item .progress{grid-column:1/-1}.mast .version{display:none}}
</style><style>@media(max-width:740px){.heroactions button{min-height:48px;touch-action:manipulation}.heroactions{position:relative;z-index:2}.heroart{pointer-events:none}}</style><style>
.mobile-switch{display:none}
@media(max-width:740px){
.mobile-switch{display:flex;position:sticky;top:0;z-index:20;gap:7px;padding:9px 0;background:#f2f7fb}
.mobile-switch button{flex:1;min-height:44px;border-radius:11px;border:1px solid #b6d5e8;background:white;color:#165d89;font-weight:750;font-size:13px}
.mobile-switch button.selected{background:#0875be;color:white;border-color:#0875be}
#mobileSlides.layout{display:flex;gap:0;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-behavior:smooth;overscroll-behavior-x:contain;scrollbar-width:none;align-items:flex-start}
#mobileSlides.layout::-webkit-scrollbar{display:none}
#mobileSlides.layout>.card{flex:0 0 100%;width:100%;min-width:0;scroll-snap-align:start;scroll-snap-stop:always}
#mobileSlides.layout>.viz{position:relative;top:auto}
}
</style><style>
#cloudPanel{position:fixed;right:16px;top:14px;z-index:9000;max-width:min(360px,calc(100vw - 32px));font:14px system-ui,sans-serif;color:#173b57}#cloudToggle{background:#0875be;color:white;border:0;border-radius:20px;padding:10px 15px;box-shadow:0 4px 16px #0002;cursor:pointer}#cloudBox{display:none;background:#fff;border:1px solid #b9d8ec;border-radius:14px;padding:16px;box-shadow:0 10px 35px #0003;margin-top:8px}#cloudBox.open{display:block}#cloudBox input{box-sizing:border-box;width:100%;padding:10px;margin:5px 0 9px;border:1px solid #aac3d3;border-radius:7px}#cloudBox button{padding:9px;margin:3px 4px 3px 0;border:1px solid #8cb7d0;border-radius:8px;background:#e9f5fc;color:#164969;cursor:pointer}#cloudStatus{font-size:12px;margin-top:8px;line-height:1.4}#cloudBox .cloudNote{font-size:12px;color:#536a7b}#cloudBox .cloudHidden{display:none}@media(max-width:740px){#cloudPanel{top:auto;bottom:12px;right:10px}#cloudBox{max-height:65vh;overflow:auto}}
</style><style>
/* V19 — niveaux de gravité lisibles, valeurs 1–4 conservées en stockage */
.itemhead,.item{grid-template-columns:20px minmax(110px,1fr) minmax(135px,1.3fr) 186px 164px}
.item .initial{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;align-content:start}
.item .initial .severity{display:flex;align-items:center;justify-content:flex-start;gap:5px;min-width:0;width:100%;min-height:34px;height:auto;padding:6px 5px;border:1px solid var(--severity-border);border-radius:8px;background:var(--severity-bg);color:var(--severity-color);font-size:11px;font-weight:750;line-height:1.1;white-space:nowrap;transition:box-shadow .15s,transform .15s}
.item .initial .severity-dot{flex:none;width:9px;height:9px;border-radius:50%;background:var(--severity-color)}
.item .initial .severity.active{border-width:2px;box-shadow:0 0 0 2px var(--severity-ring);padding:5px 4px}
.item .initial .severity:focus-visible{outline:3px solid #166eaa;outline-offset:2px}
.item .initial .severity-1{--severity-bg:#e7f4eb;--severity-border:#9ccbad;--severity-color:#307348;--severity-ring:#a5d9b3}
.item .initial .severity-2{--severity-bg:#fff4d6;--severity-border:#e5cc86;--severity-color:#886611;--severity-ring:#ead398}
.item .initial .severity-3{--severity-bg:#fff0df;--severity-border:#e9b98c;--severity-color:#9d561a;--severity-ring:#f2c69e}
.item .initial .severity-4{--severity-bg:#fce8e6;--severity-border:#e4a29e;--severity-color:#a33c35;--severity-ring:#efb4af}
@media(max-width:740px){
.item{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.item .initial{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.item .initial::before{content:'Ce problème me pèse';grid-column:1/-1;flex-basis:auto}
.item .initial .severity{min-width:0;min-height:38px;flex:none;font-size:10px;padding:5px 3px;gap:4px}
.item .initial .severity.active{padding:4px 2px}
.item .initial .severity-dot{width:7px;height:7px}
}
@media(max-width:360px){.item .initial{grid-column:1/-1}.item .initial .severity{font-size:12px}}
</style><style>
/* V20.10 : gravité initiale inversée, 0 = 100%, 1 = 75%, 2 = 50%, 3 = 25%, 4/5 = 0% */
.max-severity-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:5px}
.max-severity-actions button{border:1px solid #9bbdd5;background:#eaf5ff;color:#12537e;border-radius:7px;padding:8px 10px;font-size:12px;font-weight:700;cursor:pointer}
.max-severity-actions button:disabled{opacity:.45;cursor:default}
.max-severity-counter{font-size:11px;color:#506c81}
/* V20: quatre colonnes et cinq carrés */
.itemhead,.item{grid-template-columns:24px minmax(140px,1.2fr) 164px minmax(145px,1.3fr) 164px!important}
.item .initial,.item .progress{display:flex!important;flex-wrap:nowrap!important;align-items:center;gap:5px;min-width:0}
.item .initial::before,.item .progress::before{display:none!important}
.item .square{box-sizing:border-box;display:block;flex:0 0 26px!important;width:26px!important;min-width:26px!important;height:32px!important;min-height:32px!important;padding:0!important;border-radius:5px;border:2px solid #b8c7d2;cursor:pointer;touch-action:manipulation}
.item .square.red{background:#d9413c;border-color:#b52e29}
.item .square.grey{background:#8e99a3;border-color:#77828d}
.item .square.green{background:#25a85c;border-color:#158647}
.item .square.empty{background:#fff;border-color:#c6d1d9}
.item .square:focus-visible{outline:3px solid #096bb3;outline-offset:2px}
@media(max-width:740px){
.mobile-switch{display:none!important}
#mobileSlides.layout{display:block!important;overflow:visible!important}
#mobileSlides.layout>.card{width:100%!important;min-width:0!important}
#mobileSlides.layout>.viz{display:none!important}
#mobileSlides.layout>.card:first-child{display:block!important}
.item{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:8px!important}
.item .idx,.item .problem{grid-column:1/-1}
.item .initial{grid-column:1/-1;grid-row:auto}
.item .solution{grid-column:1/-1;grid-row:auto}
.item .progress{grid-column:1/-1;grid-row:auto}
.item .initial::before,.item .progress::before{display:block!important;flex-basis:100%;font-size:12px;font-weight:750;color:#45677f;margin-bottom:4px}
.item .initial::before{content:'Gravité initiale'}
.item .progress::before{content:'Nouvelle gravité'}
.item .initial,.item .progress{display:flex!important;flex-wrap:wrap!important;gap:5px!important}
.item .initial::before,.item .progress::before{width:100%}
.item .square{flex:0 0 36px!important;width:36px!important;min-width:36px!important;height:40px!important;min-height:40px!important}
body:has(#app:not(.hidden)){padding-bottom:225px}
#v20dock{position:fixed;left:0;right:0;bottom:0;z-index:50;background:#f7fbff;border-top:2px solid #a7c9dc;box-shadow:0 -7px 24px #143c5c28;padding:5px 10px max(7px,env(safe-area-inset-bottom));height:215px;box-sizing:border-box}
#v20dock .viz{display:flex!important;align-items:center;gap:7px;padding:3px 8px!important;height:100%;box-shadow:none;position:static!important}
#v20dock .viz h2{display:none}
#v20dock .viz #scene{height:190px!important;max-height:190px!important;width:50%!important;max-width:200px!important;flex:0 0 50%}
#v20dock .viz .waternote,#v20dock .viz .statusinfo,#v20dock .viz .legend,#v20dock .viz .note{display:none!important}
#v20dock .viz .status{font-size:11px;line-height:1.25;max-height:70px;overflow:hidden}
#v20dock .viz .waterbar{margin:5px 0;width:100%}
#v20dock .viz .barlabel{font-size:11px}
#v20dock .viz{flex-wrap:wrap;align-content:center}
#v20dock .viz #scene{order:0}
#v20dock .viz .status{order:1;flex:1 1 40%;min-width:0}
#v20dock .viz .waterbar{order:2;flex:1 1 45%}
#v20dock .viz .barlabel{order:3;flex:1 1 45%}
#cloudPanel{bottom:225px!important}
}
@media(max-width:740px){body:has(#app.hidden) #v20dock{display:none!important}body:has(#app.hidden){padding-bottom:0!important}}
@media(min-width:741px){#v20dock{display:none!important}}
<style>
.domain-custom-hint{font-size:13px;line-height:1.5;color:#466780;background:#edf7fc;border-left:3px solid #1683b7;border-radius:6px;padding:9px 12px;margin:8px 0 12px}
.domain-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:16px 0 8px}
.add-problem{border:1px solid #1472a2;border-radius:9px;background:#e7f4fc;color:#12557d;padding:12px 16px;font-weight:700;cursor:pointer}
.add-problem[hidden]{display:none}
#domainCount{color:#6c7480;font-size:12px}
.remove-problem{grid-column:1/-1;justify-self:end;background:#fff2ef;border:1px solid #e9c0b6;color:#a3382a;border-radius:7px;padding:7px 11px;font-size:12px;cursor:pointer;margin:4px 0}
@media(max-width:740px){.domain-custom-hint{font-size:12px}.add-problem{min-height:44px}}
</style></head><body><aside id="cloudPanel"><button id="cloudToggle" type="button">☁️ Mon compte</button><div id="cloudBox"><strong>LE TONNEAU · Compte personnel</strong><p class="cloudNote">La sauvegarde en ligne est facultative. Sans compte, vos données restent sur cet appareil.</p><div id="cloudGuest"><label>Adresse e-mail<input id="cloudEmail" type="email" autocomplete="email" placeholder="vous@exemple.fr"></label><label>Mot de passe<input id="cloudPassword" type="password" autocomplete="current-password" placeholder="8 caractères minimum"></label><button id="cloudLogin" type="button">Se connecter</button><button id="cloudSignup" type="button">Créer un compte</button><button id="cloudForgot" type="button">Mot de passe oublié</button></div><div id="cloudMember" class="cloudHidden"><div id="cloudWho"></div><button id="cloudLoad" type="button">Récupérer mes tonneaux</button><button id="cloudPush" type="button">Sauvegarder maintenant</button><button id="cloudLogout" type="button">Se déconnecter</button><p class="cloudNote">La synchronisation est automatique lorsque vous modifiez vos données. Une copie reste sur cet appareil.</p></div><div id="cloudStatus" role="status" aria-live="polite"></div></div></aside><header class="mast"><div><div class="brand">LE TONNEAU</div><div class="strap">Visualisez vos problèmes. Retrouvez votre équilibre.</div></div></header><section id="landing" class="landing"><div class="hero"><div><div class="eyebrow">VOTRE ÉQUILIBRE, À VOTRE RYTHME</div><h1>Et si vous pouviez voir ce qui vous freine ?</h1><p>LE TONNEAU vous aide à identifier vos difficultés, choisir vos solutions et visualiser chaque progrès. Sans coach obligatoire, à votre rythme.</p><div class="heroactions"><button class="primary" id="startFree" type="button">Faire mon premier diagnostic gratuit →</button><button class="secondary" id="resume" type="button">Retrouver mon tonneau</button></div><div class="privacy">✓ Premier diagnostic gratuit ✓ Personnel ou professionnel ✓ Sans carte bancaire pour découvrir</div></div><div class="heroart" aria-hidden="true"><svg id="heroScene" viewbox="0 0 580 570" role="img" aria-label="Tonneau en chêne avec quinze lamelles ajustables, cerclages métalliques, robinet et écoulement d'eau"><defs>
<lineargradient id="hero_body" x1="0" y1="0" x2="1" y2="0"><stop stop-color="#583018"/><stop offset=".14" stop-color="#96582b"/><stop offset=".45" stop-color="#cb8a45"/><stop offset=".75" stop-color="#a7632f"/><stop offset="1" stop-color="#4a291a"/></lineargradient>
<lineargradient id="hero_staveWood" x1="0" y1="0" x2="1" y2="0"><stop stop-color="#5f341d"/><stop offset=".16" stop-color="#b67537"/><stop offset=".47" stop-color="#db9951"/><stop offset=".8" stop-color="#a8622e"/><stop offset="1" stop-color="#63391f"/></lineargradient>
<lineargradient id="hero_metal" x1="0" y1="0" x2="0" y2="1"><stop stop-color="#342f2a"/><stop offset=".18" stop-color="#b8aaa0"/><stop offset=".45" stop-color="#5b5754"/><stop offset=".76" stop-color="#99928b"/><stop offset="1" stop-color="#292725"/></lineargradient>
<lineargradient id="hero_water" x1="0" y1="0" x2="0" y2="1"><stop stop-color="#8bd9ef" stop-opacity=".76"/><stop offset="1" stop-color="#267ba8" stop-opacity=".5"/></lineargradient>
<lineargradient id="hero_brass" x1="0" y1="0" x2="1" y2="0"><stop stop-color="#5b492d"/><stop offset=".35" stop-color="#dfbf76"/><stop offset=".7" stop-color="#917044"/><stop offset="1" stop-color="#4c3b2a"/></lineargradient>
<filter id="hero_shadow"><fegaussianblur stddeviation="9"/></filter>
<filter id="hero_grain" x="0" y="0" width="100%" height="100%"><feturbulence type="fractalNoise" basefrequency=".018 .24" numoctaves="3" seed="8" result="noise"/><fecolormatrix in="noise" type="saturate" values="0"/><fecomponenttransfer><fefunca type="linear" slope=".16"/></fecomponenttransfer><feblend in="SourceGraphic" mode="multiply"/></filter>
<lineargradient id="hero_rim" x1="0" x2="0" y1="0" y2="1"><stop stop-color="#e7b875"/><stop offset=".4" stop-color="#9a542c"/><stop offset="1" stop-color="#442419"/></lineargradient><clippath id="hero_cavity"><path d="M120 171 Q290 130 460 171 L437 478 Q290 510 143 478 Z"/></clippath><clippath id="hero_bodyclip"><path d="M120 171 Q290 137 460 171 Q490 320 438 480 Q290 524 142 480 Q90 320 120 171Z"/></clippath></defs>
<ellipse cx="290" cy="526" rx="186" ry="16" fill="#38251a" opacity=".15" filter="url(#hero_shadow)"/>
<g id="hero_tap"><path d="M281 17 V72 Q281 87 298 87 H333" fill="none" stroke="#594a34" stroke-width="22" stroke-linecap="round"/><path d="M281 17 V72 Q281 87 298 87 H333" fill="none" stroke="url(#hero_brass)" stroke-width="15" stroke-linecap="round"/><rect x="329" y="76" width="33" height="24" rx="5" fill="url(#hero_brass)" stroke="#5b4c35" stroke-width="2"/><path d="M282 48 V25 M258 25 H306" stroke="#6b573c" stroke-width="9" stroke-linecap="round"/><circle cx="282" cy="25" r="7" fill="#d4af70"/><path d="M344 101 C344 121 345 131 344 150" fill="none" stroke="#64c3e7" stroke-width="9" stroke-dasharray="13 8" stroke-linecap="round"><animate attributename="stroke-dashoffset" from="0" to="-21" dur=".7s" repeatcount="indefinite"/></path><path d="M341 102 Q341 126 341 148" fill="none" stroke="#d6f8ff" stroke-width="2" stroke-dasharray="12 9" opacity=".8"><animate attributename="stroke-dashoffset" from="0" to="-21" dur=".7s" repeatcount="indefinite"/></path></g>
<path d="M120 171 Q290 137 460 171 Q490 320 438 480 Q290 524 142 480 Q90 320 120 171Z" fill="url(#hero_body)" stroke="#4c2a19" stroke-width="4"/>
<g id="hero_liquid" clip-path="url(#hero_cavity)"><rect x="105" y="189" width="370" height="331" fill="url(#hero_water)"/><path d="M106 189 Q290 176 474 189" fill="none" stroke="#d4f6ff" stroke-width="5" opacity=".85"/></g><g id="hero_staves" clip-path="url(#hero_bodyclip)"><path d="M118.00 200.90 Q129.00 195.90 141.80 200.90 L141.80 487.50 Q129.00 492.50 118.00 487.50 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.809"/><path d="M123.00 211.90 Q128.00 315 122.00 477.50" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M133.00 212.90 Q128.00 320 136.00 472.50" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="125.00" y="194.90" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M140.90 199.20 Q151.90 194.20 164.70 199.20 L164.70 494.00 Q151.90 499.00 140.90 494.00 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.833"/><path d="M145.90 210.20 Q150.90 315 144.90 484.00" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M155.90 211.20 Q150.90 320 158.90 479.00" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="147.90" y="193.20" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M163.80 197.50 Q174.80 192.50 187.60 197.50 L187.60 499.50 Q174.80 504.50 163.80 499.50 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.858"/><path d="M168.80 208.50 Q173.80 315 167.80 489.50" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M178.80 209.50 Q173.80 320 181.80 484.50" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="170.80" y="191.50" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M186.70 195.80 Q197.70 190.80 210.50 195.80 L210.50 504.00 Q197.70 509.00 186.70 504.00 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.882"/><path d="M191.70 206.80 Q196.70 315 190.70 494.00" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M201.70 207.80 Q196.70 320 204.70 489.00" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="193.70" y="189.80" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M209.60 194.10 Q220.60 189.10 233.40 194.10 L233.40 507.50 Q220.60 512.50 209.60 507.50 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.907"/><path d="M214.60 205.10 Q219.60 315 213.60 497.50" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M224.60 206.10 Q219.60 320 227.60 492.50" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="216.60" y="188.10" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M232.50 192.40 Q243.50 187.40 256.30 192.40 L256.30 510.00 Q243.50 515.00 232.50 510.00 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.931"/><path d="M237.50 203.40 Q242.50 315 236.50 500.00" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M247.50 204.40 Q242.50 320 250.50 495.00" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="239.50" y="186.40" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M255.40 190.70 Q266.40 185.70 279.20 190.70 L279.20 511.50 Q266.40 516.50 255.40 511.50 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.956"/><path d="M260.40 201.70 Q265.40 315 259.40 501.50" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M270.40 202.70 Q265.40 320 273.40 496.50" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="262.40" y="184.70" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M278.30 189.00 Q289.30 184.00 302.10 189.00 L302.10 512.00 Q289.30 517.00 278.30 512.00 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.980"/><path d="M283.30 200.00 Q288.30 315 282.30 502.00" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M293.30 201.00 Q288.30 320 296.30 497.00" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="285.30" y="183.00" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M301.20 190.70 Q312.20 185.70 325.00 190.70 L325.00 511.50 Q312.20 516.50 301.20 511.50 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.956"/><path d="M306.20 201.70 Q311.20 315 305.20 501.50" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M316.20 202.70 Q311.20 320 319.20 496.50" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="308.20" y="184.70" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M324.10 192.40 Q335.10 187.40 347.90 192.40 L347.90 510.00 Q335.10 515.00 324.10 510.00 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.931"/><path d="M329.10 203.40 Q334.10 315 328.10 500.00" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M339.10 204.40 Q334.10 320 342.10 495.00" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="331.10" y="186.40" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M347.00 194.10 Q358.00 189.10 370.80 194.10 L370.80 507.50 Q358.00 512.50 347.00 507.50 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.907"/><path d="M352.00 205.10 Q357.00 315 351.00 497.50" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M362.00 206.10 Q357.00 320 365.00 492.50" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="354.00" y="188.10" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M369.90 195.80 Q380.90 190.80 393.70 195.80 L393.70 504.00 Q380.90 509.00 369.90 504.00 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.882"/><path d="M374.90 206.80 Q379.90 315 373.90 494.00" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M384.90 207.80 Q379.90 320 387.90 489.00" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="376.90" y="189.80" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M392.80 197.50 Q403.80 192.50 416.60 197.50 L416.60 499.50 Q403.80 504.50 392.80 499.50 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.858"/><path d="M397.80 208.50 Q402.80 315 396.80 489.50" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M407.80 209.50 Q402.80 320 410.80 484.50" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="399.80" y="191.50" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M415.70 199.20 Q426.70 194.20 439.50 199.20 L439.50 494.00 Q426.70 499.00 415.70 494.00 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.833"/><path d="M420.70 210.20 Q425.70 315 419.70 484.00" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M430.70 211.20 Q425.70 320 433.70 479.00" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="422.70" y="193.20" width="10" height="4" rx="1.5" fill="#619c6a"/><path d="M438.60 200.90 Q449.60 195.90 462.40 200.90 L462.40 487.50 Q449.60 492.50 438.60 487.50 Z" fill="url(#hero_staveWood)" filter="url(#hero_grain)" stroke="#542d1a" stroke-width="1.8" opacity="0.809"/><path d="M443.60 211.90 Q448.60 315 442.60 477.50" fill="none" stroke="#f7c68b" stroke-width="1.3" opacity=".25"/><path d="M453.60 212.90 Q448.60 320 456.60 472.50" fill="none" stroke="#4b281a" stroke-width="1.2" opacity=".3"/><rect x="445.60" y="194.90" width="10" height="4" rx="1.5" fill="#619c6a"/></g><path d="M120 171 Q290 137 460 171" fill="none" stroke="url(#hero_rim)" stroke-width="7" opacity=".8"/>
<g id="hero_hoops"><path d="M108 257 Q290 287 472 257" fill="none" stroke="#261f1b" stroke-width="22"/><path d="M108 255 Q290 285 472 255" fill="none" stroke="url(#hero_metal)" stroke-width="17"/><path d="M109 265 Q290 295 471 265" fill="none" stroke="#252322" stroke-width="2" opacity=".8"/><path d="M111 419 Q290 461 469 419" fill="none" stroke="#29231e" stroke-width="22"/><path d="M111 417 Q290 459 469 417" fill="none" stroke="url(#hero_metal)" stroke-width="17"/><path d="M112 427 Q290 469 468 427" fill="none" stroke="#272321" stroke-width="2" opacity=".8"/><g fill="#c7b9a3" stroke="#504c48" stroke-width="1"><circle cx="126" cy="261" r="4"/><circle cx="454" cy="261" r="4"/><circle cx="129" cy="424" r="4"/><circle cx="451" cy="424" r="4"/></g></g>
<g id="hero_overflow"></g><g id="hero_drops"></g><text x="290" y="555" text-anchor="middle" fill="#99826a" font-size="12">15 lamelles de chêne · équilibre atteint</text></svg></div></div><div class="steps"><div class="step"><strong>01 · Identifiez</strong><p>Choisissez un tonneau personnel ou professionnel, puis personnalisez vos 15 domaines.</p></div><div class="step"><strong>02 · Trouvez vos solutions</strong><p>Écrivez une action concrète pour chaque difficulté et fixez votre point de départ.</p></div><div class="step"><strong>03 · Progressez</strong><p>Les lamelles remontent selon l'avancement de vos solutions. Retrouvez l'évolution de votre équilibre.</p></div></div><div class="pricing"><div><h2>Découvrez gratuitement. Avancez pour 1 € / mois.</h2><p>Le premier diagnostic est offert. Le suivi, les séances et l'historique feront partie de l'abonnement.</p></div><div class="price">1 € <span style="font-size:15px">/ mois</span></div></div><p class="privacy" style="margin-top:18px">Prototype de démonstration : aucun paiement ni abonnement réel n'est activé. Sans connexion, les données restent sur cet appareil. La sauvegarde en ligne est facultative.</p></section><div id="app" class="hidden"><div class="flowbar"><div class="message" id="flowMessage">Premier diagnostic gratuit : vous pouvez remplir votre tonneau.</div><button id="home">← Accueil</button></div><main><nav class="profiletabs" aria-label="Type de diagnostic"><button class="profiletab active" id="tab-personal" data-profile="personal" aria-pressed="true">◉ Tonneau personnel<span class="mini">Vie et équilibre personnel</span></button><button class="profiletab" id="tab-professional" data-profile="professional" aria-pressed="false">▣ Tonneau professionnel<span class="mini">Travail et activité</span></button></nav><p class="profilehelp">Choisissez votre univers : chaque tonneau conserve ses propres problèmes, solutions et séances.</p><div class="intro"><div><h1><span id="diagnosticTitle">Votre diagnostic personnel</span></h1><div class="sub">15 problèmes et solutions personnalisables. Renseignez un problème, sa solution et son avancement : la lamelle monte en temps réel.</div></div><div class="actions"><button class="action alt" id="reset">Réinitialiser</button><button class="action alt" id="export">Exporter</button><button class="action alt" id="import">Importer</button><input id="importFile" type="file" accept="application/json,.json" hidden><button class="action alt" id="print">Imprimer</button><button class="action" id="save">Enregistrer une séance</button></div></div><nav class="mobile-switch" aria-label="Navigation du diagnostic"><button type="button" id="showDiagnostic" class="selected" aria-pressed="true">✏️ Diagnostic</button><button type="button" id="showBarrel" aria-pressed="false">🪵 Mon tonneau →</button></nav><div class="layout" id="mobileSlides"><section class="card"><h2><span id="domainTitle">Mes domaines de vie</span></h2><p class="domain-custom-hint">✏️ Tous les domaines sont personnalisables : cliquez sur leur nom pour le modifier. Vous pouvez aussi ajouter vos propres problèmes.</p><div class="sub">Choisissez la gravité initiale avec les carrés rouges. Les carrés verts montrent ensuite les améliorations obtenues.</div><div class="person"><label for="client">Prénom</label><input id="client" placeholder="Prénom du participant" autocomplete="off"></div><div class="itemhead"><span>N°</span><span>Problème</span><span>Gravité initiale</span><span>Solution apportée</span><span>Nouvelle gravité</span></div><div id="domains"></div><div class="domain-actions"><button type="button" id="addProblem" class="add-problem">+ Ajouter un problème</button><span id="domainCount" aria-live="polite"></span></div><p class="sectionhint">Les carrés gris indiquent la gravité initiale ; les blancs deviennent verts avec les solutions. Une fois le problème résolu, les cinq carrés sont verts et la lamelle atteint 100 %.</p><div class="metrics"><div class="metric"><div class="big" id="average">—</div><div class="small">Progression des problèmes renseignés</div></div><div class="metric"><div class="big" id="capacity">—</div><div class="small">Point de fuite le plus bas</div></div></div><div class="priority" id="priority"></div></section><section class="card viz"><h2>Le tonneau vivant</h2><div class="waternote">La progression globale est calculée uniquement sur les problèmes renseignés ; l’eau continue de s’échapper par la lamelle la plus basse.</div><svg id="scene" viewbox="0 0 580 570" role="img" aria-label="Tonneau en chêne avec quinze lamelles ajustables, cerclages métalliques, robinet et écoulement d'eau"><defs>
<lineargradient id="body" x1="0" y1="0" x2="1" y2="0"><stop stop-color="#583018"/><stop offset=".14" stop-color="#96582b"/><stop offset=".45" stop-color="#cb8a45"/><stop offset=".75" stop-color="#a7632f"/><stop offset="1" stop-color="#4a291a"/></lineargradient>
<lineargradient id="staveWood" x1="0" y1="0" x2="1" y2="0"><stop stop-color="#5f341d"/><stop offset=".16" stop-color="#b67537"/><stop offset=".47" stop-color="#db9951"/><stop offset=".8" stop-color="#a8622e"/><stop offset="1" stop-color="#63391f"/></lineargradient>
<lineargradient id="metal" x1="0" y1="0" x2="0" y2="1"><stop stop-color="#342f2a"/><stop offset=".18" stop-color="#b8aaa0"/><stop offset=".45" stop-color="#5b5754"/><stop offset=".76" stop-color="#99928b"/><stop offset="1" stop-color="#292725"/></lineargradient>
<lineargradient id="water" x1="0" y1="0" x2="0" y2="1"><stop stop-color="#8bd9ef" stop-opacity=".76"/><stop offset="1" stop-color="#267ba8" stop-opacity=".5"/></lineargradient>
<lineargradient id="brass" x1="0" y1="0" x2="1" y2="0"><stop stop-color="#5b492d"/><stop offset=".35" stop-color="#dfbf76"/><stop offset=".7" stop-color="#917044"/><stop offset="1" stop-color="#4c3b2a"/></lineargradient>
<filter id="shadow"><fegaussianblur stddeviation="9"/></filter>
<filter id="grain" x="0" y="0" width="100%" height="100%"><feturbulence type="fractalNoise" basefrequency=".018 .24" numoctaves="3" seed="8" result="noise"/><fecolormatrix in="noise" type="saturate" values="0"/><fecomponenttransfer><fefunca type="linear" slope=".16"/></fecomponenttransfer><feblend in="SourceGraphic" mode="multiply"/></filter>
<lineargradient id="rim" x1="0" x2="0" y1="0" y2="1"><stop stop-color="#e7b875"/><stop offset=".4" stop-color="#9a542c"/><stop offset="1" stop-color="#442419"/></lineargradient><clippath id="cavity"><path d="M120 171 Q290 130 460 171 L437 478 Q290 510 143 478 Z"/></clippath><clippath id="bodyclip"><path d="M120 171 Q290 137 460 171 Q490 320 438 480 Q290 524 142 480 Q90 320 120 171Z"/></clippath></defs>
<ellipse cx="290" cy="526" rx="186" ry="16" fill="#38251a" opacity=".15" filter="url(#shadow)"/>
<g id="tap"><path d="M281 17 V72 Q281 87 298 87 H333" fill="none" stroke="#594a34" stroke-width="22" stroke-linecap="round"/><path d="M281 17 V72 Q281 87 298 87 H333" fill="none" stroke="url(#brass)" stroke-width="15" stroke-linecap="round"/><rect x="329" y="76" width="33" height="24" rx="5" fill="url(#brass)" stroke="#5b4c35" stroke-width="2"/><path d="M282 48 V25 M258 25 H306" stroke="#6b573c" stroke-width="9" stroke-linecap="round"/><circle cx="282" cy="25" r="7" fill="#d4af70"/><g id="tapStream"><path d="M344 101 C344 121 345 131 344 150" fill="none" stroke="#64c3e7" stroke-width="9" stroke-dasharray="13 8" stroke-linecap="round"><animate attributename="stroke-dashoffset" from="0" to="-21" dur=".7s" repeatcount="indefinite"/></path><path d="M341 102 Q341 126 341 148" fill="none" stroke="#d6f8ff" stroke-width="2" stroke-dasharray="12 9" opacity=".8"><animate attributename="stroke-dashoffset" from="0" to="-21" dur=".7s" repeatcount="indefinite"/></path></g></g>
<path d="M120 171 Q290 137 460 171 Q490 320 438 480 Q290 524 142 480 Q90 320 120 171Z" fill="url(#body)" stroke="#4c2a19" stroke-width="4"/>
<g id="liquid" clip-path="url(#cavity)"></g><g id="staves" clip-path="url(#bodyclip)"></g><path d="M120 171 Q290 137 460 171" fill="none" stroke="url(#rim)" stroke-width="7" opacity=".8"/>
<g id="hoops"><path d="M108 257 Q290 287 472 257" fill="none" stroke="#261f1b" stroke-width="22"/><path d="M108 255 Q290 285 472 255" fill="none" stroke="url(#metal)" stroke-width="17"/><path d="M109 265 Q290 295 471 265" fill="none" stroke="#252322" stroke-width="2" opacity=".8"/><path d="M111 419 Q290 461 469 419" fill="none" stroke="#29231e" stroke-width="22"/><path d="M111 417 Q290 459 469 417" fill="none" stroke="url(#metal)" stroke-width="17"/><path d="M112 427 Q290 469 468 427" fill="none" stroke="#272321" stroke-width="2" opacity=".8"/><g fill="#c7b9a3" stroke="#504c48" stroke-width="1"><circle cx="126" cy="261" r="4"/><circle cx="454" cy="261" r="4"/><circle cx="129" cy="424" r="4"/><circle cx="451" cy="424" r="4"/></g></g>
<g id="overflow"></g><g id="drops"></g><text x="290" y="555" text-anchor="middle" fill="#99826a" font-size="12"><tspan id="staveCount">10 lamelles</tspan> de chêne · 5 niveaux de progression</text></svg><div class="status" id="status"></div><div class="waterbar"><div id="waterbarfill"></div></div><div class="barlabel">Progression globale <b id="barpct">—</b></div><div class="statusinfo" id="statusinfo"></div><div class="legend"><span><i class="dot" style="--color:#c44d3f"></i>25 %</span><span><i class="dot" style="--color:#d68b43"></i>50 %</span><span><i class="dot" style="--color:#dfbd60"></i>75 %</span><span><i class="dot" style="--color:#619c6a"></i>100 %</span></div><div class="note">💧 <b>Deux lectures complémentaires :</b> la <b>progression globale</b> est la moyenne des seules lignes contenant un problème, arrondie à 1 % ; les lignes vides sont exclues du calcul. Le <b>point de fuite</b> reste la lamelle la plus basse, par laquelle l’eau s’échappe. Ainsi, vous visualisez à la fois vos progrès d’ensemble et la priorité à traiter.</div></section></div><section class="card history"><h2>Historique des séances</h2><p class="sub">Comparez vos évaluations au fil du temps. Les séances restent enregistrées sur cet appareil ; la sauvegarde des tonneaux peut être synchronisée via Mon compte.</p><div id="history"></div></section><p class="foot">Version V20.13 · TEST · Sauvegarde Supabase en cours de validation · Ne pas saisir de données sensibles pendant les tests.</p></main></div><div class="modalshade hidden" id="paywall" role="dialog" aria-modal="true" aria-labelledby="payTitle"><div class="modal"><h2 id="payTitle">Continuez votre progression</h2><p>Votre premier diagnostic est gratuit. Pour enregistrer de nouvelles séances et suivre votre évolution, l'offre envisagée est de <strong>1 € par mois</strong>.</p><p class="privacy">Le paiement n'est pas encore disponible dans cette maquette. Vous pouvez activer un accès de démonstration pour tester le suivi, sans paiement.</p><div class="modalactions"><button class="primary" id="demoAccess">Tester le suivi (démo gratuite)</button><button class="secondary" id="closePay">Plus tard</button></div></div></div><div id="celebration" class="celebration" hidden role="dialog" aria-modal="true" aria-labelledby="celebrationTitle">
<div class="celebration-panel"><div class="firework-area" id="fireworkArea" aria-hidden="true"></div>
<div class="celebration-symbol">🏆</div><h2 id="celebrationTitle">Félicitations !</h2>
<p class="celebration-lead">Votre tonneau est plein !</p><p>Vous avez atteint 100 % : tous les problèmes renseignés sont résolus.</p>
<button type="button" id="closeCelebration">Continuer mon parcours</button></div></div>
<style>
.celebration[hidden]{display:none!important}.celebration{position:fixed;inset:0;z-index:9999;background:#0b3157b8;display:grid;place-items:center;padding:18px;overflow:hidden}
.celebration-panel{position:relative;isolation:isolate;background:#fff;border-radius:23px;max-width:480px;width:100%;padding:42px 28px;text-align:center;box-shadow:0 22px 75px #061d38aa;overflow:hidden}
.celebration-symbol{font-size:62px;position:relative}.celebration-panel h2{font:700 34px Georgia,serif;color:#145887;margin:10px 0}.celebration-panel p{color:#46647a;line-height:1.55}.celebration-panel .celebration-lead{font-size:21px;font-weight:750;color:#1379b6}
#closeCelebration{border:0;border-radius:10px;background:#0875be;color:#fff;padding:13px 20px;font-weight:750;margin-top:14px}
.firework-area{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:-1}.confetti-piece{position:absolute;width:9px;height:14px;left:var(--x);top:-25px;background:var(--c);opacity:0;animation:confetti-fall var(--d) ease-in var(--delay) 1 forwards;transform:rotate(var(--r))}
@keyframes confetti-fall{0%{opacity:0;transform:translate(0,-20px) rotate(0)}10%{opacity:1}90%{opacity:1}100%{opacity:0;transform:translate(var(--drift),570px) rotate(750deg)}}
@media(prefers-reduced-motion:reduce){.confetti-piece{animation:none;display:none}}
</style>
<script>
const defaultsPersonal=['Santé','Finances','Famille','Couple','Travail','Stress','Sommeil','Confiance en soi','Vie sociale','Organisation','Énergie','Équilibre de vie','Projets personnels','Environnement','Épanouissement'];
const defaultsProfessional=['Charge de travail','Objectifs professionnels','Gestion du temps','Relations collègues','Relations clients','Communication','Organisation','Compétences','Motivation','Équilibre travail-vie','Leadership','Reconnaissance','Gestion du stress','Évolution de carrière','Conditions de travail'];
const defaults=defaultsPersonal;
const storage='le_tonneau_v8', $=id=>document.getElementById(id),NS='http://www.w3.org/2000/svg';
const safeStorage={getItem(k){try{return window.localStorage.getItem(k)}catch{return null}},setItem(k,v){try{window.localStorage.setItem(k,v)}catch{}}};
function clean(x){const initial=Math.max(0,Math.min(5,Number(x.initial??x.score??0)||0));const raw=Number(x.progress);const baseline=initial===0?100:Math.max(0,(4-initial)*25);return {name:String(x.name||''),solution:String(x.solution||''),initial,progress:initial===0?100:Math.max(baseline,[0,25,50,75,100].includes(raw)?raw:baseline)}}
function fresh(profile){return {client:'',items:(profile==='professional'?defaultsProfessional:defaultsPersonal).slice(0,10).map(name=>({name,solution:'',initial:0,progress:100})),history:[]}}
function normalized(v,profile){if(!v||!Array.isArray(v.items)||v.items.length<10||v.items.length>20)return fresh(profile);return {client:String(v.client||''),items:v.items.map(clean),history:Array.isArray(v.history)?v.history:[]}}
let store;try{store=JSON.parse(safeStorage.getItem(storage))}catch{}
if(!store||!store.profiles){let previous;try{previous=JSON.parse(safeStorage.getItem('le_tonneau_v6'))?.profiles?.personal||JSON.parse(safeStorage.getItem('le_tonneau_v5'))}catch{};const oldV6=(()=>{try{return JSON.parse(safeStorage.getItem('le_tonneau_v6'))}catch{return null}})();store=oldV6?.profiles?oldV6:{active:'personal',profiles:{personal:normalized(previous,'personal'),professional:fresh('professional')}}}
store.profiles.personal=normalized(store.profiles.personal,'personal');store.profiles.professional=normalized(store.profiles.professional,'professional');
if(!['personal','professional'].includes(store.active))store.active='personal';
let state=store.profiles[store.active];
function activate(profile){store.active=profile;state=store.profiles[profile];document.querySelectorAll('.profiletab').forEach(b=>{const selected=b.dataset.profile===profile;b.classList.toggle('active',selected);b.setAttribute('aria-pressed',String(selected))});$('diagnosticTitle').textContent=profile==='personal'?'Votre diagnostic personnel':'Votre diagnostic professionnel';$('domainTitle').textContent=profile==='personal'?'Mes domaines de vie':'Mes domaines professionnels';$('client').value=state.client||'';rows();render();history();save()}
function save(){try{safeStorage.setItem(storage,JSON.stringify(store))}catch{}}
function esc(v){return String(v).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]))}
function el(tag,attrs,parent){const n=document.createElementNS(NS,tag);Object.entries(attrs).forEach(([k,v])=>n.setAttribute(k,v));parent.appendChild(n);return n}
function level(x){return !String(x.name||'').trim()?100:Math.max(0,Math.min(100,Number(x.progress)||0))}
function stats(items){const active=items.filter(x=>String(x.name||'').trim()&&Number(x.initial)>0);return {count:active.length,avg:active.length?Math.round(active.reduce((a,x)=>a+level(x),0)/active.length):0,min:active.length?Math.min(...active.map(level)):100}}
const completionStates={personal:stats(store.profiles.personal.items).count>0&&stats(store.profiles.personal.items).min===100,professional:stats(store.profiles.professional.items).count>0&&stats(store.profiles.professional.items).min===100};
function rows(){
const root=$('domains');root.replaceChildren();
state.items.forEach((item,i)=>{
const row=document.createElement('div');row.className='item';row.classList.toggle('no-problem',!item.name.trim());
const initial=Math.max(0,Math.min(5,Number(item.initial)||0));
const baseline=initial===0?100:Math.max(0,(4-initial)*25);
const progress=Math.max(baseline,Math.min(100,Number(item.progress)||0));
const complete=initial>0&&progress>=100;
const improvements=initial===5?Math.max(0,Math.min(4,Math.round(progress/25))):Math.max(0,Math.min(5-initial,Math.round((progress-baseline)/((100-baseline)/(5-initial)))));
// Sans gravité : cinq carrés verts et lamelle à 100 %. Sinon les gris reflètent la gravité, et la résolution complète donne cinq verts.
const green=new Set(initial===0?[1,2,3,4,5]:complete?[1,2,3,4,5]:initial===5?Array.from({length:improvements},(_,j)=>j+1):Array.from({length:improvements},(_,j)=>initial+j+1));
row.innerHTML=`<span class="idx">${i+1}</span><input class="problem" aria-label="Problème ${i+1}" value="${esc(item.name)}"><div class="initial" role="group" aria-label="Gravité initiale">${[1,2,3,4,5].map(n=>`<button type="button" class="square ${n<=initial?'red':'empty'}" data-initial="${n}" title="Gravité initiale : ${n} sur 5" aria-label="Gravité initiale ${n} sur 5" aria-pressed="${initial===n}"></button>`).join('')}</div><input class="solution" aria-label="Solution apportée ${i+1}" placeholder="Solution apportée" value="${esc(item.solution)}"><div class="progress" role="group" aria-label="Nouvelle gravité">${[1,2,3,4,5].map(n=>`<button type="button" class="square ${green.has(n)?'green':n<=initial?'grey':'empty'}" data-level="${n}" title="${initial===0?'Aucune gravité : lamelle à 100 %':initial===5?'Progression via les boutons Ajouter une amélioration et Annuler':n<=initial?'Gravité initiale (non modifiable ici)':green.has(n)?'Amélioration réalisée : cliquer pour revenir en arrière':'Cliquer pour ajouter une amélioration'}" aria-label="Carré ${n} : ${green.has(n)?'vert':n<=initial?'gris':'blanc'}"></button>`).join('')}</div>${initial===5?`<div class="max-severity-actions"><button type="button" class="improve-max" data-improve-max="1">+ Ajouter une amélioration</button><button type="button" class="undo-max" data-undo-max="1" ${progress<=0?'disabled':''}>Annuler</button><span class="max-severity-counter">${Math.round(progress/25)} / 4 améliorations</span></div>`:''}`;
row.querySelector('.problem').addEventListener('input',e=>{item.name=e.target.value;row.classList.toggle('no-problem',!item.name.trim());save();render()});
row.querySelector('.solution').addEventListener('input',e=>{item.solution=e.target.value;save()});
row.querySelectorAll('[data-initial]').forEach(b=>b.onclick=()=>{item.initial=Number(b.dataset.initial)===item.initial?0:Number(b.dataset.initial);item.progress=item.initial===0?100:Math.max(0,(4-item.initial)*25);save();rows();render()});
row.querySelectorAll('[data-level]').forEach(b=>b.onclick=()=>{
const n=Number(b.dataset.level);
if(initial===0||n<=initial)return; // Sans gravité : aucune solution nécessaire ; les carrés gris restent fixes.
const steps=5-initial;
const current=Math.max(0,Math.min(steps,Math.round((Number(item.progress)-baseline)/((100-baseline)/steps))));
const next=(n<=initial+current)?Math.max(0,current-1):Math.min(steps,current+1);
item.progress=baseline+next*((100-baseline)/steps);
save();rows();render();
});
if(initial===5){
const improve=row.querySelector('[data-improve-max]');
const undo=row.querySelector('[data-undo-max]');
improve.disabled=progress>=100;
improve.onclick=()=>{item.progress=Math.min(100,Math.max(0,Number(item.progress)||0)+25);save();rows();render()};
undo.onclick=()=>{item.progress=Math.max(0,Math.min(100,Number(item.progress)||0)-25);save();rows();render()};
}
if(i>=10){const remove=document.createElement('button');remove.type='button';remove.className='remove-problem';remove.textContent='Supprimer ce problème';remove.setAttribute('aria-label','Supprimer le problème '+(i+1));remove.onclick=()=>{if(!confirm('Supprimer ce problème et ses données ?'))return;state.items.splice(i,1);save();rows();render()};row.appendChild(remove)}
root.appendChild(row);
});
const n=state.items.length;$('domainCount').textContent=n+' / 20 problèmes';$('addProblem').hidden=n>=20;$('addProblem').disabled=n>=20;
}
$('addProblem').onclick=()=>{if(state.items.length>=20)return;state.items.push({name:'',solution:'',initial:0,progress:100});save();rows();render();const inputs=$('domains').querySelectorAll('.problem');const last=inputs[inputs.length-1];if(last){last.focus();last.scrollIntoView({behavior:'smooth',block:'center'})}};
function celebrate(){const dialog=$('celebration'),area=$('fireworkArea');area.replaceChildren();const colors=['#e9b64c','#1683c1','#6dbda4','#f4d77c','#d88755'];for(let i=0;i<70;i++){const p=document.createElement('i');p.className='confetti-piece';p.style.setProperty('--x',(Math.random()*100)+'%');p.style.setProperty('--c',colors[i%colors.length]);p.style.setProperty('--d',(2.1+Math.random()*1.7)+'s');p.style.setProperty('--delay',(Math.random()*.7)+'s');p.style.setProperty('--drift',((Math.random()-.5)*180)+'px');p.style.setProperty('--r',(Math.random()*360)+'deg');area.appendChild(p)}dialog.hidden=false;$('closeCelebration').focus()}
$('closeCelebration').onclick=()=>{$('celebration').hidden=true};$('celebration').addEventListener('click',e=>{if(e.target===$('celebration'))$('celebration').hidden=true});document.addEventListener('keydown',e=>{if(e.key==='Escape')$('celebration').hidden=true});
function render(){const {count,avg,min}=stats(state.items),weak=state.items.filter(x=>String(x.name||'').trim()&&Number(x.initial)>0&&level(x)===min).map(x=>x.name);$('average').textContent=avg+' %';$('capacity').textContent=(100-avg)+' %';$('priority').textContent=count===0?'Aucune gravité sélectionnée : choisissez un problème pour commencer.':min===100?'Toutes les solutions sont terminées : le tonneau peut se remplir entièrement.':'Solution'+(weak.length>1?'s':'')+' prioritaire'+(weak.length>1?'s':'')+' : '+weak.join(' · ');$('status').textContent=count===0?'Aucune gravité sélectionnée · aucune fuite':min===100?'Équilibre atteint · progression globale 100 %':'Progression globale '+avg+' % · taux de fuite global '+(100-avg)+' %';$('statusinfo').textContent=count===0?'Aucune gravité sélectionnée : les lamelles restent à 100 %.':min===100?'Toutes les solutions renseignées sont terminées.':'Le taux de fuite global est calculé sur la moyenne des '+count+' problème(s) renseigné(s). Les lignes vides sont exclues. Le niveau d’eau dépend de la lamelle la plus basse.';const staves=$('staves'),liquid=$('liquid'),overflow=$('overflow'),drops=$('drops');staves.replaceChildren();liquid.replaceChildren();overflow.replaceChildren();drops.replaceChildren();const complete=count>0&&min===100;$('tapStream').style.display=complete?'none':'';if(complete&&!completionStates[store.active])celebrate();completionStates[store.active]=complete;$('waterbarfill').style.width=avg+'%';$('barpct').textContent=avg+' %';const y=485-min/25*74;el('rect',{x:105,y,width:370,height:520-y,fill:'url(#water)'},liquid);el('path',{d:`M106 ${y} Q290 ${y-13} 474 ${y}`,fill:'none',stroke:'#d4f6ff','stroke-width':5,opacity:.85},liquid);const nStaves=state.items.length,x0=118,step=344/nStaves,staveWidth=step+1.5;const staveCount=$('staveCount');if(staveCount)staveCount.textContent=nStaves+' lamelles';state.items.forEach((item,i)=>{const x=x0+i*step,top=485-level(item)/25*74,mid=(i-(nStaves-1)/2)*15/nStaves;const bottom=480+32*(1-Math.pow(mid/8,2));const light=(1-Math.abs(mid)/9)*.22+.64;el('path',{d:`M${x} ${top+Math.abs(mid)*1.7} Q${x+step/2} ${top-5+Math.abs(mid)*1.7} ${x+staveWidth} ${top+Math.abs(mid)*1.7} L${x+staveWidth} ${bottom} Q${x+step/2} ${bottom+5} ${x} ${bottom} Z`,fill:'url(#staveWood)',filter:'url(#grain)',stroke:'#542d1a','stroke-width':1.8,opacity:light+.12},staves);el('path',{d:`M${x+step*.22} ${top+11+Math.abs(mid)*1.7} Q${x+step*.44} 315 ${x+step*.18} ${bottom-10}`,fill:'none',stroke:'#f7c68b','stroke-width':1.3,opacity:.25},staves);el('path',{d:`M${x+step*.65} ${top+12+Math.abs(mid)*1.7} Q${x+step*.44} 320 ${x+step*.79} ${bottom-15}`,fill:'none',stroke:'#4b281a','stroke-width':1.2,opacity:.3},staves);el('path',{d:`M${x+step*.35} ${top+23+Math.abs(mid)*1.7} C${x+step*.87} 260 ${x+step*.13} 375 ${x+step*.61} ${bottom-20}`,fill:'none',stroke:'#f5cb89','stroke-width':.8,opacity:.32},staves);el('rect',{x:x+step*.33,y:top+Math.abs(mid)*1.7-6,width:Math.max(5,step*.38),height:4,rx:1.5,fill:['#c44d3f','#d68b43','#dfbd60','#619c6a'][Math.max(0,level(item)/25-1)]},staves)});if(count>0&&min<100){
const leaking=state.items.map((item,i)=>({i,level:level(item)})).filter(o=>o.level===min);
leaking.forEach(({i,level:height})=>{
const x=x0+i*step+step/2,edge=485-height/25*74+Math.abs((i-(nStaves-1)/2)*15/nStaves)*1.7;
const dir=i<(nStaves-1)/2?-1:i>(nStaves-1)/2?1:(i%2?1:-1);
const rise=Math.max(10,(height-min)*.23+12);
const y0=edge+8,ending=y0+43+rise;
const d=`M${x} ${y0} C${x+dir*12} ${y0+13} ${x+dir*18} ${ending-22} ${x+dir*28} ${ending}`;
const stream=el('path',{d,fill:'none',stroke:'#38a7d5','stroke-width':height===0?9:5,opacity:.83,'stroke-linecap':'round','stroke-dasharray':'7 7'},overflow);
el('animate',{attributeName:'stroke-dashoffset',from:'0',to:'-28',dur:'.65s',repeatCount:'indefinite'},stream);
const drop=el('ellipse',{cx:x+dir*28,cy:ending,rx:2.5,ry:4.5,fill:'#68c9ed',opacity:.85},drops);
el('animate',{attributeName:'cy',values:`${ending};${ending+12};${ending+30}`,dur:'.95s',repeatCount:'indefinite'},drop);
el('animate',{attributeName:'opacity',values:'0;.85;0',dur:'.95s',repeatCount:'indefinite'},drop);
});
}}
function history(){const root=$('history');root.replaceChildren();if(!state.history.length){root.innerHTML='<div class="sub">Aucune séance enregistrée.</div>';return}state.history.slice().reverse().forEach(s=>{if(!Array.isArray(s.items)||s.items.length<10||s.items.length>20)return;const items=s.items.map(clean),row=document.createElement('div');row.className='snapshot';const {count,avg,min}=stats(items);const info=document.createElement('div'),strong=document.createElement('strong');strong.textContent=(s.date||'Séance')+' · '+(s.client||'Sans prénom');info.appendChild(strong);const detail=document.createElement('div');detail.className='sub';detail.textContent=`Progression de ${count} problème(s) renseigné(s) : ${avg} % · Taux de fuite global ${100-avg} %`;info.appendChild(detail);const b=document.createElement('button');b.textContent='Restaurer';b.onclick=()=>{if(confirm('Restaurer cette séance ?')){state.client=s.client||'';state.items=items;$('client').value=state.client;save();rows();render()}};row.append(info,b);root.appendChild(row)})}
$('client').value=state.client||'';$('client').addEventListener('input',e=>{state.client=e.target.value;save()});$('save').onclick=()=>{state.history.push({date:new Date().toLocaleString('fr-FR'),client:state.client,items:state.items.map(x=>({...x}))});save();history();alert('Séance enregistrée sur cet appareil.')};$('reset').onclick=()=>{if(confirm('Réinitialiser les domaines et solutions ? L’historique restera disponible.')){state.items=(store.active==='professional'?defaultsProfessional:defaultsPersonal).slice(0,10).map(name=>({name,solution:'',initial:0,progress:100}));save();rows();render()}};$('print').onclick=()=>window.print();$('import').onclick=()=>$('importFile').click();$('importFile').onchange=async e=>{const f=e.target.files[0];if(!f)return;try{const v=JSON.parse(await f.text());if(!Array.isArray(v.items)||v.items.length<10||v.items.length>20)throw Error('Le diagnostic doit contenir entre 10 et 20 problèmes');if(!confirm('Importer ce diagnostic et remplacer les données actuelles ?'))return;store.profiles[store.active]=normalized({client:String(v.client||'').slice(0,100),items:v.items,history:Array.isArray(v.history)?v.history.slice(0,150):[]},store.active);state=store.profiles[store.active];$('client').value=state.client;save();rows();render();history()}catch(err){alert('Import impossible : '+err.message)}finally{e.target.value=''}};$('export').onclick=()=>{const blob=new Blob([JSON.stringify({...state,profile:store.active},null,2)],{type:'application/json'}),url=URL.createObjectURL(blob),a=document.createElement('a');a.href=url;a.download='le-tonneau-v16-'+store.active+'-diagnostic.json';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000)};document.querySelectorAll('.profiletab').forEach(b=>b.addEventListener('click',()=>activate(b.dataset.profile)));activate(store.active);
// V8 : parcours autonome. Aucun paiement réel : la démo ne facture jamais.
const landing=document.getElementById('landing'),app=document.getElementById('app'),paywall=document.getElementById('paywall');
const flowMessage=document.getElementById('flowMessage');
let demoUnlocked=safeStorage.getItem('le_tonneau_v8_demo_access')==='yes';
function hasFreeUsed(){return safeStorage.getItem('le_tonneau_v8_first_saved')==='yes'||store.profiles.personal.history.length+store.profiles.professional.history.length>0}
function showApp(){landing.classList.add('hidden');app.classList.remove('hidden');updateFlow();window.scrollTo(0,0)}
function updateFlow(){flowMessage.textContent=demoUnlocked?'Mode démonstration : suivi débloqué gratuitement, aucun abonnement souscrit.':hasFreeUsed()?'Votre premier diagnostic est enregistré. Le suivi des séances est réservé à la formule à 1 €/mois (paiement non disponible dans cette version de démonstration).':'Premier diagnostic offert : remplissez votre tonneau et enregistrez votre première séance gratuitement.'}
function openPay(){paywall.classList.remove('hidden');document.getElementById('demoAccess').focus()}
document.getElementById('startFree').onclick=showApp;
document.getElementById('resume').onclick=showApp;
document.getElementById('home').onclick=()=>{app.classList.add('hidden');landing.classList.remove('hidden');window.scrollTo(0,0)};
document.getElementById('closePay').onclick=()=>paywall.classList.add('hidden');
document.getElementById('demoAccess').onclick=()=>{demoUnlocked=true;safeStorage.setItem('le_tonneau_v8_demo_access','yes');paywall.classList.add('hidden');updateFlow();alert('Accès de démonstration activé. Aucun paiement effectué.')};
paywall.addEventListener('click',e=>{if(e.target===paywall)paywall.classList.add('hidden')});
document.addEventListener('keydown',e=>{if(e.key==='Escape')paywall.classList.add('hidden')});
// Interception avant le gestionnaire de la V7 : le premier enregistrement est offert.
document.getElementById('save').addEventListener('click',e=>{if(hasFreeUsed()&&!demoUnlocked){e.stopImmediatePropagation();openPay();return}if(!hasFreeUsed()){safeStorage.setItem('le_tonneau_v8_first_saved','yes');setTimeout(updateFlow,0)}},true);
updateFlow();
</script><div id="resetDialog" hidden role="dialog" aria-modal="true" aria-labelledby="resetTitle" aria-describedby="resetDescription">
<div class="reset-panel">
<h2 id="resetTitle">Réinitialiser mon tonneau ?</h2>
<p id="resetDescription">Le diagnostic <strong id="resetProfileLabel">personnel</strong> reviendra à son état de départ : prénom effacé, 10 domaines proposés, solutions vides et aucune gravité initiale sélectionnée. <strong>Les séances déjà enregistrées et l'autre tonneau seront conservés.</strong></p>
<div class="reset-buttons"><button type="button" id="resetCancel">Annuler</button><button type="button" id="resetConfirm">Oui, réinitialiser</button></div>
</div>
</div><script>
// V11 : le bouton réinitialiser ouvre une vraie confirmation visible dans la page.
(function(){
const dialog=document.getElementById('resetDialog');
const reset=document.getElementById('reset');
const cancel=document.getElementById('resetCancel');
const confirmReset=document.getElementById('resetConfirm');
let previousFocus=null;
function close(){dialog.hidden=true;if(previousFocus)previousFocus.focus();}
reset.onclick=function(){previousFocus=document.activeElement;document.getElementById('resetProfileLabel').textContent=store.active==='personal'?'personnel':'professionnel';dialog.hidden=false;cancel.focus();};
cancel.onclick=close;
dialog.addEventListener('click',function(e){if(e.target===dialog)close();});
document.addEventListener('keydown',function(e){if(!dialog.hidden && e.key==='Escape'){e.preventDefault();close();}});
confirmReset.onclick=function(){
// Réinitialise uniquement le diagnostic actuellement affiché ; garde l'historique.
const profile=store.active;
const previousHistory=state.history;
const empty=fresh(profile);
empty.history=previousHistory;
store.profiles[profile]=empty;
state=empty;
document.getElementById('client').value='';
save();rows();render();history();
close();
// L'état d'abonnement et les séances historiques restent inchangés.
};
})();
</script>
<script>
(function(){
const layout=document.getElementById('mobileSlides');if(!layout)return;
const viz=layout.querySelector('.viz');if(!viz)return;
const dock=document.createElement('div');dock.id='v20dock';dock.setAttribute('aria-label','Tonneau toujours visible');document.body.appendChild(dock);
const placeholder=document.createComment('Emplacement original du tonneau');viz.before(placeholder);
function sync(){if(window.matchMedia('(max-width:740px)').matches){if(viz.parentNode!==dock)dock.appendChild(viz)}else if(viz.parentNode!==layout){placeholder.after(viz)}}
sync();window.addEventListener('resize',sync,{passive:true});
})();
</script><script>
/* Connexion Supabase V18 : clé publique uniquement. Aucun secret côté navigateur. */
(function(){
'use strict';
const base='https://ekzfsxumiqwoabtaf u wo.supabase.co'.replaceAll(' ', '');
const publicKey='sb_publishable_R--ukeiigTyYRAYOUFpjrA_2fWnizH_';
const el=id=>document.getElementById(id), status=(s,err=false)=>{el('cloudStatus').textContent=s;el('cloudStatus').style.color=err?'#a32a2a':'#245b75'};
let session=null, timer=null, busy=false;
const sessionKey='le_tonneau_supabase_session';
try{session=JSON.parse(localStorage.getItem(sessionKey)||'null')}catch{}
function storeSession(s){session=s;try{if(s)localStorage.setItem(sessionKey,JSON.stringify(s));else localStorage.removeItem(sessionKey)}catch{};updateUI()}
function updateUI(){const ok=!!session?.access_token;el('cloudGuest').classList.toggle('cloudHidden',ok);el('cloudMember').classList.toggle('cloudHidden',!ok);el('cloudWho').textContent=ok?'Connecté : '+(session.user?.email||'compte utilisateur'):'';el('cloudToggle').textContent=ok?'☁️ Connecté':'☁️ Mon compte'}
async function request(path,opts={}){const headers={'apikey':publicKey,'Content-Type':'application/json',...opts.headers};const res=await fetch(base+path,{...opts,headers});const raw=await res.text();let body;try{body=raw?JSON.parse(raw):null}catch{body={message:raw}};if(!res.ok)throw Error(body?.msg||body?.message||body?.error_description||body?.error||'Erreur '+res.status);return body}
async function token(){if(!session?.access_token)throw Error('Connectez-vous.');if(session.expires_at && Date.now()/1000>session.expires_at-90){if(!session.refresh_token)throw Error('Session expirée. Reconnectez-vous.');const refreshed=await request('/auth/v1/token?grant_type=refresh_token',{method:'POST',body:JSON.stringify({refresh_token:session.refresh_token})});storeSession(refreshed)}return session.access_token}
async function db(path,opts={}){const t=await token();return request('/rest/v1/tonneaux'+path,{...opts,headers:{Authorization:'Bearer '+t,...opts.headers}})}
function profilePayload(profile){return {user_id:session.user.id,profil:profile,donnees:structuredClone(store.profiles[profile])}}
async function push(){if(!session?.user?.id||busy)return;busy=true;try{for(const p of ['personal','professional']){const rows=await db('?select=id&profil=eq.'+p+'&user_id=eq.'+encodeURIComponent(session.user.id)+'&limit=1');const payload=profilePayload(p);if(rows.length){await db('?id=eq.'+rows[0].id+'&user_id=eq.'+encodeURIComponent(session.user.id),{method:'PATCH',headers:{Prefer:'return=minimal'},body:JSON.stringify({donnees:payload.donnees})})}else{await db('',{method:'POST',headers:{Prefer:'return=minimal'},body:JSON.stringify(payload)})}}status('✓ Tonneaux personnel et professionnel sauvegardés en ligne.')}catch(e){status('Sauvegarde impossible : '+e.message,true)}finally{busy=false}}
function queue(){if(!session?.access_token)return;clearTimeout(timer);timer=setTimeout(push,1700)}
async function pull(){if(!session?.access_token)return;try{const rows=await db('?select=profil,donnees&user_id=eq.'+encodeURIComponent(session.user.id));if(!rows.length){status('Aucune sauvegarde en ligne. Vos données locales sont conservées.');return}if(!confirm('Remplacer les données présentes sur cet appareil par celles de votre compte en ligne ?'))return;for(const row of rows){if(['personal','professional'].includes(row.profil)&&row.donnees&&Array.isArray(row.donnees.items)){store.profiles[row.profil]=normalized(row.donnees,row.profil)}}save();activate(store.active);status('✓ Tonneaux récupérés depuis votre compte.')}catch(e){status('Récupération impossible : '+e.message,true)}}
async function auth(mode){const email=el('cloudEmail').value.trim(),password=el('cloudPassword').value;if(!email||!password){status('Indiquez votre e-mail et votre mot de passe.',true);return}try{status('Connexion en cours…');const s=await request(mode==='signup'?'/auth/v1/signup':'/auth/v1/token?grant_type=password',{method:'POST',body:JSON.stringify({email,password})});if(!s.access_token){status('Compte créé. Vérifiez votre boîte e-mail et confirmez votre inscription avant de vous connecter.');return}storeSession(s);status('✓ Connecté. Choisissez « Récupérer mes tonneaux » si vous avez déjà une sauvegarde en ligne, sinon « Sauvegarder maintenant ».')}catch(e){status('Connexion impossible : '+e.message,true)}}
el('cloudToggle').onclick=()=>el('cloudBox').classList.toggle('open');el('cloudLogin').onclick=()=>auth('login');el('cloudSignup').onclick=()=>auth('signup');el('cloudLogout').onclick=async()=>{try{if(session)await request('/auth/v1/logout',{method:'POST',headers:{Authorization:'Bearer '+await token()}})}catch{}storeSession(null);status('Déconnecté. Les données locales restent disponibles.')};el('cloudLoad').onclick=pull;el('cloudPush').onclick=push;
el('cloudForgot').onclick=async()=>{const email=el('cloudEmail').value.trim();if(!email){status('Saisissez votre e-mail.',true);return}try{await request('/auth/v1/recover',{method:'POST',body:JSON.stringify({email})});status('Si cette adresse possède un compte, un e-mail de réinitialisation sera envoyé.')}catch(e){status(e.message,true)}};
/* Intercepter les sauvegardes locales existantes sans changer le fonctionnement du tonneau. */
const originalSave=save;save=function(){originalSave();queue()};
updateUI();
if(session?.access_token){token().then(()=>status('Session retrouvée. Sauvegarde automatique active.')).catch(e=>status('Reconnectez-vous : '+e.message,true))}
})();
</script></body></html>