/* Assistente de conversa: a bolinha com a foto do corretor e a janela no jeito do WhatsApp (assistente.js).
   Cores e medidas próximas às do WhatsApp para ficar familiar; o fundo de rabiscos é nosso (assistente-fundo.svg). */
.aw {
  --aw-bege: #efeae2;
  --aw-in: #ffffff;
  --aw-out: #d9fdd3;
  --aw-txt: #111b21;
  --aw-sub: #667781;
  --aw-verde: #00a884;
  --aw-verde-l: #25d366;
  --aw-azul: #53bdeb;
  --aw-link: #027eb5;
  --aw-linha: #e9edef;
  --aw-sombra: 0 1px .5px rgba(11, 20, 26, .13);
  --aw-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font: 400 15px/1.35 var(--aw-font);
  color: var(--aw-txt);
  -webkit-font-smoothing: antialiased;
}
.aw *, .aw *::before, .aw *::after { box-sizing: border-box; }
.aw button { font: inherit; color: inherit; }
.aw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- a bolinha ---------- */
.aw-bolha {
  position: fixed; z-index: 55; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom));
  width: 62px; height: 62px; padding: 0; border: 3px solid #fff; border-radius: 50%;
  background: #fff; box-shadow: 0 8px 24px rgba(11, 20, 26, .22), 0 1px 3px rgba(11, 20, 26, .2);
  cursor: pointer; transition: transform .5s cubic-bezier(.2, .7, .1, 1), opacity .3s;
}
.aw-bolha:hover { transform: scale(1.06); }
/* entra um pouco depois da página, e some enquanto a faixa de baixo do topo da home estiver no caminho */
.aw--escondida:not(.aw--aberta) .aw-bolha { opacity: 0; transform: translateY(18px) scale(.8); pointer-events: none; }
.aw--escondida .aw-aviso-b { display: none; }
.aw-bolha:focus-visible { outline: 3px solid var(--aw-verde); outline-offset: 3px; }
.aw-bolha img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.aw-bolha .aw-fechar-i { position: absolute; inset: -3px; display: none; place-items: center; border-radius: 50%; background: #1c1f22; color: #fff; }
.aw-bolha .aw-fechar-i svg { width: 22px; height: 22px; }
.aw-cont {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px;
  border: 2px solid #fff; border-radius: 11px; background: var(--aw-verde-l); color: #fff;
  font: 700 12px/18px var(--aw-font); text-align: center;
}
.aw-cont[hidden] { display: none; }
/* na página do imóvel, no celular, a bolinha fica acima da barra "Agendar visita no WhatsApp" */
@media (max-width: 760px) { .pg .aw-bolha { bottom: calc(58px + 16px + env(safe-area-inset-bottom)); } }

/* o aviso que aparece uma vez, como notificação */
.aw-aviso-b {
  position: fixed; z-index: 56; right: 22px; bottom: calc(98px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; width: min(290px, calc(100vw - 44px));
  padding: 11px 10px 12px 14px; border-radius: 12px; background: #fff; box-shadow: 0 10px 30px rgba(11, 20, 26, .2), 0 1px 3px rgba(11, 20, 26, .12);
  text-align: left; cursor: pointer; animation: aw-sobe .45s cubic-bezier(.2, .7, .1, 1) both;
}
.aw-aviso-b::after { content: ''; position: absolute; right: 26px; bottom: -7px; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); border-radius: 0 0 3px 0; }
.aw-aviso-b b { font-size: 13px; font-weight: 600; color: var(--aw-verde); }
.aw-aviso-b span { grid-column: 1; font-size: 14px; line-height: 1.35; color: var(--aw-txt); }
.aw-aviso-b .aw-aviso-x { grid-row: 1 / 3; grid-column: 2; align-self: start; width: 26px; height: 26px; margin: -4px -2px 0 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--aw-sub); cursor: pointer; }
.aw-aviso-b .aw-aviso-x svg { width: 12px; height: 12px; }
.aw-aviso-b[hidden] { display: none; }
@media (max-width: 760px) { .pg .aw-aviso-b { bottom: calc(58px + 92px + env(safe-area-inset-bottom)); } }
@keyframes aw-sobe { from { opacity: 0; transform: translateY(10px); } }

