:root{
  --primary:#0B5D6B; --primary-2:#0E7488; --accent:#E09F3E; --bg:#F7F4EC; --surface:#fff; --text:#1d2a2e;
  --muted:#5b6b70; --line:#e3ddcf; --bot:#fff; --user:var(--primary); --user-text:#fff;
  --av1:#3FB6C4; --av2:#0B5D6B; --fs:1rem; --radius:18px; --shadow:0 2px 10px rgba(11,40,48,.08);
  color-scheme: light;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font:400 var(--fs)/1.5 system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,sans-serif;background:var(--bg);color:var(--text);-webkit-text-size-adjust:100%}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--primary)}
svg{stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:-999px;top:0;background:#000;color:#fff;padding:8px;z-index:99}
.skip:focus{left:8px}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
[hidden]{display:none!important}

.app{display:flex;flex-direction:column;height:100dvh;max-width:760px;margin:0 auto;background:var(--bg)}
.top{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top));background:var(--primary);color:#fff}
.brand{display:flex;align-items:center;gap:10px;background:none;border:0;color:#fff;padding:0;text-align:left;min-height:44px}
.brand-txt{display:flex;flex-direction:column;line-height:1.15}
.brand-txt b{font-size:1.1em}
.brand-txt small{opacity:.85;font-size:.78em}
.mini-avatar{width:40px;height:44px;display:block}
.mini-avatar svg{width:100%;height:100%}
.top-actions{display:flex;align-items:center;gap:6px}
.langs{display:flex;background:rgba(255,255,255,.14);border-radius:999px;padding:3px}
.langs button{border:0;background:none;color:#fff;font-weight:600;font-size:.85em;padding:6px 9px;border-radius:999px;min-width:36px;min-height:34px}
.langs button[aria-pressed=true]{background:#fff;color:var(--primary)}
.icon-btn{width:44px;height:44px;border:0;border-radius:12px;background:transparent;color:inherit;display:grid;place-items:center}
.icon-btn svg{width:24px;height:24px}

.place{display:flex;align-items:center;gap:8px;padding:8px 14px;background:#E7F1EF;color:#0a4a55;font-size:.9em;border-bottom:1px solid var(--line)}
.place .pin{width:18px;height:18px;flex:none}
.place span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.link-btn{background:none;border:0;color:var(--primary);text-decoration:underline;padding:6px 4px;min-height:36px;font-size:.92em}
.ai-note{font-size:.76em;color:var(--muted);padding:6px 14px;background:var(--bg);border-bottom:1px solid var(--line)}

.stage{display:flex;flex-direction:column;align-items:center;padding:8px 0 2px;background:linear-gradient(var(--bg),#eaf3f1)}
.avatar-big{width:120px;height:132px}
.avatar-big svg{width:100%;height:100%}
.stage-status{margin:0;font-size:.82em;color:var(--muted);min-height:1.3em}

.chat{flex:1;overflow-y:auto;padding:14px 12px 8px;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth}
.msg{max-width:88%;padding:11px 14px;border-radius:var(--radius);box-shadow:var(--shadow);word-wrap:break-word;animation:pop .22s ease-out}
.msg p{margin:0 0 .5em}.msg p:last-child{margin:0}
.msg ul{margin:.3em 0 .5em;padding-left:1.2em}
.msg.user{align-self:flex-end;background:var(--user);color:var(--user-text);border-bottom-right-radius:6px}
.msg.bot{align-self:flex-start;background:var(--bot);border-bottom-left-radius:6px}
.msg.bot.warn{border-left:4px solid var(--accent)}
.msg .tools{display:flex;align-items:center;gap:4px;margin-top:8px;flex-wrap:wrap}
.tool{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:4px 10px;font-size:.8em;display:inline-flex;align-items:center;gap:4px;min-height:32px;color:var(--muted)}
.tool svg{width:16px;height:16px}
.tool[aria-pressed=true]{background:var(--primary);color:#fff;border-color:var(--primary)}
.sources{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;font-size:.78em;color:var(--muted);align-items:center}
.src{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;background:#EEF4F3;color:#0a4a55;text-decoration:none;border:1px solid #d5e5e2}
.src.ext{background:#FBF1E2;border-color:#f0dcbd;color:#6b4610}
.divider{align-self:center;font-size:.8em;color:#0a4a55;background:#E7F1EF;border-radius:999px;padding:5px 14px;display:flex;gap:6px;align-items:center}
.divider svg{width:14px;height:14px}

.card{align-self:flex-start;width:min(88%,360px);background:var(--surface);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);animation:pop .25s ease-out}
.card .img{aspect-ratio:16/9;background:#dfe9e7;display:grid;place-items:center;color:var(--muted);font-size:.85em}
.card .img img{width:100%;height:100%;object-fit:cover;display:block}
.card .img button{border:1px dashed #9ab;background:none;border-radius:10px;padding:8px 12px}
.card .body{padding:10px 14px 12px}
.card .cat{font-size:.72em;text-transform:uppercase;letter-spacing:.05em;color:var(--accent);font-weight:700}
.card h3{margin:.1em 0 .4em;font-size:1.02em}
.card .acts{display:flex;gap:6px;flex-wrap:wrap}
.minimap{height:150px;border-top:1px solid var(--line)}

.typing{align-self:flex-start;background:var(--bot);border-radius:var(--radius);padding:12px 16px;box-shadow:var(--shadow);display:flex;gap:5px}
.typing i{width:8px;height:8px;border-radius:50%;background:var(--primary-2);opacity:.4;animation:blink 1.2s infinite}
.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}

.suggest{display:flex;gap:8px;overflow-x:auto;padding:4px 12px 8px;scrollbar-width:none}
.suggest::-webkit-scrollbar{display:none}
.chip{flex:none;border:1.5px solid var(--primary);background:var(--surface);color:var(--primary);border-radius:999px;padding:8px 14px;font-size:.9em;min-height:40px;font-weight:500}
.chip:active{transform:scale(.97)}

.composer{border-top:1px solid var(--line);background:var(--surface);padding:6px 10px calc(8px + env(safe-area-inset-bottom))}
.modes{display:flex;gap:4px;align-items:center;padding-bottom:6px}
.modes button{border:0;background:none;color:var(--muted);display:inline-flex;align-items:center;gap:4px;padding:6px 10px;border-radius:999px;font-size:.82em;min-height:34px}
.modes button svg{width:16px;height:16px}
.modes button[aria-selected=true]{background:#E7F1EF;color:var(--primary);font-weight:600}
.modes .detail{margin-left:auto;border:1px solid var(--line)}
.modes .detail[aria-pressed=true]{background:var(--accent);color:#2b1a00;border-color:var(--accent)}
.bar{display:flex;align-items:flex-end;gap:8px}
.bar textarea{flex:1;resize:none;border:1.5px solid var(--line);border-radius:22px;padding:10px 14px;max-height:120px;background:var(--bg);min-height:44px}
.bar textarea:focus{border-color:var(--primary);outline:none}
.send,.mic{width:46px;height:46px;border-radius:50%;border:0;display:grid;place-items:center;flex:none}
.send{background:var(--primary);color:#fff}
.send:disabled{opacity:.5}
.mic{background:var(--accent);color:#2b1a00}
.mic.rec{background:#c0392b;color:#fff;animation:pulse 1.2s infinite}
.send svg,.mic svg{width:22px;height:22px}

/* mode voix : gros bouton micro */
.app.voice .bar textarea{font-size:.9em}
.app.voice .mic{width:60px;height:60px}

/* accueil */
.welcome{position:fixed;inset:0;z-index:40;background:linear-gradient(170deg,var(--primary) 0%,#0a4752 55%,#083a43 100%);color:#fff;overflow-y:auto}
.w-inner{max-width:520px;margin:0 auto;padding:max(24px,env(safe-area-inset-top)) 20px 28px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px}
.avatar-welcome{width:130px;height:143px}
.avatar-welcome svg{width:100%;height:100%}
.welcome h1{margin:0;font-size:1.6em}
.w-tag{margin:0;opacity:.9;max-width:44ch}
.w-langs{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%}
.w-langs button{border:2px solid rgba(255,255,255,.45);background:rgba(255,255,255,.08);color:#fff;border-radius:14px;padding:12px 6px;min-height:52px}
.w-langs button[aria-pressed=true]{background:#fff;color:var(--primary);border-color:#fff}
.w-place{width:100%;background:rgba(255,255,255,.1);border-radius:16px;overflow:hidden;text-align:left}
.w-place img{width:100%;aspect-ratio:16/8;object-fit:cover;display:block}
.w-place div{padding:10px 14px}
.w-place small{text-transform:uppercase;letter-spacing:.05em;color:#ffd79a;font-weight:700;font-size:.72em}
.w-place h2{margin:.1em 0 .3em;font-size:1.1em}
.w-place p{margin:0;font-size:.9em;opacity:.92}
.w-profile-q{margin:6px 0 0;font-weight:600}
.w-profiles{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.w-profiles button{border:1.5px solid rgba(255,255,255,.5);background:none;color:#fff;border-radius:999px;padding:8px 14px;min-height:40px}
.w-profiles button[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:#2b1a00;font-weight:600}
.primary{background:var(--accent);color:#2b1a00;border:0;border-radius:14px;padding:14px 22px;font-weight:700;min-height:50px;font-size:1.05em}
.primary:disabled{opacity:.5}
.w-go{width:100%;margin-top:6px}
.w-legal{font-size:.75em;opacity:.8;margin:4px 0 0}
.w-legal a{color:#fff}
.secondary{display:flex;align-items:center;gap:8px;justify-content:center;width:100%;border:1.5px solid var(--primary);background:var(--surface);color:var(--primary);border-radius:14px;padding:11px;font-weight:600;min-height:46px;margin-top:8px}
.secondary svg{width:20px;height:20px}

/* panneaux */
.sheet{position:fixed;inset:0;z-index:50;background:rgba(5,25,30,.45);display:flex;align-items:flex-end;justify-content:center}
.sheet-inner{background:var(--surface);width:100%;max-width:760px;max-height:88dvh;overflow-y:auto;border-radius:20px 20px 0 0;padding:6px 16px calc(18px + env(safe-area-inset-bottom));animation:up .22s ease-out}
.sheet.full .sheet-inner{height:92dvh;display:flex;flex-direction:column}
.sheet-head{display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:var(--surface);z-index:2}
.sheet h2{margin:8px 0;font-size:1.15em}
.sheet h3{margin:14px 0 8px;font-size:.95em;color:var(--primary)}
.sheet section{border-top:1px solid var(--line);padding-bottom:6px}
.sheet select{width:100%;padding:10px;border-radius:12px;border:1.5px solid var(--line);background:var(--bg);min-height:44px}
.row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;min-height:44px}
.row input[type=checkbox]{width:24px;height:24px;accent-color:var(--primary)}
.seg{display:flex;align-items:center;gap:4px}
.seg button{border:1.5px solid var(--line);background:var(--bg);border-radius:10px;min-width:44px;min-height:40px;font-weight:700}
.seg output{min-width:36px;text-align:center}
.poi-list{list-style:none;margin:10px 0 0;padding:0;counter-reset:p}
.poi-list li{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--line)}
.poi-list li::before{counter-increment:p;content:counter(p);width:28px;height:28px;border-radius:50%;background:var(--primary);color:#fff;display:grid;place-items:center;font-size:.85em;font-weight:700;flex:none}
.poi-list li.here::before{background:var(--accent);color:#2b1a00}
.poi-list span{flex:1}
.poi-list button{border:1px solid var(--line);background:var(--bg);border-radius:999px;padding:6px 10px;font-size:.82em;min-height:36px}
.map{flex:1;min-height:300px;border-radius:14px;overflow:hidden;background:#dfe9e7}
.map-src{font-size:.72em;color:var(--muted);margin:4px 0 0}
.stars{display:flex;gap:6px;justify-content:center;margin:8px 0}
.stars button{font-size:2em;background:none;border:0;color:#cbbf9f;min-width:48px;min-height:48px;line-height:1}
.stars button[aria-checked=true]{color:var(--accent)}
#rateComment{width:100%;border:1.5px solid var(--line);border-radius:12px;padding:10px;background:var(--bg)}
.hint{font-size:.78em;color:var(--muted)}
#rateBody .primary{width:100%}

/* avatar Samara */
.samara{stroke:none}
.samara .sm-shadow{fill:rgba(0,0,0,.12);stroke:none}
.samara .sm-body{stroke:none}
.samara .sm-wave{stroke:rgba(255,255,255,.55);stroke-width:3}
.samara .sm-wave.w2{stroke:rgba(255,255,255,.35)}
.samara .sm-pupil{fill:#12343b;stroke:none;transition:transform .3s}
.samara .sm-lid{fill:var(--av1);stroke:none;transition:height .08s}
.samara .sm-brow{stroke:#0a3d46;stroke-width:3.5;transition:transform .3s}
.samara .sm-cheek{fill:#ff8f7e;opacity:.7;stroke:none}
.samara .m{stroke:#0a3d46;stroke-width:3.5;fill:#0a3d46;opacity:0;transition:opacity .05s}
.samara .m-smile{fill:none;opacity:1}
.samara .sm-think circle{fill:#fff;stroke:var(--av2);stroke-width:2;opacity:0}
.samara .sm-float{animation:float 4s ease-in-out infinite;transform-origin:100px 120px}
.samara.blink .sm-lid{height:26px}
.samara.talk .m-smile{opacity:0}
.samara.talk[data-m="1"] .m-o1,.samara.talk[data-m="2"] .m-o2,.samara.talk[data-m="3"] .m-o3,.samara.talk[data-m="4"] .m-ee{opacity:1}
.samara.talk[data-m="0"] .m-smile{opacity:1}
.samara.think .sm-think circle{opacity:1;animation:bub 1.4s infinite}
.samara.think .sm-think circle:nth-child(2){animation-delay:.2s}.samara.think .sm-think circle:nth-child(3){animation-delay:.4s}
.samara.think .sm-pupil{transform:translate(3px,-4px)}
.samara.think .sm-brow.l{transform:translateY(-3px)}
.samara.happy .sm-brow{transform:translateY(-4px)}
.samara.listen .sm-body{filter:drop-shadow(0 0 10px #ffd79a)}

@keyframes float{50%{transform:translateY(-6px)}}
@keyframes bub{50%{transform:translateY(-3px)}}
@keyframes pop{from{opacity:0;transform:translateY(6px)}}
@keyframes up{from{transform:translateY(30px);opacity:.5}}
@keyframes blink{50%{opacity:1}}
@keyframes pulse{50%{box-shadow:0 0 0 8px rgba(192,57,43,.25)}}

/* contraste renforcé */
.hc{--primary:#003640;--primary-2:#003640;--text:#000;--muted:#222;--line:#000;--bg:#fff;--bot:#fff;--accent:#FFB000}
.hc .msg,.hc .card,.hc .chip,.hc .bar textarea{border:2px solid #000}
.hc .src{background:#fff;border:1.5px solid #000;color:#000}
.hc .ai-note,.hc .place{color:#000}
/* sombre */
.dark{--bg:#0f1c1f;--surface:#162629;--bot:#1d3236;--text:#eef5f4;--muted:#a9bcbe;--line:#2b4146;--primary:#3FB6C4;--primary-2:#5fd0dd;--user:#2a7f8c;color-scheme:dark}
.dark .top{background:#0b2e35}
.dark .place,.dark .divider,.dark .src{background:#1d3236;color:#cfe7e5;border-color:#2b4146}
.dark .src.ext{background:#3a2f1c;color:#f3d9a8}
.dark .stage{background:var(--bg)}
.dark .chip{color:var(--primary-2);border-color:var(--primary-2)}

@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media (min-width:761px){.app{box-shadow:0 0 0 1px var(--line)}}

/* page mentions légales */
.legal main{max-width:720px;margin:0 auto;padding:20px}
.legal h1{color:var(--primary)}
.legal h2{font-size:1.05em;color:var(--primary);margin-top:1.4em}
.legal .back{display:inline-block;margin-bottom:10px}
