:root{--brand:#aa161b;--text:#1d2939;--muted:#64748b;--line:#e2e7ee}*{box-sizing:border-box}html,body{margin:0;height:100%;font:14px/1.55 system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:var(--text);background:#fff}.pivot-shell{display:flex;flex-direction:column;height:100dvh;min-height:340px;position:relative}.pivot-header{display:flex;gap:12px;align-items:center;background:var(--brand);color:#fff;padding:15px;min-height:82px}.pivot-avatar{display:grid;place-items:center;background:#ffffff25;border:1px solid #ffffff40;border-radius:15px;width:42px;height:42px;font-size:25px}.pivot-header div:nth-child(2){flex:1;min-width:0}.pivot-header strong{font-size:15px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pivot-header span{display:block;font-size:11px;opacity:.87}.pivot-status{width:8px;height:8px;background:#7fffb0;box-shadow:0 0 0 3px #ffffff24;border-radius:50%}.pivot-mode{font-size:11px;padding:7px 13px;color:#718096;border-bottom:1px solid var(--line)}.pivot-mode b{color:var(--text)}.pivot-log{flex:1;min-height:0;overflow-y:auto;padding:15px;display:flex;flex-direction:column;gap:11px;background:linear-gradient(180deg,#f8fafc 0%,#fff 95%)}.bubble{max-width:88%;align-self:flex-start;border-radius:16px 16px 16px 3px;padding:11px 13px;line-height:1.5;background:#fff;border:1px solid var(--line);box-shadow:0 2px 10px #14223806;white-space:pre-wrap;overflow-wrap:anywhere}.bubble.me{align-self:flex-end;background:var(--brand);color:#fff;border-color:var(--brand);border-radius:16px 16px 3px 16px}.bubble.wait{opacity:.66}.pivot-actions{display:flex;gap:7px;overflow-x:auto;padding:8px 13px;flex-shrink:0}.suggest{background:#fff;border:1px solid #d9e0ec;color:#374151;padding:7px 10px;border-radius:999px;white-space:nowrap;font:12px system-ui;cursor:pointer}.pivot-composer{padding:8px 10px 4px}.pivot-composer form{display:flex;gap:8px}.pivot-composer input{min-width:0;flex:1;border:1px solid #d5dce5;border-radius:12px;padding:12px;background:#fff;font:inherit}.pivot-composer button{background:var(--brand);color:#fff;border:0;border-radius:12px;width:42px;font-weight:800;cursor:pointer}.pivot-composer input:disabled,.pivot-composer button:disabled{opacity:.5;cursor:wait}.pivot-ai-consent{background:#f5f7fc;border-top:1px solid var(--line);padding:8px 12px;font-size:11px;color:#334155}.pivot-ai-consent label{display:flex;gap:7px;align-items:start}.pivot-ai-consent input{accent-color:var(--brand);margin-top:3px}.pivot-ai-consent small{display:block;color:var(--muted);margin:3px 0 0 23px}.pivot-footer{display:flex;align-items:center;gap:7px;padding:8px 10px 11px;flex-wrap:wrap}.pivot-footer button{background:#fff;color:var(--brand);border:1px solid #e1d5d6;border-radius:8px;padding:6px 8px;font:600 11px system-ui;cursor:pointer}.pivot-footer small{margin-left:auto;color:var(--muted);font-size:10px}.pivot-unavailable{padding:30px}.pivot-modal{position:absolute;inset:0;background:#0f172ab5;z-index:10;display:grid;place-items:center;padding:12px}.pivot-modal[hidden]{display:none!important}.pivot-dialog{position:relative;border-radius:16px;background:#fff;padding:20px;box-shadow:0 20px 45px #0003;width:min(100%,410px);max-height:calc(100% - 20px);overflow-y:auto}.pivot-dialog h2{font-size:18px;margin:0 0 6px}.pivot-dialog p{font-size:12px;color:var(--muted);margin:0 0 12px}.pivot-dialog label{font-size:12px;display:block;font-weight:600;margin:8px 0}.pivot-dialog input:not([type=checkbox]),.pivot-dialog textarea{display:block;width:100%;font:13px system-ui;border:1px solid var(--line);padding:9px 11px;border-radius:8px;margin-top:3px}.pivot-dialog .check{display:flex;align-items:flex-start;gap:7px;font-weight:400}.pivot-dialog .check input{margin-top:3px;accent-color:var(--brand)}.pivot-dialog button[type=submit]{background:var(--brand);color:#fff;border:0;border-radius:9px;padding:10px 13px;font-weight:700;cursor:pointer}.pivot-dialog button:disabled{opacity:.55}.pivot-dialog .close{position:absolute;right:10px;top:8px;background:none;border:0;font-size:27px;color:var(--muted);cursor:pointer}.pivot-dialog .form-status{margin-top:9px;color:#334155;font-size:12px}.honeypot{position:absolute!important;left:-9999px!important;opacity:0!important}@media(max-height:550px){.pivot-header{min-height:64px;padding:10px}.pivot-actions{padding-block:4px}.pivot-log{padding:9px}.bubble{padding:8px 10px}}

/* V2.2 — indicateur de rédaction du conseiller, réduit pour l'accessibilité. */
.bubble.wait{display:flex;gap:10px;align-items:center;min-width:165px;min-height:44px;opacity:1;color:var(--muted)}
.pivot-typing-dots{display:inline-flex;align-items:center;gap:4px;flex:none}
.pivot-typing-dots i{display:block;width:6px;height:6px;background:var(--brand);border-radius:50%;animation:pivotTypingDot 1s infinite ease-in-out}
.pivot-typing-dots i:nth-child(2){animation-delay:.15s}
.pivot-typing-dots i:nth-child(3){animation-delay:.3s}
.pivot-typing-label{font-size:11px}
@keyframes pivotTypingDot{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}
@media(prefers-reduced-motion:reduce){.pivot-typing-dots i{animation:none;opacity:.65}}

/* V2.3 — choix cliquables sous chaque question, visibles sur mobile. */
.pivot-quick-answers{align-self:flex-start;display:flex;flex-wrap:wrap;gap:7px;max-width:92%;padding:0 0 6px 3px}
.pivot-quick-answers button{font:600 12px/1.3 system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:var(--brand);border:1px solid #e2bdc0;background:#fff;border-radius:999px;padding:9px 12px;cursor:pointer;min-height:34px;transition:background .15s}
.pivot-quick-answers button:hover,.pivot-quick-answers button:focus-visible{background:#fff0f0;outline:2px solid transparent;border-color:var(--brand)}
.pivot-quick-answers button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:450px){.pivot-quick-answers{max-width:100%}.pivot-quick-answers button{padding:9px 11px;font-size:12px}}


/* V2.4 – Conversation façon messagerie : logo réel, identité de l'assistant virtuel,
   bulles à largeur contrôlée sur grand écran, responsive sans dépendance externe. */
html,body{background:#eff2f6}
.pivot-shell{width:min(100%,940px);margin:0 auto;height:100dvh;min-height:340px;background:#fff;box-shadow:0 0 0 1px #dce3eb,0 15px 55px #16253b12}
.pivot-header{min-height:74px;padding:12px 18px;gap:12px;box-shadow:0 3px 12px #16253b14;z-index:1}
.pivot-avatar{background:#fff;border:2px solid #fff4;width:49px;height:49px;min-width:49px;border-radius:50%;overflow:hidden;font-size:22px;flex:none}
.pivot-avatar img{display:block;width:100%;height:100%;object-fit:contain;padding:3px}
.pivot-avatar-fallback{place-items:center;width:100%;height:100%;background:#fff;color:#27354b}
.pivot-header-identity{min-width:0;flex:1}
.pivot-header-identity strong{font-size:17px;line-height:1.3}
.pivot-header-identity span{font-size:11px;display:block;white-space:normal;line-height:1.35}
.pivot-mode{background:#fff;font-size:10px;color:#78839a;padding:5px 16px;text-align:center}
.pivot-log{background-color:#f4f6fa;background-image:radial-gradient(#dbe2ec55 1px,transparent 1px);background-size:23px 23px;gap:13px;padding:19px 17px 22px;scroll-behavior:smooth}
.pivot-message{display:flex;align-items:flex-end;gap:8px;width:100%}
.pivot-message-bot{justify-content:flex-start}
.pivot-message-me{justify-content:flex-end}
.pivot-msg-avatar{width:31px;height:31px;min-width:31px;border-radius:50%;background:#fff;border:1px solid #d7e0ea;display:grid;place-items:center;overflow:hidden;box-shadow:0 1px 4px #12213b10;margin-bottom:3px}
.pivot-msg-avatar img{width:100%;height:100%;object-fit:contain;padding:3px}
.pivot-msg-avatar-fallback{font-size:16px}
.pivot-message-content{max-width:min(72%,560px);min-width:0}
.bubble{max-width:100%;background:#fff;border:1px solid #e3e8ef;border-radius:16px 16px 16px 5px;padding:11px 14px;box-shadow:0 2px 8px #1422380d;font-size:13.5px;line-height:1.57}
.bubble.me{background:var(--brand);color:#fff;border-color:var(--brand);border-radius:16px 16px 5px 16px;box-shadow:0 3px 10px #90151b22}
.pivot-message-content .bubble.wait{width:max-content;max-width:100%}
.pivot-quick-answers{padding-left:40px;max-width:min(90%,600px);gap:7px}
.pivot-quick-answers button{box-shadow:0 1px 4px #12213b08;background:#fff}
.pivot-composer{padding:11px 15px 7px;background:#fff;border-top:1px solid #e6e9ef}
.pivot-composer input{border-radius:24px;min-height:46px;padding:11px 17px;background:#f7f8fb;border:1px solid #dfe5ee;outline-offset:2px}
.pivot-composer button{border-radius:50%;width:45px;height:45px;flex:none;font-size:19px}
.pivot-footer{padding:3px 15px 12px;background:#fff}
.pivot-footer button{border-radius:999px;padding:7px 12px}
.pivot-footer small{font-size:10px}
.pivot-dialog{border-radius:20px;box-shadow:0 25px 65px #11182755}
.pivot-dialog h2{color:#1f2937}
.pivot-status{flex:none}
@media(max-width:650px){
 html,body,.pivot-shell{width:100%;height:100dvh;max-width:none;box-shadow:none}
 .pivot-header{min-height:67px;padding:10px 12px}
 .pivot-avatar{width:43px;height:43px;min-width:43px}
 .pivot-log{padding:13px 9px}
 .pivot-message-content{max-width:min(84%,470px)}
 .pivot-msg-avatar{width:27px;height:27px;min-width:27px}
 .bubble{font-size:13px;padding:10px 12px}
 .pivot-quick-answers{padding-left:35px;max-width:100%}
 .pivot-composer{padding:8px 9px 5px}
 .pivot-footer{padding:2px 10px 9px}
}
@media(prefers-reduced-motion:reduce){.pivot-log{scroll-behavior:auto}}

/* Adam V2.5 — Récapitulatif clair, édition des choix et consentement. */
.pivot-summary-content{max-width:min(86%,565px)}
.pivot-summary-card,.pivot-review-box{background:#fff;border:1px solid #dce4ee;border-radius:17px;padding:15px;box-shadow:0 2px 12px #15243a0d}
.pivot-summary-card{font-size:13px}
.pivot-summary-title{display:block;font-size:14px;margin-bottom:8px;color:#20314b}
.pivot-summary-values{display:grid;grid-template-columns:1fr;gap:0}
.pivot-summary-row{display:grid;grid-template-columns:minmax(100px,43%) 1fr;gap:7px;padding:7px 0;border-bottom:1px solid #edf0f5;align-items:start;font-size:12px}
.pivot-summary-row:last-child{border-bottom:0}
.pivot-summary-row>span{color:#66758a}
.pivot-summary-row>strong{font-weight:650;color:#1e293b;overflow-wrap:anywhere}
.pivot-summary-card>p,.pivot-review-warning{color:#697a90;font-size:11px;line-height:1.5;margin:12px 0 10px}
.pivot-summary-actions{display:flex;flex-wrap:wrap;gap:8px}
.pivot-summary-actions button{border:1px solid #d6e0eb;background:#f9fafc;color:#24364e;font:600 12px system-ui;border-radius:10px;padding:9px 10px;cursor:pointer}
.pivot-summary-actions button:last-child{border-color:var(--brand);background:var(--brand);color:#fff}
.pivot-summary-actions button:focus-visible{outline:2px solid #245e9d;outline-offset:2px}
.pivot-dialog{width:min(100%,530px);padding:20px 22px;max-height:calc(100dvh - 24px)}
.pivot-dialog h2{padding-right:22px;font-size:19px}
.pivot-dialog h3{font-size:14px;line-height:1.4;color:#26364b;margin:0 0 10px}
.pivot-review-box{background:#f8fafd;box-shadow:none;border-radius:13px;padding:13px;margin:13px 0}
.pivot-review-box .pivot-summary-row{grid-template-columns:minmax(88px,39%) 1fr}
.pivot-review-warning{margin:10px 0 0}
.pivot-review-edit{border:1px solid #dce4ef;border-radius:12px;background:#fff;padding:0 12px;margin:12px 0}
.pivot-review-edit summary{padding:12px 2px;cursor:pointer;font:650 13px system-ui;color:var(--brand)}
.pivot-review-edit summary:focus-visible{outline:2px solid #284773;outline-offset:2px}
.pivot-edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:2px 12px;padding:2px 0 14px}
.pivot-edit-grid label{font-size:12px;margin:6px 0}
.pivot-edit-grid input,.pivot-edit-grid select{width:100%;display:block;margin-top:5px;padding:9px 8px;border:1px solid #d7e0eb;border-radius:8px;background:#fff;color:#202f41;font:13px system-ui;min-height:40px}
.pivot-contact-heading{margin-top:17px!important}
.pivot-contact-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.pivot-contact-grid label{min-width:0}
.pivot-dialog button[type=submit]{width:100%;min-height:43px;border-radius:11px}
@media(max-width:550px){
 .pivot-dialog{padding:16px 14px;border-radius:14px;width:100%;max-height:calc(100dvh - 12px)}
 .pivot-summary-content{max-width:calc(100% - 36px)}
 .pivot-summary-card{padding:12px}
 .pivot-edit-grid,.pivot-contact-grid{grid-template-columns:1fr}
 .pivot-summary-row{grid-template-columns:36% 1fr}
 .pivot-footer{gap:6px}
 .pivot-footer button{padding:8px 10px;font-size:10px}
 .pivot-footer small{flex-basis:100%;text-align:right}
}
