:root{--ink:#262640;--muted:#67687d;--cream:#faf6ed;--purple:#6960bc;--pink:#f0a7c5;--mint:#b9ebda;--line:#e8e3dd;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);font-size:16px}*{box-sizing:border-box}body{margin:0;background:#e9e7f0}button,input,select{font:inherit}button{cursor:pointer;border:0;touch-action:manipulation}button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #ac66f4;outline-offset:3px}button:disabled{cursor:default;opacity:.55}#app{max-width:520px;margin:auto;min-height:100dvh;background:var(--cream);position:relative;overflow:hidden}h1,h2,h3,p{margin:0}h1,h2{font-family:Georgia,serif;font-weight:400}h1{font-size:36px;line-height:1.12;letter-spacing:-1px}h2{font-size:29px}p{line-height:1.6}small,.eyebrow{font-size:12px;letter-spacing:1.8px;text-transform:uppercase}.muted{color:var(--muted);font-size:14px;line-height:1.55}.primary{background:var(--ink);color:white;padding:16px 22px;border-radius:50px;font-weight:650;min-height:50px}.secondary{background:#ede9f5;color:var(--ink);padding:14px 18px;border-radius:25px;min-height:46px}.round{width:46px;height:46px;display:grid;place-items:center;border-radius:50%;background:#ffffffd9;font-size:21px;color:var(--ink)}.row{display:flex;align-items:center;justify-content:space-between;gap:12px}.stack{display:grid;gap:18px}.intro{padding:44px 28px 28px;min-height:100dvh;display:flex;flex-direction:column;justify-content:center;gap:22px;background:radial-gradient(ellipse at 50% 25%,#e9ddfb,transparent 50%),var(--cream)}.intro .mascot{height:185px;width:190px;align-self:center}.brand{font-size:28px;letter-spacing:-1px;font-weight:700}.tag{background:#fff9;border:1px solid #fff9;padding:8px 12px;border-radius:30px;font-size:12px}.intro form{display:grid;gap:14px}.field{display:grid;gap:8px;font-size:14px}.field input,.field select{width:100%;padding:14px 16px;border:1px solid #ddd6ea;border-radius:18px;background:white;color:var(--ink);min-height:48px}.scene{min-height:100dvh;background:radial-gradient(ellipse at 50% 47%,#b5dde0 0,#91c7d5 22%,#555b98 60%,#25274d 100%);color:white;position:relative;padding-bottom:108px;display:flex;flex-direction:column}.stars{position:absolute;inset:0;pointer-events:none;background-image:radial-gradient(circle,#ffffffb0 1px,transparent 1.5px),radial-gradient(circle,#fff8 1px,transparent 1.5px);background-size:73px 91px,137px 149px;background-position:12px 8px,61px 24px;opacity:.5}.scene header{padding:24px;z-index:1}.scene .greeting{padding:30px 26px 0;z-index:1}.scene h1{font-size:36px}.scene .greeting p{color:#eeeeff;margin-top:12px;max-width:300px}.planet{position:relative;min-height:330px;flex:1;display:flex;align-items:center;justify-content:center;z-index:1}.planet:before{content:"";width:286px;height:155px;background:radial-gradient(ellipse at 40% 12%,#c2ecb5,#88bd9d 48%,#478e85 70%,#4b6a83);border-radius:50%;position:absolute;top:58%;box-shadow:0 20px 65px #29324b55,inset -10px -15px 20px #344a5533}.planet:after{content:"✦";position:absolute;left:17%;top:56%;font-size:32px;color:#f9efd0}.planet .mascot{width:210px;height:210px;z-index:1;filter:drop-shadow(0 14px 10px #32425433);animation:float 5s ease-in-out infinite}.scene-note{z-index:1;align-self:center;background:#ffffffc9;color:var(--ink);padding:14px 20px;border-radius:24px;width:calc(100% - 48px);font-size:14px}.scene-note strong{display:block;margin-bottom:4px}.nav{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;position:absolute;bottom:0;left:0;right:0;padding:12px 12px max(14px,env(safe-area-inset-bottom));background:#fffdf7;z-index:4;border-top:1px solid #e9e5eb}.nav button{background:transparent;color:#737286;font-size:12px;padding:8px 2px;border-radius:17px;min-height:56px;display:grid;gap:4px}.nav button span{font-size:21px}.nav .active{background:#eee9fa;color:#6053a4;font-weight:700}.page{min-height:100dvh;padding:26px 24px 110px;background:var(--cream)}.page header{margin-bottom:30px}.page h1{margin:12px 0}.card{background:white;border:1px solid var(--line);border-radius:24px;padding:22px;display:grid;gap:12px}.subject{width:100%;text-align:left;display:flex;gap:15px;align-items:center;padding:24px 18px;border:1px solid var(--line);border-radius:24px;background:white}.subject .icon{font-size:28px;width:58px;height:58px;border-radius:20px;display:grid;place-items:center;background:#eee7fa}.subject:nth-child(2) .icon{background:#e3f3ed}.subject strong{font-size:18px;display:block}.subject p{font-size:13px;color:var(--muted)}.stat{background:#eee9fa;border-radius:24px;padding:22px}.stat strong{font-size:34px;display:block;letter-spacing:-1px}.stats{display:grid;grid-template-columns:1fr 1fr;gap:12px}.progress{height:8px;background:#edeaf3;border-radius:20px;overflow:hidden}.progress div{height:100%;background:#8171bd}.options{display:grid;gap:12px}.option{background:white;border:1px solid #dcd5e9;min-height:54px;border-radius:18px;padding:14px;text-align:left}.option.correct{background:#e0f3e8;border-color:#75b59b}.option.wrong{background:#fce8e6;border-color:#df8a8a}.feedback{padding:18px;border-radius:18px;background:#e9f2ed;line-height:1.6;font-size:14px}.feedback.wrong{background:#fbebe7}.quiz-title{font-family:Georgia,serif;font-size:27px;line-height:1.4;margin:24px 0}.chat{height:100dvh;display:flex;flex-direction:column;position:relative;background:linear-gradient(#6774a9,#b2dadd 58%,#deeae1);padding-bottom:92px}.chat header{padding:20px 20px 14px;display:flex;align-items:center;gap:12px;background:#fdf9f5ee;border-bottom:1px solid #fff8}.chat header .mascot{width:44px;height:44px}.chat header strong{display:block}.chat header small{font-size:12px;letter-spacing:0;color:var(--muted);text-transform:none}.messages{flex:1;overflow:auto;padding:20px;display:flex;flex-direction:column;gap:12px}.bubble{border-radius:23px 23px 23px 6px;padding:15px 18px;background:#fffef5;max-width:92%;font-size:15px;line-height:1.65;white-space:pre-wrap;box-shadow:0 2px 4px #29345609}.bubble.user{align-self:flex-end;border-radius:23px 23px 6px 23px;background:#d2f1ec}.chips{display:flex;gap:8px;padding:9px 16px;overflow:auto;flex-shrink:0}.chips button{border-radius:25px;background:#ffffffe0;font-size:13px;padding:10px 13px;min-height:44px;white-space:nowrap}.composer{display:flex;gap:8px;padding:8px 16px 10px;align-items:center}.composer input{border:0;min-width:0;flex:1;border-radius:28px;padding:15px 18px;min-height:50px;background:#fffef7}.composer button{background:var(--ink);color:white;flex-shrink:0}.chat .notice{padding:0 18px 8px;color:#3f455c;font-size:12px;line-height:1.45;text-align:center}.drawer-wrap{position:absolute;inset:0;z-index:10;background:#20254180;display:flex}.drawer{background:var(--cream);width:88%;padding:28px;box-shadow:0 0 80px #13153355;overflow:auto}.drawer .stack{margin-top:24px}.drawer button{text-align:left}.badge{font-size:14px;border-radius:18px;background:#f2edf8;padding:16px}.empty{border:1px dashed #d6cfe0;border-radius:20px;padding:20px;font-size:14px;color:var(--muted)}.history{display:grid;gap:12px}.history li{list-style:none;border-bottom:1px solid var(--line);padding-bottom:12px;font-size:14px}.history ul{margin:0;padding:0;display:grid;gap:16px}.error{color:#a23643;font-size:13px}.privacy{font-size:14px;line-height:1.7}.privacy h2{margin-bottom:16px}.privacy h3{font-size:16px;margin-top:20px}.privacy ul{padding-left:22px}.result{text-align:center;padding:30px 22px}.result .mascot{width:130px;height:130px}.result strong{display:block;font-size:40px;color:#6b5bab}.result p{margin:14px 0 24px}@keyframes float{50%{transform:translateY(-9px) rotate(2deg)}}@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important}}@media(min-width:600px){body{padding:24px}#app{border-radius:32px;box-shadow:0 20px 80px #28244422;min-height:calc(100dvh - 48px)}.scene,.intro,.page{min-height:calc(100dvh - 48px)}.chat{height:calc(100dvh - 48px)}}
.option:disabled{opacity:1;color:#686576}.option.correct:disabled{color:#23533e;border-color:#6caa8c}.option.wrong:disabled{color:#7e3637;border-color:#c98181}
/* Ajouts pilote IA : accès pliable pour garder la conversation lisible sur mobile. */
.chat .messages{min-height:80px;overflow-wrap:anywhere}.access{margin:4px 16px;background:#fffdf5;border-radius:18px;padding:10px 14px;font-size:13px;flex-shrink:0;max-height:45dvh;overflow:auto}.access summary{cursor:pointer;min-height:30px;line-height:30px}.access form{gap:8px;margin:8px 0}.access .secondary{padding:8px 12px;min-height:40px}.access .field input{padding:10px 12px;min-height:42px}.chat header,.chat .composer,.chat .notice{flex-shrink:0}

/* v1.0.1 : état du chat, boutons désactivés */
.chat-status{flex-shrink:0;padding:8px 16px;font-size:13px;font-weight:600;background:#fdf9f5ee}.chat-status.on{color:#23533e}.chat-status.off{color:#7e3637}.chips button:disabled,.composer input:disabled{opacity:.55;cursor:not-allowed}.composer input:disabled{background:#eceae3}
