/* n 1305 - Le panneau de conversation, ancre a droite du plan de travail.
   Sur grand ecran il prend une colonne de la grille `.shell` : le plan de
   travail se resserre et rien n'est recouvert. Sous 700 px il prend l'ecran. */
.chat-ouvrir[aria-expanded="true"]{background:#252119;color:#fff}
.shell.chat-ouvert{grid-template-columns:var(--app-sidebar-width,220px) minmax(0,1fr) 380px}
.chat-panneau{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;min-width:0;background:var(--panel);border-left:1px solid var(--line);color:var(--ink)}
.chat-entete{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 16px 12px;border-bottom:1px solid var(--line)}
.chat-titre{margin:0;font:700 17px Manrope}
.chat-entete-actions{display:flex;align-items:center;gap:6px}
.chat-fermer,.chat-nouvelle{width:34px;height:34px;border-radius:8px}
.chat-fermer svg,.chat-nouvelle svg,.chat-joindre svg,.chat-envoyer svg{width:18px;height:18px}
.chat-fil{flex:1 1 auto;min-height:0;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px}
.chat-accueil{margin:auto 0;color:var(--muted);font-size:14px;line-height:1.55;text-align:center}
.chat-bulle{max-width:92%;padding:10px 13px;border-radius:14px;font-size:14px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
.chat-bulle-user{align-self:flex-end;background:rgba(216,168,78,.16);border:1px solid rgba(216,168,78,.35);border-bottom-right-radius:4px}
.chat-bulle-assistant{align-self:flex-start;background:color-mix(in srgb,var(--ink) 7%,var(--panel));border:1px solid var(--line);border-bottom-left-radius:4px}
.chat-lectures{margin:8px 0 0;color:var(--muted);font-size:12px}
.chat-attente{color:var(--muted);animation:chat-pulse 1.2s ease-in-out infinite}
@keyframes chat-pulse{0%,100%{opacity:.45}50%{opacity:1}}
.chat-erreur{align-self:stretch;margin:0;padding:8px 12px;border-radius:8px;border:1px solid rgba(216,168,78,.45);background:rgba(216,168,78,.10);color:#f0d28d;font-size:13px;line-height:1.45}
.chat-proposition{display:grid;gap:10px;white-space:normal}
.chat-proposition-resume{margin:0}
.chat-proposition-bouton{justify-self:start}
.chat-cartes{display:grid;gap:8px;align-self:stretch}
.chat-carte{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--ink);text-decoration:none}
.chat-carte:hover{border-color:var(--accent)}
.chat-carte-titre{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.chat-saisie{padding:10px 12px 12px;border-top:1px solid var(--line);display:grid;gap:8px}
.chat-vignettes{display:flex;gap:8px;flex-wrap:wrap}
.chat-vignette{position:relative;width:56px;height:56px;border-radius:8px;overflow:hidden;border:1px solid var(--line)}
.chat-vignette img{width:100%;height:100%;object-fit:cover;display:block}
.chat-vignette-retirer{position:absolute;top:2px;right:2px;width:20px;height:20px;border:0;border-radius:50%;background:rgba(0,0,0,.65);color:#fff;font-size:14px;line-height:1;display:grid;place-items:center;padding:0}
.chat-ligne{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:end}
.chat-joindre{width:40px;height:40px;border-radius:8px}
.chat-texte{width:100%;min-height:40px;max-height:160px;resize:none;font-size:14px;line-height:1.45;padding:10px 12px;field-sizing:content}
.chat-envoyer{width:40px;height:40px;padding:0;justify-content:center;border-radius:8px}
.chat-pied{padding:6px 16px 10px;color:var(--muted);font-size:12px}
@media(max-width:700px){
  .shell.chat-ouvert{grid-template-columns:var(--app-sidebar-width,220px) minmax(0,1fr)}
  .chat-panneau{position:fixed;inset:0;height:100dvh;width:auto;z-index:120;border-left:0}
}
@media(max-width:600px){
  .shell.chat-ouvert{grid-template-columns:1fr!important}
}
