:root{--rose:#d85c7d;--rose2:#8e3b67;--dark:#382b35;--line:#efdde2;--paper:#fffdfc;--muted:#92727d}*{box-sizing:border-box}html{background:#f8eef2}body{margin:0;min-height:100vh;background:radial-gradient(circle at 6% 3%,#ffe180 0 4%,transparent 16%),radial-gradient(circle at 94% 18%,#ffc8db 0 5%,transparent 20%),linear-gradient(145deg,#fff8ed 0%,#fdeaf2 47%,#e9dcfa 100%);color:var(--dark);font:16px ui-rounded,system-ui,-apple-system,"Segoe UI",sans-serif}button,input,textarea{font:inherit}button{cursor:pointer}main{max-width:540px;margin:auto;padding:calc(18px + env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom))}.brand{display:flex;align-items:center;justify-content:space-between;gap:12px}.brand h1,.section h2{font-family:Georgia,serif}.brand h1{font-size:26px;margin:0;color:#76334f}.brand small,.source{color:var(--muted)}.pill,button{border:0;border-radius:999px;padding:11px 15px;background:#fff;color:var(--dark);box-shadow:0 5px 18px #82455a18}.pill:active,.action:active,.primary:active,.linkbtn:active{transform:scale(.98)}.hero{position:relative;min-height:265px;margin:16px 0 13px;border-radius:28px;overflow:hidden;background:radial-gradient(circle at 22% 20%,#fff6ba 0 11%,transparent 11.5%),radial-gradient(circle at 78% 82%,#eac9ff 0 20%,transparent 20.5%),linear-gradient(135deg,#ffcfdf,#f8c6ab 45%,#cdbcf2);box-shadow:0 18px 36px #9b537336}.mascot{position:absolute;right:-33px;bottom:-20px;width:250px;mix-blend-mode:multiply;animation:float 4s ease-in-out infinite}.console{position:absolute;left:20px;top:31px;right:155px;padding:15px;border-radius:18px;background:#fffdfce6;border:1px solid #fff8;box-shadow:0 10px 25px #8b4d5740;backdrop-filter:blur(10px)}.console strong{display:block;color:var(--rose);font-family:Georgia,serif;font-size:20px}.console p,.recipe p{font-size:13px;line-height:1.46}.actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.action,.recipe{border:1px solid var(--line);border-radius:18px;background:#fffdfcea;padding:14px;text-align:left}.action{min-height:82px;transition:transform .2s,box-shadow .2s}.action b{display:block}.action span{font-size:12px;color:#7d6972}.section{margin-top:23px}.section h2{font-size:19px;margin:0 0 10px;color:#76334f}.ingredients{display:flex;gap:7px;flex-wrap:wrap}.chip{background:#fff;border:1px solid var(--line);border-radius:999px;padding:7px 10px;font-size:13px}.chip button{padding:0;margin-left:5px;box-shadow:none;color:var(--rose);background:transparent}.add{display:flex;gap:8px;margin-top:10px}.add input{min-width:0;flex:1;padding:12px 13px;border:1px solid var(--line);border-radius:14px;background:#fff}.primary{background:linear-gradient(135deg,var(--rose),var(--rose2));color:#fff}.recipe{margin:9px 0;box-shadow:0 7px 18px #8645660f}.recipe-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.recipe-head span{font-size:11px;color:var(--muted);text-align:right}.recipe h3{margin:0;font-size:16px}.recipe a,.linkbtn{color:var(--rose);font-weight:650;text-decoration:none}.recipe a{display:inline-block;margin-left:10px;font-size:13px}.linkbtn{padding:7px 10px;background:#fff;border:1px solid var(--line);box-shadow:none}.drawer{position:fixed;inset:0;background:#382b3580;display:none;align-items:end;z-index:10}.drawer.show{display:flex}.sheet{background:#fffafa;border-radius:27px 27px 0 0;padding:22px 18px calc(22px + env(safe-area-inset-bottom));width:100%;max-height:90vh;overflow:auto}.camera{width:100%;border-radius:18px;background:#222;display:none;max-height:48vh}.notice,.source{font-size:12px;line-height:1.45}.chat{background:#fffdfce8;border:1px solid var(--line);border-radius:20px;padding:14px;box-shadow:0 9px 20px #86456612}.conversation{max-height:260px;overflow:auto;display:grid;gap:8px;white-space:pre-line}.conversation p{margin:0;padding:10px 11px;border-radius:14px;font-size:13px;line-height:1.45}.bot{background:#f9e8ed}.user{background:#f5f0e8;text-align:right}.voice{width:46px;padding:0;font-size:18px;border:1px solid var(--line)}@keyframes float{50%{transform:translateY(-7px)}}@media(max-width:390px){.console{right:128px}.mascot{width:220px;right:-42px}.brand h1{font-size:23px}.actions{grid-template-columns:1fr}.add{flex-wrap:wrap}.add input{flex-basis:100%}.primary{flex:1}.voice{height:42px}}
/* Champs natifs : une seule règle, sans miroir ni réécriture de texte. */
html{color-scheme:light}
.add input,.add textarea{
  min-width:0;flex:1;padding:12px 13px;border:1px solid var(--line);
  border-radius:14px;background:#fff;color:#2b1f26;
  -webkit-text-fill-color:#2b1f26;caret-color:var(--rose);
  font-size:16px;line-height:1.35;
}
.add input::placeholder,.add textarea::placeholder{
  color:#9a7a86;-webkit-text-fill-color:#9a7a86;opacity:1;
}
#question{resize:vertical;min-height:68px}
#question:focus,#newFood:focus{outline:2px solid #d85c7d55;outline-offset:1px}
.typing-preview{margin:8px 1px 0;padding:9px 11px;border-radius:12px;background:#fff4f7;color:#5a3244;font-size:14px;line-height:1.4;overflow-wrap:anywhere}
@media(max-width:390px){.add textarea{flex-basis:100%}}

/* Gousto reste visible sur Safari iPhone : aucun mode de fusion qui efface l'image. */
.mascot{right:-12px;bottom:-12px;width:246px;height:260px;object-fit:contain;mix-blend-mode:normal;filter:drop-shadow(0 12px 12px #74465d38);transform-origin:65% 72%;z-index:3;animation:mascotFloat 4s ease-in-out infinite}.console{z-index:4}
.mascot--greeting,.mascot--goodbye{animation:mascotWave .48s ease-in-out 5,mascotFloat 4s ease-in-out 2.5s infinite}.mascot--thinking{animation:mascotThink .72s ease-in-out infinite}.mascot--happy{animation:mascotHappy .45s ease-in-out 5,mascotFloat 4s ease-in-out 2.3s infinite}.mascot--helpful{animation:mascotNod .6s ease-in-out 3,mascotFloat 4s ease-in-out 1.8s infinite}.mascot--wink{animation:mascotWink .42s ease-in-out 2,mascotFloat 4s ease-in-out .8s infinite}.mascot--sad{animation:mascotSad 1.15s ease-in-out infinite}
@keyframes mascotFloat{50%{transform:translateY(-7px)}}@keyframes mascotWave{50%{transform:rotate(6deg) translateY(-4px)}}@keyframes mascotThink{50%{transform:translateY(-12px) rotate(-2deg)}}@keyframes mascotHappy{50%{transform:translateY(-17px) rotate(3deg) scale(1.04)}}@keyframes mascotNod{50%{transform:translateY(2px) rotate(-2deg)}}@keyframes mascotWink{50%{transform:rotate(4deg) scale(1.04)}}@keyframes mascotSad{50%{transform:translateY(5px) rotate(-2deg)}}
@media(max-width:390px){.mascot{width:220px;height:240px;right:-28px}}

/* Version 23 : lecture confortable et scène de la mascotte. */
body{font-family:"Avenir Next",Avenir,"Helvetica Neue",ui-rounded,system-ui,-apple-system,sans-serif;letter-spacing:.002em}
.brand h1,.section h2,.console strong{font-family:Georgia,"Times New Roman",serif;letter-spacing:.01em}
.hero{min-height:312px;border-radius:32px;box-shadow:0 20px 42px #954b7338;background:radial-gradient(circle at 19% 15%,#fff6bd 0 12%,transparent 12.4%),radial-gradient(circle at 82% 84%,#eac9ff 0 23%,transparent 23.4%),linear-gradient(135deg,#ffd5e2 0%,#f7c6b3 46%,#ccbdf2 100%)}
.console{left:18px;top:20px;right:194px;bottom:18px;max-height:none;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;padding:17px 16px 18px;border-radius:22px;background:linear-gradient(150deg,#fffefdf2,#fff7fae8);box-shadow:0 14px 28px #7d405143;scrollbar-color:#d85c7d88 transparent;z-index:4}
.console strong{font-size:22px;position:sticky;top:-17px;margin:-17px -16px 8px;padding:17px 16px 8px;background:linear-gradient(180deg,#fffefdfa 75%,#fffefd00);z-index:1}
.console p{font-size:14px;line-height:1.55;margin:0;padding-bottom:5px;overflow-wrap:anywhere}
.mascot{right:0;bottom:1px;width:204px;height:298px;object-fit:contain;object-position:50% 100%;filter:drop-shadow(0 13px 12px #74465d42);z-index:3;animation:mascotIdle 6s ease-in-out infinite}
.mascot--greeting,.mascot--goodbye{animation:mascotWave .48s ease-in-out 5,mascotIdle 6s ease-in-out 2.5s infinite}.mascot--thinking{animation:mascotThink .72s ease-in-out infinite}.mascot--happy{animation:mascotHappy .45s ease-in-out 5,mascotIdle 6s ease-in-out 2.3s infinite}.mascot--helpful{animation:mascotNod .6s ease-in-out 3,mascotIdle 6s ease-in-out 1.8s infinite}.mascot--wink{animation:mascotWink .42s ease-in-out 2,mascotIdle 6s ease-in-out .8s infinite}.mascot--sad{animation:mascotSad 1.15s ease-in-out infinite}
@keyframes mascotIdle{0%,100%{transform:translateY(0) rotate(0)}28%{transform:translateY(-7px) rotate(-1deg)}52%{transform:translateY(-2px) rotate(1deg)}76%{transform:translateY(-9px) rotate(-.5deg)}}
.action,.chat,.recipe{border-color:#efd8e0;box-shadow:0 12px 25px #86456614}.action{border-radius:20px;background:linear-gradient(145deg,#fffefe,#fff8fa);min-height:88px}.chat{border-radius:24px;padding:16px;background:linear-gradient(145deg,#fffefeec,#fff5f9dc)}
.conversation{max-height:300px;padding-right:3px;scrollbar-color:#d85c7d88 transparent}.conversation p{border-radius:16px;line-height:1.55}.voice{position:relative;transition:transform .2s,background .2s,color .2s}.voice.is-listening{background:linear-gradient(135deg,#7e3156,#d85c7d);color:#fff;animation:micPulse 1s ease-in-out infinite}.voice.is-listening::after{content:"";position:absolute;inset:-4px;border:2px solid #d85c7d77;border-radius:999px;animation:micRing 1s ease-out infinite}
@keyframes micPulse{50%{transform:scale(1.07)}}@keyframes micRing{to{transform:scale(1.25);opacity:0}}
@media(max-width:420px){.hero{min-height:302px}.console{left:15px;right:150px;top:18px;bottom:16px;padding:14px}.console strong{top:-14px;margin:-14px -14px 7px;padding:14px 14px 7px;font-size:20px}.console p{font-size:13px;line-height:1.5}.mascot{width:164px;height:276px;right:-2px;bottom:0}.actions{gap:12px}.chat{padding:14px}}
@media(prefers-reduced-motion:reduce){.mascot,.mascot--greeting,.mascot--goodbye,.mascot--thinking,.mascot--happy,.mascot--helpful,.mascot--wink,.mascot--sad,.voice.is-listening,.voice.is-listening::after{animation:none}}

/* Version 26 : scan guidé, inventaire local et rappels. */
.section-title{display:flex;align-items:center;justify-content:space-between;gap:10px}.section-title h2{margin-bottom:0}.scan-memory{padding:16px;border:1px solid #efd8e0;border-radius:24px;background:linear-gradient(145deg,#fffefe,#fff4f8c9);box-shadow:0 12px 25px #86456612}.scan-inventory{display:grid;gap:8px}.empty-scan{margin:4px 0;color:var(--muted);font-size:13px}.scan-item{display:flex;align-items:center;justify-content:space-between;gap:9px;padding:11px 12px;border:1px solid #f0dce4;border-radius:16px;background:#fffdfd}.scan-item b{display:block;font-size:14px}.scan-item small,.scan-choice small{display:block;margin-top:3px;color:var(--muted);font-size:12px}.remove-scan{padding:3px 9px;color:var(--rose);font-size:20px;box-shadow:none;background:transparent}.nutri{display:inline-block;margin:4px 0 0;padding:2px 7px;border-radius:999px;font-size:10px;font-weight:750}.nutri-a,.nutri-b{background:#dff4db;color:#286c36}.nutri-c{background:#fff0b8;color:#7b5d00}.nutri-d,.nutri-e{background:#ffe0df;color:#a23c42}.reminders p{margin:11px 0 1px;padding:10px 11px;border-radius:14px;background:#fae9ef;color:#73435a;font-size:13px;line-height:1.4}.off-attribution{margin-bottom:0}.off-attribution a{color:var(--rose)}.scan-preview{display:block;width:100%;max-height:36vh;object-fit:contain;border-radius:18px;background:#281e24;margin:12px 0}.scan-preview[hidden]{display:none}.scan-actions{display:flex;gap:9px;margin-top:10px}.scan-actions .primary{flex:1}.photo-picker{display:block;margin:11px 0;padding:12px;border:1px dashed #d99aaf;border-radius:14px;text-align:center;color:#9a4669;font-weight:650;font-size:13px;background:#fff8fa}.barcode{margin-top:15px;padding-top:13px;border-top:1px solid #f0dce4}.barcode>label{font-size:13px;font-weight:700}.scan-results{margin-top:12px}.scan-results>p{font-size:13px;margin:0 0 7px}.scan-choice{display:flex;align-items:flex-start;gap:9px;margin:7px 0;padding:10px;border-radius:14px;background:#fff3f7}.scan-choice input{margin-top:3px;accent-color:var(--rose)}.scan-choice b{font-size:14px}@media(max-width:420px){.scan-memory{padding:14px}.scan-actions{flex-wrap:wrap}}
