/* Ali Gator · v228 · Chat de l’atelier : disposition compacte, saisie lisible qui grandit, messages simples, mouvements doux.
   Retour arrière : retirer atelier-chat-v228.css et atelier-chat-v228.js d’index.html. */

/* ---------- En-tête du panneau ---------- */
html:root body aside.assistant-panel > .assistant-tabs{min-height:0!important;height:46px!important;padding:0 10px 0 14px!important}
html:root body aside.assistant-panel > .assistant-tabs > button{height:46px!important;min-height:0!important;font-size:13px!important;
  transition:color .18s ease,background-color .18s ease}

/* ---------- Conversation ---------- */
html:root body aside.assistant-panel > .conversation{padding:16px 16px 14px!important;scroll-behavior:smooth;overscroll-behavior:contain}

/* Accueil : titre et icône sur une ligne, plus de place pour le travail */
html:root body aside.assistant-panel .assistant-intro{display:grid!important;grid-template-columns:30px minmax(0,1fr)!important;column-gap:10px!important;
  row-gap:6px!important;align-items:center!important;margin:0 0 12px!important;padding:0!important;text-align:left!important;
  animation:agch-in .36s cubic-bezier(.2,.8,.2,1) both}
html:root body aside.assistant-panel .assistant-intro > .ai-icon{grid-column:1;grid-row:1;width:30px!important;height:30px!important;min-width:0!important;
  margin:0!important;border-radius:10px!important}
html:root body aside.assistant-panel .assistant-intro > .ai-icon svg{width:16px!important;height:16px!important}
html:root body aside.assistant-panel .assistant-intro > h2{grid-column:2;grid-row:1;margin:0!important;font-size:20px!important;line-height:1.15!important;
  letter-spacing:-.01em!important}
