/* Bulle de discussion Findar (voir findar-chat.js). */
.fchat-root {
  --fchat-blue: #1263f1;
  --fchat-ink: #071431;
  --fchat-muted: #5d6b82;
  --fchat-line: #e1e8f2;
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 2147482000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: inherit;
  color: var(--fchat-ink);
}

.fchat-bubble {
  position: relative;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--fchat-blue);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(18, 99, 241, .35);
  cursor: pointer;
}
.fchat-bubble svg { width: 28px; height: 28px; fill: currentColor; }
.fchat-bubble:focus-visible { outline: 3px solid rgba(18, 99, 241, .35); outline-offset: 3px; }
.fchat-root.is-open .fchat-bubble { transform: scale(.92); }

.fchat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #e5484d;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  border: 2px solid #fff;
}

.fchat-panel {
  width: min(380px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--fchat-line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(7, 20, 49, .22);
  overflow: hidden;
}
.fchat-panel[hidden] { display: none; }

.fchat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--fchat-ink);
  color: #fff;
}
.fchat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--fchat-blue);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.fchat-title { flex: 1; min-width: 0; display: grid; }
.fchat-title strong { font-size: 16px; }
.fchat-title span { font-size: 12.5px; opacity: .8; }
.fchat-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.fchat-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f5f8fc;
  overscroll-behavior: contain;
}

.fchat-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.fchat-msg a { color: inherit; text-decoration: underline; font-weight: 700; }
.fchat-bot { align-self: flex-start; background: #fff; border: 1px solid var(--fchat-line); border-bottom-left-radius: 5px; }
.fchat-team { align-self: flex-start; background: #def7ec; border: 1px solid #bfe9d6; border-bottom-left-radius: 5px; }
.fchat-me { align-self: flex-end; background: var(--fchat-blue); color: #fff; border-bottom-right-radius: 5px; }
.fchat-who { display: block; font-size: 11.5px; font-weight: 800; color: #046c4e; margin-bottom: 2px; }

.fchat-typing { display: flex; gap: 4px; padding: 13px 14px; }
.fchat-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa8bd; animation: fchat-dot 1.2s infinite ease-in-out; }
.fchat-typing i:nth-child(2) { animation-delay: .15s; }
.fchat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes fchat-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .fchat-typing i { animation: none; } }

.fchat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fchat-chips button {
  border: 1px solid #cddbf0;
  background: #fff;
  color: var(--fchat-blue);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.fchat-status { margin: 0; padding: 8px 16px; font-size: 13px; color: #c62828; background: #fff4f4; border-top: 1px solid var(--fchat-line); }
.fchat-status[hidden] { display: none; }

.fchat-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--fchat-line);
  background: #fff;
}
.fchat-input {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid var(--fchat-line);
  border-radius: 14px;
  font: inherit;
  font-size: 16px;
  color: inherit;
  outline: 0;
}
.fchat-input:focus { border-color: var(--fchat-blue); }
.fchat-send {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 50%;
  background: var(--fchat-blue);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fchat-send svg { width: 20px; height: 20px; fill: currentColor; }
.fchat-send:disabled { opacity: .5; cursor: default; }

.fchat-foot { margin: 0; padding: 0 14px 10px; font-size: 11.5px; color: var(--fchat-muted); background: #fff; }
.fchat-foot a { color: var(--fchat-blue); font-weight: 700; }

/* Téléphone : panneau plein écran, bulle au-dessus des barres collantes du site. */
@media (max-width: 640px) {
  .fchat-root { right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .fchat-bubble { width: 54px; height: 54px; }
  .fchat-root.is-open { top: 0; left: 0; right: 0; bottom: 0; gap: 0; }
  .fchat-root.is-open .fchat-bubble { display: none; }
  .fchat-panel { width: 100%; height: 100%; border-radius: 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
  html.fchat-locked, html.fchat-locked body { overflow: hidden; }
}

/* Fiches d'annonces envoyées par l'assistant */
.fchat-card { align-self: flex-start; width: min(290px, 88%); display: grid; background: #fff; border: 1px solid var(--fchat-line); border-radius: 16px; overflow: hidden; color: inherit; text-decoration: none; box-shadow: 0 4px 14px rgba(7, 20, 49, .06); }
.fchat-card img { width: 100%; height: 150px; object-fit: cover; display: block; background: #eef2f7; }
.fchat-card-body { display: grid; gap: 2px; padding: 10px 12px 12px; font-size: 13.5px; }
.fchat-card-body strong { font-size: 14.5px; line-height: 1.3; }
.fchat-card-price { font-weight: 800; color: var(--fchat-blue); }
.fchat-card-facts { color: var(--fchat-muted); }
.fchat-card-link { margin-top: 4px; font-weight: 800; color: var(--fchat-blue); }

.fchat-attach { width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--fchat-line); border-radius: 50%; background: #fff; color: var(--fchat-muted); display: grid; place-items: center; cursor: pointer; }
.fchat-attach svg { width: 20px; height: 20px; fill: currentColor; }
.fchat-attach:hover { color: var(--fchat-blue); border-color: var(--fchat-blue); }

/* Identité avant la discussion (nom + numéro confirmé par code WhatsApp) */
.fchat-identity { padding: 12px 14px 14px; border-top: 1px solid var(--fchat-line); background: #fff; display: grid; gap: 10px; }
.fchat-identity[hidden], .fchat-compose[hidden] { display: none; }
.fchat-id-title { margin: 0; font-size: 13.5px; color: var(--fchat-muted); line-height: 1.4; }
.fchat-id-form { display: grid; gap: 8px; }
.fchat-id-form input, .fchat-id-form select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--fchat-line); border-radius: 12px; font: inherit; font-size: 16px; color: inherit; background: #fff; outline: 0; }
.fchat-id-form input:focus, .fchat-id-form select:focus { border-color: var(--fchat-blue); }
.fchat-id-phone { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px; }
.fchat-id-primary { min-height: 44px; border: 0; border-radius: 12px; background: var(--fchat-blue); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.fchat-id-primary:disabled { opacity: .6; cursor: default; }
.fchat-id-link { justify-self: start; border: 0; background: none; padding: 0; color: var(--fchat-blue); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.fchat-id-msg { margin: 0; font-size: 13px; color: #046c4e; }
.fchat-id-msg.is-error { color: #c62828; }

/* Dans la colonne qui défile, rien ne doit se tasser : sinon la fiche (overflow: hidden)
   était écrasée à la hauteur de sa photo et le titre, le prix et les m² disparaissaient. */
.fchat-list > * { flex-shrink: 0; }

/* Localisation du bien (carte). */
.fchat-map-overlay { position: fixed; inset: 0; z-index: 2147483001; display: grid; place-items: center; padding: 16px; background: rgba(7, 20, 49, .55); }
.fchat-map-box { width: min(560px, 100%); max-height: calc(100dvh - 32px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; padding: 14px; border-radius: 16px; background: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.fchat-map-head { display: flex; align-items: center; justify-content: space-between; color: #071431; }
.fchat-map-head .fchat-close { color: #071431; }
.fchat-map { height: min(60dvh, 420px); border-radius: 12px; overflow: hidden; }
.fchat-map-note { margin: 0; font-size: 13.5px; color: #5d6b82; }
.fchat-map-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.fchat-map-actions .fchat-id-primary { width: auto; }