/* ---------- a janela ---------- */
.aw-janela {
  position: fixed; z-index: 58; right: 22px; bottom: calc(98px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; width: 384px; height: min(660px, calc(100dvh - 124px));
  overflow: hidden; border-radius: 14px;
  background: var(--aw-bege) url(assistente-fundo.svg) 0 0 / 260px repeat;
  box-shadow: 0 24px 60px rgba(11, 20, 26, .28), 0 2px 8px rgba(11, 20, 26, .12);
  transform-origin: calc(100% - 30px) calc(100% + 60px);
  animation: aw-abre .32s cubic-bezier(.2, .7, .1, 1) both;
}
.aw-janela[hidden] { display: none; }
@keyframes aw-abre { from { opacity: 0; transform: scale(.6); } }
.aw--aberta .aw-bolha .aw-fechar-i { display: grid; }
.aw--aberta .aw-cont, .aw--aberta .aw-aviso-b { display: none; }

.aw-topo { display: flex; flex: none; align-items: center; gap: 10px; height: 62px; padding: 0 6px 0 14px; background: #fff; box-shadow: 0 1px 2px rgba(11, 20, 26, .08); position: relative; z-index: 1; }
.aw-topo button, .aw-topo a { display: grid; flex: none; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: none; color: #54656f; cursor: pointer; }
.aw-topo button:hover, .aw-topo a:hover { background: #f0f2f5; }
.aw-topo svg { width: 22px; height: 22px; }
.aw-voltar { display: none !important; margin-left: -8px; }
.aw-av { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; }
.aw-quem { display: grid; flex: 1; min-width: 0; gap: 1px; }
.aw-quem b { overflow: hidden; font-size: 16px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.aw-status { font-size: 13px; line-height: 1.2; color: var(--aw-sub); }
.aw--digitando .aw-status { color: var(--aw-verde); }

.aw-fundo { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 14px 6px; scrollbar-width: thin; }
.aw-msgs { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.aw-dia, .aw-chip { align-self: center; margin: 4px 0 10px; }
.aw-dia span, .aw-chip span { display: block; padding: 5px 12px 6px; border-radius: 8px; background: #fff; box-shadow: var(--aw-sombra); font-size: 12.5px; line-height: 1.4; color: #54656f; text-align: center; }
.aw-chip { max-width: 88%; }
.aw-chip span { background: #ffeecd; }
.aw-chip--ensaio span { background: #ffe0d6; color: #8a3b1c; }

.aw-m { display: flex; max-width: 84%; margin-top: 2px; animation: aw-msg .22s cubic-bezier(.2, .7, .1, 1) both; }
.aw-m--in { align-self: flex-start; }
.aw-m--out { align-self: flex-end; }
.aw-m--1 { margin-top: 10px; }
@keyframes aw-msg { from { opacity: 0; transform: translateY(6px); } }
.aw-b { position: relative; min-width: 72px; padding: 6px 8px 8px 9px; border-radius: 8px; background: var(--aw-in); box-shadow: var(--aw-sombra); overflow-wrap: anywhere; white-space: pre-wrap; }
.aw-m--out .aw-b { background: var(--aw-out); }
/* o biquinho da primeira mensagem de cada sequência */
.aw-m--1 .aw-b::before { content: ''; position: absolute; top: 0; width: 8px; height: 13px; }
.aw-m--1.aw-m--in .aw-b { border-top-left-radius: 0; }
.aw-m--1.aw-m--in .aw-b::before { left: -8px; background: var(--aw-in); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.aw-m--1.aw-m--out .aw-b { border-top-right-radius: 0; }
.aw-m--1.aw-m--out .aw-b::before { right: -8px; background: var(--aw-out); clip-path: polygon(0 0, 100% 0, 0 100%); }
.aw-hora { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 7px -1px -4px 12px; font-size: 11px; line-height: 15px; color: var(--aw-sub); white-space: nowrap; }
.aw-hora svg { width: 16px; height: 11px; }
.aw-hora > span { display: inline-flex; color: #8696a0; }
.aw-hora > span.lido { color: var(--aw-azul); }

/* imóvel: no jeito da prévia de link do WhatsApp */
.aw-b--card { width: min(300px, 74vw); padding: 3px 3px 7px; }
.aw-card { display: block; overflow: hidden; border-radius: 6px; background: #f5f6f6; color: inherit; text-decoration: none; }
.aw-card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #e9edef; }
.aw-card-t { display: grid; gap: 2px; padding: 8px 10px 9px; }
.aw-card-t b { font-size: 14px; font-weight: 600; line-height: 1.3; }
.aw-card-t span { font-size: 13px; line-height: 1.35; color: var(--aw-sub); }
.aw-card-t em { font-size: 13px; font-style: normal; font-weight: 600; line-height: 1.35; }
.aw-card-t small { font-size: 12px; color: #8696a0; }
.aw-card:hover .aw-card-t b { text-decoration: underline; text-underline-offset: 2px; }
.aw-b--card .aw-hora { margin-top: 5px; margin-right: 4px; }

/* a passagem para o WhatsApp: a mensagem pronta (como uma citação) e o botão */
.aw-b--acao { width: min(300px, 74vw); padding-bottom: 0; }
.aw-acao-r { display: block; margin-bottom: 4px; font-size: 12.5px; color: var(--aw-sub); }
.aw-cita { display: block; padding: 6px 9px 7px; border-left: 4px solid var(--aw-verde); border-radius: 6px; background: #f5f6f6; font-size: 13.5px; line-height: 1.4; color: #3b4a54; }
.aw-acao { clear: both; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px -8px 0 -9px; padding: 11px 10px 12px; border-top: 1px solid var(--aw-linha); color: var(--aw-link); font-size: 15px; font-weight: 500; text-decoration: none; }
.aw-acao:hover { background: #f5f6f6; border-radius: 0 0 8px 8px; }
.aw-acao svg { width: 19px; height: 19px; }
.aw-b--botao { min-width: 0; padding: 0; }
.aw-b--botao .aw-acao { margin: 0; padding: 11px 16px; border-top: 0; }
.aw-b--botao .aw-acao:hover { border-radius: 8px; }

/* digitando… */
.aw-dig .aw-b { display: flex; gap: 4px; min-width: 0; padding: 12px 13px; }
.aw-dig i { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: aw-pulo 1.2s infinite ease-in-out; }
.aw-dig i:nth-child(2) { animation-delay: .15s; }
.aw-dig i:nth-child(3) { animation-delay: .3s; }
@keyframes aw-pulo { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* campo de mensagem */
.aw-form { display: flex; flex: none; align-items: flex-end; gap: 6px; padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
.aw-campo { flex: 1; min-width: 0; min-height: 46px; max-height: 128px; margin: 0; padding: 12px 16px; border: 0; border-radius: 23px; background: #fff; box-shadow: var(--aw-sombra); color: var(--aw-txt); font: 400 16px/22px var(--aw-font); resize: none; outline: none; }
.aw-campo::placeholder { color: #8696a0; }
.aw-enviar { display: grid; flex: none; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: var(--aw-verde); color: #fff; cursor: pointer; transition: opacity .2s, transform .2s; }
.aw-enviar:disabled { opacity: .55; cursor: default; }
.aw-enviar:not(:disabled):active { transform: scale(.94); }
.aw-enviar svg { width: 21px; height: 21px; margin-left: 2px; }

/* celular: tela inteira, como o app */
@media (max-width: 600px) {
  .aw-janela { inset: 0; top: var(--aw-topo-vv, 0px); width: 100%; height: var(--aw-h, 100dvh); border-radius: 0; animation-name: aw-abre-cel; }
  .aw-voltar { display: grid !important; }
  .aw-x { display: none !important; }
  .aw--aberta .aw-bolha { display: none; }
  .aw-fundo { padding: 10px 10px 6px; }
  .aw-m { max-width: 86%; }
  html.aw-trava, html.aw-trava body { overflow: hidden; }
}
@keyframes aw-abre-cel { from { opacity: 0; transform: translateY(24px); } }

/* link da bio: o assistente como uma conversa da lista do WhatsApp */
.lk-ia { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line, rgba(28, 31, 34, .15)); background: #fff; color: #111b21; text-align: left; cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; transition: background .25s; }
.lk-ia[hidden] { display: none; }
.lk-ia:hover { background: #f5f6f6; }
.lk-ia img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.lk-ia-txt { display: grid; gap: 2px; }
.lk-ia-txt b { font-size: 16px; font-weight: 600; }
.lk-ia-txt em { font-size: 14px; font-style: normal; line-height: 1.3; color: #667781; }
.lk-ia-meta { display: grid; justify-items: end; gap: 6px; align-self: start; padding-top: 3px; }
.lk-ia-meta small { font-size: 12px; color: #1fa855; }
.lk-ia-meta i { display: block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #25d366; color: #fff; font: 700 12px/20px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-style: normal; text-align: center; }
.lk-ia.lido .lk-ia-meta i, .lk-ia.lido .lk-ia-meta small { display: none; }

@media (prefers-reduced-motion: reduce) {
  .aw-janela, .aw-m, .aw-aviso-b { animation: none; }
  .aw-bolha { transition: none; }
  .aw-dig i { animation-duration: 2.4s; }
}