html:root body aside.assistant-panel .assistant-intro > p{grid-column:1 / -1;margin:0!important;font-size:12.5px!important;line-height:1.5!important;color:#5f7864!important}
html:root body aside.assistant-panel .assistant-intro > .document-ready{grid-column:1 / -1;justify-self:start;margin:2px 0 0!important;padding:4px 10px!important;
  min-height:0!important;font-size:11.5px!important;border-radius:999px!important}

/* Suggestions : pastilles fines qui réagissent au survol */
html:root body aside.assistant-panel .suggestions{display:flex!important;flex-direction:column!important;gap:6px!important;margin:0 0 12px!important}
html:root body aside.assistant-panel .suggestions > button{min-height:36px!important;height:auto!important;padding:7px 12px!important;gap:9px!important;border-radius:12px!important;
  font-size:12.5px!important;animation:agch-in .36s cubic-bezier(.2,.8,.2,1) both;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background-color .16s ease!important}
html:root body aside.assistant-panel .suggestions > button:nth-child(2){animation-delay:.05s}
html:root body aside.assistant-panel .suggestions > button:nth-child(3){animation-delay:.1s}
html:root body aside.assistant-panel .suggestions > button:hover:enabled{transform:translateY(-1px);border-color:#bcd6ac!important;
  box-shadow:0 8px 18px -12px rgba(23,68,47,.4)!important}
html:root body aside.assistant-panel .suggestions > button:active:enabled{transform:scale(.985)}

/* Remarques d’analyse : discrètes */
html:root body aside.assistant-panel .document-warnings{margin:0 0 12px!important}
html:root body aside.assistant-panel .document-warnings > summary{font-size:11.5px!important;color:#7a8a6f!important;cursor:pointer}
html:root body aside.assistant-panel .document-warnings > p{margin:6px 0 0!important;font-size:12px!important;line-height:1.45!important;color:#66795f!important}

/* Messages : bulle à droite pour vous, texte simple pour l’assistant */
html:root body aside.assistant-panel .chat-entry{margin:0 0 10px!important;animation:agch-in .32s cubic-bezier(.2,.8,.2,1) both}
html:root body aside.assistant-panel .chat-entry.user{display:flex!important;justify-content:flex-end!important;padding:0!important;background:none!important;border:0!important}
html:root body aside.assistant-panel .chat-entry.user > p{max-width:88%;margin:0!important;padding:9px 13px!important;border:1px solid #d6e8c6!important;
  border-radius:16px 16px 5px 16px!important;background:#ecf6e2!important;color:#1f3d2b!important;font-size:13px!important;line-height:1.5!important;
  white-space:pre-wrap;overflow-wrap:anywhere;box-shadow:0 1px 2px rgba(23,68,47,.05)}
html:root body aside.assistant-panel .chat-entry.assistant > p{font-size:13px!important;line-height:1.55!important}

/* ---------- Proposition : l’essentiel d’abord ---------- */
html:root body aside.assistant-panel .proposal-card{margin:4px 0 0!important;padding:14px 14px 0!important;border:1px solid #d9e7cf!important;border-radius:18px!important;
  background:#fff!important;box-shadow:0 14px 34px -26px rgba(23,68,47,.55)!important;animation:agch-rise .42s cubic-bezier(.2,.8,.2,1) both}
html:root body aside.assistant-panel .proposal-card > *{animation:agch-in .36s cubic-bezier(.2,.8,.2,1) both}
html:root body aside.assistant-panel .proposal-card > :nth-child(2){animation-delay:.04s}
html:root body aside.assistant-panel .proposal-card > :nth-child(3){animation-delay:.08s}
html:root body aside.assistant-panel .proposal-card > :nth-child(4){animation-delay:.12s}
html:root body aside.assistant-panel .proposal-card > :nth-child(5){animation-delay:.16s}
html:root body aside.assistant-panel .proposal-card > :nth-child(n+6){animation-delay:.2s}
html:root body aside.assistant-panel .proposal-heading{margin:0 0 6px!important}
html:root body aside.assistant-panel .proposal-heading .eyebrow{font-size:9.5px!important;letter-spacing:.09em!important}
html:root body aside.assistant-panel .proposal-heading h3{margin:1px 0 0!important;font-size:15px!important;line-height:1.25!important}
html:root body aside.assistant-panel .proposal-summary{margin:0 0 10px!important;font-size:12.5px!important;line-height:1.45!important;color:#5c735f!important}
html:root body aside.assistant-panel .proposal-card > .plan-tabs{display:none!important}
html:root body aside.assistant-panel .diff-list{display:flex!important;flex-direction:column!important;gap:6px!important;margin:0 0 10px!important}
html:root body aside.assistant-panel .diff-list > .diff-item{height:auto!important;padding:10px 12px!important;border-radius:14px!important;
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease!important}
html:root body aside.assistant-panel .diff-list > .diff-item:hover{transform:translateY(-1px);box-shadow:0 8px 18px -14px rgba(23,68,47,.45)!important}
html:root body aside.assistant-panel .diff-item .before-text{margin-top:6px!important;font-size:12px!important;color:#8b9a89!important}
html:root body aside.assistant-panel .diff-item .before-text > span{text-decoration:line-through;text-decoration-color:rgba(139,154,137,.6)}
html:root body aside.assistant-panel .diff-item .after-text{margin-top:4px!important;font-size:13px!important;font-weight:600!important;color:#1f3d2b!important}
html:root body aside.assistant-panel .diff-item .geometry-change{margin-top:6px!important;font-size:11px!important;color:#738373!important}
html:root body aside.assistant-panel .diff-item > p{margin:6px 0 0!important;font-size:11.5px!important;line-height:1.4!important;color:#738373!important}

html:root body:not(#agch) aside.assistant-panel [data-agch-hide],
html:root body:not(#agch) aside.assistant-panel [data-agch-dup],
html:root body:not(#agch) aside.assistant-panel .proposal-card > .transmission{display:none!important}

/* Points à corriger : une ligne par problème, en clair */
html:root body aside.assistant-panel .proposal-warnings{display:flex!important;flex-direction:column!important;gap:6px!important;margin:0 0 10px!important;padding:0!important;
  border:0!important;background:none!important;box-shadow:none!important}
html:root body aside.assistant-panel .proposal-warnings > div{display:flex!important;align-items:flex-start!important;gap:8px!important;margin:0!important;padding:8px 11px!important;
  border:1px solid #efe2c4!important;border-radius:12px!important;background:#fcf7ea!important;color:#7a5a2b!important;font-size:12.5px!important;line-height:1.45!important}
html:root body aside.assistant-panel .proposal-warnings > div > svg{flex:none;margin-top:2px}
html:root body aside.assistant-panel .proposal-warnings > div.blocking{border-color:#f1d2c8!important;background:#fdf1ed!important;color:#9a3a26!important}
html:root body aside.assistant-panel .proposal-warnings > div[data-agch-level="info"]{border-color:#e3ecd9!important;background:#f5f9f0!important;color:#5f7864!important}

/* Contrôles : une seule ligne d’état, détails sur demande */
html:root body aside.assistant-panel .render-report[data-agch-fold]{gap:8px!important;margin:0 0 10px!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important}
html:root body aside.assistant-panel .render-report[data-agch-fold] > strong{display:none!important}
html:root body aside.assistant-panel .render-report[data-agch-fold="closed"] > :not(.agch-checks):not(.proposal-paused):not(.cleanup-report):not(button){display:none!important}
html:root body aside.assistant-panel .render-report[data-agch-fold="open"] > :not(.agch-checks){animation:agch-in .28s cubic-bezier(.2,.8,.2,1) both}
html:root body aside.assistant-panel .render-report[data-agch-fold="open"] > p{font-size:12px!important;line-height:1.45!important}
html:root body aside.assistant-panel .agch-checks{display:flex;align-items:center;gap:9px;width:100%;min-height:36px;margin:0;padding:7px 12px;border:1px solid #e1ead9;
  border-radius:12px;background:#f8fbf4;color:#2f5139;font:inherit;font-size:12.5px;font-weight:600;text-align:left;cursor:pointer;
  transition:background-color .16s ease,border-color .16s ease,transform .16s ease}
html:root body aside.assistant-panel .agch-checks[hidden]{display:none}
html:root body aside.assistant-panel .agch-checks:hover{background:#f1f7ea;border-color:#d3e3c6}
html:root body aside.assistant-panel .agch-checks:active{transform:scale(.99)}
html:root body aside.assistant-panel .agch-checks > .agch-dot{flex:none;width:8px;height:8px;border-radius:50%;background:#9db08f;box-shadow:0 0 0 3px rgba(157,176,143,.2)}
html:root body aside.assistant-panel .agch-checks[data-state="ok"] > .agch-dot{background:#5fa743;box-shadow:0 0 0 3px rgba(95,167,67,.18)}
html:root body aside.assistant-panel .agch-checks[data-state="warn"] > .agch-dot{background:#d89a2b;box-shadow:0 0 0 3px rgba(216,154,43,.18)}
html:root body aside.assistant-panel .agch-checks[data-state="error"]{border-color:#f1d2c8;background:#fdf4f1;color:#9a3a26}
html:root body aside.assistant-panel .agch-checks[data-state="error"] > .agch-dot{background:#d0543a;box-shadow:0 0 0 3px rgba(208,84,58,.18)}
html:root body aside.assistant-panel .agch-checks > .agch-label{flex:1 1 auto;min-width:0}
html:root body aside.assistant-panel .agch-checks > .agch-more{flex:none;display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:500;color:#7a8b79}
html:root body aside.assistant-panel .agch-checks > .agch-more::after{content:"";width:6px;height:6px;margin-top:-3px;border-right:1.5px solid currentColor;
  border-bottom:1.5px solid currentColor;transform:rotate(45deg);transition:transform .2s ease,margin .2s ease}
html:root body aside.assistant-panel .agch-checks[aria-expanded="true"] > .agch-more::after{transform:rotate(-135deg);margin-top:3px}

/* Boutons de décision toujours visibles en bas de la carte */
html:root body aside.assistant-panel .proposal-actions{position:sticky!important;bottom:0!important;z-index:2;margin:0 -14px!important;padding:10px 14px 12px!important;
  border-radius:0 0 18px 18px;background:linear-gradient(180deg,rgba(255,255,255,.7),#fff 26%)!important;
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
html:root body aside.assistant-panel .proposal-actions .button.primary,
html:root body aside.assistant-panel .proposal-actions .button.accept-warning{min-height:42px!important;border-radius:13px!important;
  transition:transform .15s ease,filter .15s ease,box-shadow .15s ease!important}
html:root body aside.assistant-panel .proposal-actions .button.primary:hover:enabled,
html:root body aside.assistant-panel .proposal-actions .button.accept-warning:hover:enabled{transform:translateY(-1px);filter:brightness(1.05)}
html:root body aside.assistant-panel .proposal-actions .button:active:enabled{transform:scale(.98)}
html:root body aside.assistant-panel .proposal-actions .row{margin-top:6px!important;gap:6px!important}
html:root body aside.assistant-panel .proposal-actions .button.quiet{min-height:34px!important;height:34px!important;border-radius:10px!important;font-size:12.5px!important;
  transition:background-color .15s ease,color .15s ease!important}

/* Bloc sélectionné : carte nette */
html:root body aside.assistant-panel > .block-inspector{margin:0 14px 10px!important;padding:10px 12px 8px!important;border:1px solid #d9e7cf!important;border-radius:16px!important;
  background:#fbfdf8!important;box-shadow:0 10px 26px -22px rgba(23,68,47,.5)!important;animation:agch-rise .3s cubic-bezier(.2,.8,.2,1) both}
html:root body aside.assistant-panel > .block-inspector > textarea{display:block;width:100%!important;box-sizing:border-box!important;min-height:40px!important;margin:6px 0 4px!important;
  padding:9px 11px!important;border-radius:12px!important;font-size:13.5px!important;line-height:1.5!important;resize:none!important;transition:height .16s ease,border-color .16s ease,box-shadow .16s ease}

/* ---------- Zone de saisie ---------- */
html:root body aside.assistant-panel > .composer-area{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:8px!important;
  padding:10px 14px 14px!important;border-top:1px solid #e4ecdf!important;background:linear-gradient(180deg,#fbfdf8,#fff)!important}
html:root body aside.assistant-panel > .composer-area > *{order:7;flex:1 1 100%!important;min-width:0!important;margin:0!important}
html:root body aside.assistant-panel > .composer-area > .single-smart{order:1}
html:root body aside.assistant-panel > .composer-area > :is(.composer-tools,.composer-caption){display:contents!important}
html:root body aside.assistant-panel > .composer-area > .composer-tools > label{order:2;flex:0 1 auto!important;min-width:0}
html:root body aside.assistant-panel > .composer-area > .composer-caption > label{order:3;flex:0 1 auto!important;min-width:0}
html:root body aside.assistant-panel > .composer-area > .composer-tools > .icon-button{order:4;flex:none!important;margin-left:auto!important}
html:root body aside.assistant-panel > .composer-area > :is(form.composer,.json-editor){order:5}
html:root body aside.assistant-panel > .composer-area > .configure-link{order:6;justify-content:center!important}

/* Mode intelligent : une ligne fine */
html:root body aside.assistant-panel > .composer-area > .single-smart{padding:2px 8px 2px 10px!important;border-radius:12px!important;min-height:0!important}
html:root body aside.assistant-panel .single-smart-heading{min-height:0!important}
html:root body aside.assistant-panel .single-smart-disclosure{min-height:26px!important}
html:root body aside.assistant-panel .single-smart-disclosure strong{font-size:12.5px!important}
html:root body aside.assistant-panel .single-smart.is-enabled .single-smart-disclosure > strong::after{content:"enregistre tout seul";margin-left:8px;padding:2px 7px;
  border-radius:999px;background:#e5f3d5;color:#3c6b2c;font-size:10.5px;font-weight:600;vertical-align:1px}

/* Outils : petites pastilles sur une ligne (périmètre, rendu, plan JSON) */
html:root body aside.assistant-panel .composer-tools > label,
html:root body aside.assistant-panel .composer-caption > label{display:inline-flex!important;align-items:center!important;gap:5px!important;height:28px;padding:0 3px 0 9px!important;
  border:1px solid #e1eadb;border-radius:999px;background:#fff;color:#56705a!important;font-size:11px!important;white-space:nowrap;overflow:hidden;
  transition:border-color .15s ease,background-color .15s ease}
html:root body aside.assistant-panel .composer-tools > label:hover,
html:root body aside.assistant-panel .composer-caption > label:hover{border-color:#c9dcbc;background:#f8fbf4}
html:root body aside.assistant-panel :is(.composer-tools,.composer-caption) select{min-width:0!important;height:26px!important;min-height:0!important;padding:0 16px 0 2px!important;
  border:0!important;background-color:transparent!important;box-shadow:none!important;font-size:11px!important;color:#2f5139!important;text-overflow:ellipsis;cursor:pointer}
html:root body aside.assistant-panel .composer-tools select{width:128px!important;max-width:100%!important}
html:root body aside.assistant-panel .composer-caption select{width:80px!important;max-width:100%!important}
html:root body aside.assistant-panel .composer-tools > .icon-button{width:28px!important;height:28px!important;min-height:0!important;border-radius:9px!important;
  transition:background-color .15s ease,color .15s ease,transform .15s ease!important}
html:root body aside.assistant-panel .composer-tools > .icon-button:hover{transform:translateY(-1px)}
html:root body aside.assistant-panel .composer-caption > span{display:none!important}

/* La bulle : texte en haut, envoi en bas à droite, contour qui s’allume */
html:root body aside.assistant-panel form.composer{display:flex!important;flex-direction:column!important;gap:0!important;height:auto!important;min-height:0!important;padding:0!important;
  border:1px solid #cfe0c6!important;border-radius:20px!important;background:#fff!important;overflow:hidden!important;
  box-shadow:0 1px 2px rgba(23,68,47,.05),0 10px 26px -20px rgba(23,68,47,.35)!important;transition:border-color .2s ease,box-shadow .25s ease!important}
html:root body aside.assistant-panel form.composer:focus-within{border-color:#86b664!important;
  box-shadow:0 0 0 3px rgba(120,176,67,.18),0 12px 30px -20px rgba(23,68,47,.45)!important}
html:root body aside.assistant-panel form.composer > textarea{display:block!important;flex:none!important;width:100%!important;box-sizing:border-box!important;height:46px;
  min-height:46px!important;max-height:none!important;margin:0!important;padding:12px 16px 4px!important;border:0!important;border-radius:0!important;outline:0!important;
  background:transparent!important;box-shadow:none!important;color:#1d3b2a!important;font-size:14px!important;line-height:1.5!important;resize:none!important;
  overflow-y:hidden;transition:height .16s ease}
html:root body:not(#agch) aside.assistant-panel form.composer > textarea:is(:focus,:focus-visible,:hover){outline:0!important;box-shadow:none!important;border:0!important;background:transparent!important}
html:root body aside.assistant-panel form.composer > textarea::placeholder{color:#8a9a88!important;opacity:1}
html:root body aside.assistant-panel form.composer > textarea:disabled{color:#7d8c7b!important;cursor:not-allowed}
html:root body aside.assistant-panel form.composer > .composer-bottom{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;
  height:auto!important;min-height:0!important;margin:0!important;padding:2px 8px 8px 14px!important;border:0!important;background:none!important}
html:root body aside.assistant-panel form.composer > .composer-bottom > span{display:inline-flex!important;align-items:center!important;gap:5px!important;min-width:0;
  overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:11px!important;color:#7a8b79!important}
html:root body aside.assistant-panel form.composer .send-button{flex:none!important;display:grid!important;place-items:center!important;width:34px!important;height:34px!important;
  min-height:0!important;padding:0!important;border:0!important;border-radius:12px!important;background:#1f5a3b!important;color:#f2ffe0!important;
  box-shadow:0 4px 12px -4px rgba(23,68,47,.55)!important;cursor:pointer;
  transition:background-color .18s ease,box-shadow .18s ease,transform .15s ease,opacity .18s ease!important}
html:root body aside.assistant-panel form.composer .send-button:enabled{animation:agch-pop .32s cubic-bezier(.2,.8,.2,1)}
html:root body aside.assistant-panel form.composer .send-button:hover:enabled{background:#17442f!important;transform:translateY(-1px)}
html:root body aside.assistant-panel form.composer .send-button:hover:enabled svg{transform:translateY(-1px)}
html:root body aside.assistant-panel form.composer .send-button:active:enabled{transform:scale(.93)}
html:root body aside.assistant-panel form.composer .send-button svg{transition:transform .18s ease}
html:root body aside.assistant-panel form.composer .send-button:disabled{background:#e6ede1!important;color:#9aab98!important;box-shadow:none!important;cursor:default}
html:root body aside.assistant-panel > .composer-area > .configure-link{font-size:11.5px!important}

@keyframes agch-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes agch-rise{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
@keyframes agch-pop{0%{transform:scale(.86)}60%{transform:scale(1.06)}100%{transform:scale(1)}}
@media (prefers-reduced-motion:reduce){
  html:root body aside.assistant-panel :is(.assistant-intro,.suggestions > button,.chat-entry,.proposal-card,.proposal-card > *,.block-inspector,.send-button,.render-report > *){
    animation:none!important;transition-duration:.01s!important}
  html:root body aside.assistant-panel form.composer > textarea{transition:none!important}
}
