/* Chat do site. Roda dentro de um iframe no site do cliente, entao a pagina
   inteira E o widget: sem margem, altura cheia. */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  height: 100dvh;   /* celular: desconta a barra do navegador e o teclado */
  overflow: hidden;
  touch-action: manipulation;   /* sem zoom por toque duplo */
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #ece5dd;
}

body {
  display: flex;
  flex-direction: column;
}

.topo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #128c7e;
  color: #fff;
}

.topo strong { display: block; font-size: 15px; }
.topo small { opacity: .85; font-size: 12px; }

.bolinha {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7bd88f;
  flex: none;
}

.bolinha.off { background: #f0a5a5; }

.conversa {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.balao {
  max-width: 84%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .12);
}

.balao.bot { background: #fff; align-self: flex-start; border-top-left-radius: 3px; }
.balao.eu { background: #d9fdd3; align-self: flex-end; border-top-right-radius: 3px; }
.balao.aviso { background: #fff5d6; align-self: center; font-size: 13px; color: #6b5a1e; }

.balao img { max-width: 100%; border-radius: 8px; margin-top: 6px; display: block; }

.balao a.anexo {
  display: inline-block;
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #128c7e;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
}

.digitando { font-size: 13px; color: #667; align-self: flex-start; padding-left: 4px; }

.barra {
  display: flex;
  gap: 8px;
  padding: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: #f5f2ee;
  border-top: 1px solid #ddd6cd;
}

.campo {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #d5cec5;
  border-radius: 22px;
  /* 16px e o minimo que o iPhone aceita sem dar zoom sozinho ao focar o campo
     — era isso que empurrava o botao de enviar para fora da tela */
  font-size: 16px;
  outline: none;
  background: #fff;
}

.campo:focus { border-color: #128c7e; }

.enviar {
  width: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: #128c7e;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}

.enviar:disabled { opacity: .5; cursor: default; }
