/* ==============================================================
   Agent IA d'estimation (js/chat.js) — s'appuie sur la coque .quote de quote.css
   ============================================================== */
.chat{display:flex;flex-direction:column;min-height:420px}
.chat-log{display:flex;flex-direction:column;gap:12px;padding:22px 24px 8px;min-height:240px;max-height:min(62vh,560px);overflow-y:auto;scroll-behavior:smooth;overscroll-behavior:contain}
.chat-chips{min-height:52px}
.chat-msg{display:flex;flex-direction:column;gap:8px;max-width:88%;animation:qfade .32s var(--ease)}
.chat-msg--bot{align-self:flex-start}
.chat-msg--user{align-self:flex-end;align-items:flex-end}
.chat-bubble{padding:12px 15px;border-radius:16px;font-size:14.5px;line-height:1.55;white-space:pre-wrap;word-break:break-word}
.chat-msg--bot .chat-bubble{background:#101014;border:1px solid var(--line);color:var(--ink);border-bottom-left-radius:6px}
.chat-msg--user .chat-bubble{background:rgba(236,255,0,.12);border:1px solid rgba(236,255,0,.35);color:var(--ink);border-bottom-right-radius:6px}
.chat-chips{display:flex;flex-wrap:wrap;gap:8px;padding:2px 24px 10px}
.chat-chip{
  display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:8px 16px;border-radius:999px;
  border:1px solid rgba(244,244,240,.28);background:#121216;color:var(--ink);font:500 13.5px var(--font-ui);cursor:pointer;text-align:left;
  transition:border-color .18s,background .18s,transform .18s var(--ease);
}
.chat-chip:hover{border-color:rgba(244,244,240,.6);transform:translateY(-1px)}
.chat-chip[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--pill-ink);font-weight:700}
.chat-chip--go{background:var(--accent);border-color:var(--accent);color:var(--pill-ink);font-weight:700}
.chat-chip--ghost{border-style:dashed;color:var(--dim)}
.chat-chip:disabled{opacity:.5;cursor:default;transform:none}
.chat-typing{display:inline-flex;gap:5px;padding:14px 16px;background:#101014;border:1px solid var(--line);border-radius:16px;border-bottom-left-radius:6px;align-self:flex-start}
.chat-typing i{width:7px;height:7px;border-radius:50%;background:rgba(244,244,240,.55);animation:chatdot 1.1s infinite}
.chat-typing i:nth-child(2){animation-delay:.18s}.chat-typing i:nth-child(3){animation-delay:.36s}
@keyframes chatdot{0%,80%,100%{transform:translateY(0);opacity:.45}40%{transform:translateY(-5px);opacity:1}}
.chat-form{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end;padding:10px 24px 22px;border-top:1px solid var(--line);margin-top:8px}
.chat-form textarea{
  width:100%;min-height:48px;max-height:140px;resize:none;padding:13px 15px;border-radius:14px;border:1px solid var(--line);background:#121216;
  color:var(--ink);font:500 14.5px var(--font-ui);line-height:1.45;
}
.chat-form textarea:focus{outline:none;border-color:rgba(236,255,0,.5)}
.chat-send{
  display:inline-flex;align-items:center;justify-content:center;height:48px;padding:0 20px;border-radius:999px;border:0;
  background:var(--accent);color:var(--pill-ink);font:700 14px var(--font-ui);cursor:pointer;white-space:nowrap;transition:filter .2s,transform .2s var(--ease);
}
.chat-send:hover{filter:brightness(1.06);transform:translateY(-1px)}
.chat-send:disabled{opacity:.45;cursor:not-allowed;transform:none}
.chat-form[hidden]{display:none}
.chat-status{padding:0 24px 14px;font-size:12.5px;color:#ff8a70;min-height:16px}
.chat-alt{padding:0 24px 18px;font-size:12.5px;color:var(--dim);text-align:center}
.chat-alt button{background:none;border:0;color:var(--ink);text-decoration:underline;text-underline-offset:2px;font:inherit;cursor:pointer}

/* cartes dans le fil : estimation, dossier, coordonnées */
.chat-card{border:1px solid var(--line);border-radius:16px;background:#0f0f13;padding:18px;max-width:100%}
.chat-card .quote-result{padding:0}
.chat-card .quote-size{width:64px;height:64px;font-size:34px;border-radius:18px;margin-bottom:12px}
.chat-card .quote-range{font-size:clamp(20px,2.6vw,26px)}
.chat-card h4{margin:0 0 6px;font-size:16px;font-weight:700;color:var(--ink)}
.chat-card p{margin:0;font-size:13px;line-height:1.55;color:var(--dim)}
.chat-card .quote-field{margin-bottom:12px}
.chat-card .quote-row{gap:10px}
.chat-row-top{margin-top:12px}
.chat-card .quote-next{margin-top:6px;width:100%;justify-content:center}
.chat-key{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;margin:10px 0;padding:10px 12px;border-radius:12px;background:#121216;border:1px solid var(--line)}
.chat-key code{font:600 13px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--ink);word-break:break-all}
.chat-key b{font-family:var(--font-display);font-size:22px;letter-spacing:.2em;color:var(--accent)}
.chat-key button{height:34px;padding:0 12px;border-radius:999px;border:1px solid rgba(244,244,240,.3);background:transparent;color:var(--ink);font:600 12px var(--font-ui);cursor:pointer}
.chat-key button:hover{border-color:var(--accent)}
.chat-card .quote-actions{margin-top:14px;justify-content:flex-start}
.chat-tg{background:#24a1de;color:#fff}

@media (max-width:720px){
  .chat-log{padding:18px 16px 6px;max-height:min(60vh,520px)}
  .chat-chips{padding:2px 16px 8px}
  .chat-form{padding:10px 16px 18px}
  .chat-msg{max-width:94%}
  .chat-status,.chat-alt{padding-left:16px;padding-right:16px}
}
@media (prefers-reduced-motion:reduce){.chat-msg{animation:none}.chat-typing i{animation:none}.chat-log{scroll-behavior:auto}}
