/* Estilos do widget de chat público.
 * Extraído de app/views/widgets/widget.html.slim para permitir CSP sem 'unsafe-inline'.
 * Servido via Propshaft em /assets/widget-DIGEST.css.
 */

/* ---- Utilitários para substituir style="" inline (compatibilidade com CSP) ---- */
.is-hidden                 { display: none !important; }

/* O adminlte.min.js injeta skip-links de acessibilidade ("Skip to main
   content"/"Skip to navigation") em toda página onde boota — dentro do widget
   (iframe pequeno, sem landmarks de navegação) eles não fazem sentido e ficam
   POR CIMA do launcher, roubando o clique/toque (pior no círculo mobile de
   60px) e vazando texto visível ("navig…"/"conte…"). */
.skip-links, .skip-link    { display: none !important; }
.card-header-clickable     { cursor: pointer; }
.text-helper               { font-size: 0.85rem; }
.text-helper-sm            { font-size: 0.9rem; }

html, body {
  height: 100%;
  margin: 0;
  box-sizing: border-box;
  background: transparent !important;
  background-color: transparent !important;
}
body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 20px;
}
/* Quando o iframe está ancorado no topo da viewport (após drag),
   o conteúdo do chat cresce PARA BAIXO a partir do topo do iframe.
   Sem isso, o card ficaria colado no fundo do iframe expandido,
   longe da posição onde o usuário soltou o widget minimizado. */
body.top-anchored {
  justify-content: flex-start;
  padding-bottom: 0;
  padding-top: 20px;
}

/* Link direto (standalone_chat_path) — página de verdade, aberta numa aba
   normal (WhatsApp, e-mail comercial), NÃO dentro de um iframe pequeno do
   site do cliente. As regras acima (fundo transparente, ancorado embaixo,
   pensadas pro iframe de 370x550) ficam erradas aqui — sobrescreve com o
   layout de página: header de marca, barra "Suporte", conteúdo centralizado
   com teto de largura pra não esticar num monitor largo. Sem chrome de
   widget nenhum (sem card, sem drag-handle, sem collapse — não existe
   "minimizar" numa página, só faz sentido dentro do launcher embarcado).
   !important só onde precisa vencer o `background: transparent !important`
   da regra html,body acima. */
body.standalone-chat {
  display: block !important;
  min-height: 100vh;
  background: #f4f6f9 !important;
  padding-bottom: 0;
}
.standalone-header {
  background: #0d6efd;
  color: #fff;
  text-align: center;
  padding: 22px 16px;
  position: relative;
}
/* Botão de mudo do cliente no header standalone (no embed reusa .btn-tool). */
.standalone-header__sound {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
}
.standalone-header__sound:hover {
  color: #fff;
}
.standalone-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.standalone-subheader {
  background: #eceef1;
  color: #495057;
  text-align: center;
  font-weight: 600;
  padding: 10px 16px;
  font-size: 0.95rem;
}
.standalone-main {
  width: 100%;
  padding: 32px 24px 24px;
}
.standalone-welcome {
  color: #6c757d;
  font-size: 1rem;
  margin: 0 0 24px;
  width: 100%;
  max-width: 720px;
  align-self: center;
}
/* Inputs maiores/mais espaçados que o card compacto do embed — a página
   tem espaço de sobra, não precisa economizar altura como num iframe de
   370px. */
body.standalone-chat .form-conversation-container .form-control {
  padding: 12px 14px;
  font-size: 0.95rem;
}
/* Área de mensagens do embed é limitada a 350px (cabe no card pequeno do
   iframe) — numa página cheia isso desperdiça a tela toda; deixa crescer
   até um teto generoso e continua rolando internamente depois disso. */
body.standalone-chat .direct-chat-messages {
  max-height: 60vh;
}
.standalone-footer {
  background: #fff;
  border-top: 1px solid #dee2e6;
  padding: 12px 16px;
  box-shadow: 0 -2px 8px rgba(16, 24, 40, 0.06);
}
/* Composer acompanha a largura da tela, igual à área de mensagens. */
.standalone-footer > * {
  width: 100%;
}

/* ---- Página cheia do link standalone ----
   O embed vive num iframe de altura fixa; aqui a página É o app: header e
   composer ancorados, e SÓ a lista de mensagens rola. Sem isto o conteúdo
   ficava colado no topo, a lista travada em 60vh e o composer flutuando no
   meio da tela com um vazio embaixo. 100dvh (100vh de fallback) porque o link
   chega muito por WhatsApp: no celular a barra do browser some/aparece e
   100vh estoura a viewport. */
body.standalone-chat {
  height: 100vh;
  height: 100dvh;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
}
.standalone-header,
.standalone-subheader,
.standalone-footer {
  flex: 0 0 auto;
}
.standalone-main {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
/* Com conversa aberta quem rola é a lista de mensagens, não o main — senão
   viram dois scrolls concorrentes e o composer sai da tela. */
.standalone-main--chat {
  padding: 0;
  overflow: hidden;
}
.standalone-main--chat .choice-departament {
  background: #fff;
  padding: 10px 20px;
  font-size: 0.85rem;
}
body.standalone-chat .direct-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 20px 32px 12px;
}

/* Sem conversa a página mostra só o formulário de entrada; num monitor largo
   ele boiava solto no cinza. Vira um cartão com a mesma linguagem das bolhas. */
/* margem auto NÃO serve para centrar aqui: em item de coluna flex ela desliga
   o stretch e o cartão encolhe até o tamanho do conteúdo. width + align-self
   centram mantendo a largura pedida. */
.standalone-main:not(.standalone-main--chat) .form-conversation-container {
  width: 100%;
  max-width: 720px;
  align-self: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
  padding: 16px 12px;
}

/* ---- Bolhas de mensagem (só na página) ----
   No card de 370px o AdminLTE cru já serve: tudo é estreito. Na página larga
   ele estica a bolha nos 640px inteiros e o balão do cliente, sem cor e sem
   lado, fica com cara de campo de input (bug reportado). Aqui o layout é por
   autor: avatar numa coluna, bolha colorida e limitada na outra. */
body.standalone-chat .direct-chat-msg {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas:
    "avatar infos"
    "avatar text";
  column-gap: 10px;
  margin-bottom: 16px;
}
body.standalone-chat .direct-chat-msg.end {
  grid-template-columns: minmax(0, 1fr) 36px;
  grid-template-areas:
    "infos avatar"
    "text avatar";
}
body.standalone-chat .direct-chat-infos {
  grid-area: infos;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
body.standalone-chat .direct-chat-msg.end .direct-chat-infos {
  justify-content: flex-end;
}
body.standalone-chat .direct-chat-name,
body.standalone-chat .direct-chat-timestamp {
  float: none !important;
  font-size: 0.72rem;
  line-height: 1;
}
body.standalone-chat .direct-chat-name {
  font-weight: 600;
  color: #495057;
}
body.standalone-chat .direct-chat-timestamp {
  color: #adb5bd;
}
body.standalone-chat .direct-chat-img {
  grid-area: avatar;
  float: none !important;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  align-self: end;
  margin: 0;
}
body.standalone-chat .direct-chat-text {
  grid-area: text;
  justify-self: start;
  max-width: min(70%, 720px);
  margin: 0;
  border: 0;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  color: #212529;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
  padding: 10px 14px;
  font-size: 0.9rem;
}
/* AdminLTE desenha uma setinha em ::before/::after posicionada pelos floats
   que acabamos de anular — sobra um triângulo solto do lado errado. */
body.standalone-chat .direct-chat-text::before,
body.standalone-chat .direct-chat-text::after {
  display: none;
}
body.standalone-chat .direct-chat-msg.end .direct-chat-text {
  justify-self: end;
  border-radius: 14px 14px 4px 14px;
  background: #0d6efd;
  color: #fff;
}
body.standalone-chat .direct-chat-msg.end .direct-chat-text a {
  color: #fff;
  text-decoration: underline;
}
body.standalone-chat .direct-chat-msg.end .direct-chat-text .attachment-name,
body.standalone-chat .direct-chat-msg.end .direct-chat-text .bi {
  color: #fff;
}

/* Celular: o link standalone é aberto MUITO por WhatsApp. Aqui o @media vale
   de verdade — é uma página, o viewport é o do aparelho (diferente do embed,
   que depende do postMessage do parent; ver body.is-mobile-widget). */
@media (max-width: 576px) {
  .standalone-header {
    padding: 14px 12px;
  }
  .standalone-header__brand {
    font-size: 1.1rem;
  }
  .standalone-main {
    padding: 20px 14px 14px;
  }
  body.standalone-chat .direct-chat-messages {
    padding: 14px 12px 8px;
  }
  body.standalone-chat .direct-chat-text {
    max-width: 88%;
  }
  .standalone-footer {
    padding: 10px 12px;
  }
}
/* Handle de arraste: alterna ícone e cursor conforme estado. */
.drag-handle {
  cursor: grab;
  touch-action: none;
}
.drag-handle:active,
body.dragging .drag-handle {
  cursor: grabbing;
}
.drag-handle .icon-drag-active { display: none; }
body.dragging .drag-handle .icon-drag-idle { display: none; }
body.dragging .drag-handle .icon-drag-active { display: inline-block; }
.card.direct-chat {
  max-height: calc(100vh - 20px);
  overflow: hidden;
  margin-bottom: 0;
  /* Coluna flex: sem isto o .card-body cresce com o conteúdo e o excedente
     some no overflow do card (header/footer têm altura própria, o corpo é o
     que sobra). Era assim que o formulário offline perdia o botão de enviar. */
  display: flex;
  flex-direction: column;
}
.card.direct-chat .card-body {
  overflow: hidden;
  /* !important: o expand() do AdminLTE (CardWidget) seta style.display:"block"
     INLINE no card-body ao reabrir o widget minimizado — o inline vencia esta
     classe, o card-body virava block, o formulário perdia o teto de altura e
     o scroll interno morria: apos minimizar/reabrir, o botão "Enviar
     solicitação" do formulário offline ficava cortado fora do card, sem
     scrollbar (bug em vídeo). O estado minimizado segue funcionando: a regra
     .card.collapsed-card .card-body (display:none !important, declarada
     depois) vence esta por ordem de declaração. */
  display: flex !important;
  flex-direction: column;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
}
/* Barra de departamento fixa no topo */
.choice-departament {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
/* Container do chat */
.chat-container {
  flex: 1;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* Altura definida para área de mensagens do chat - único scroll */
.direct-chat-messages {
  flex: 1;
  min-height: 0;
  max-height: 350px;
  overflow-y: auto;
  padding: 10px;
}

.card.collapsed-card .card-body,
.card.collapsed-card .card-footer {
  display: none !important;
}

/* Botão de mudo só faz sentido com o chat ABERTO — na bolha colapsada ele
   poluía o launcher e ainda "roubava" o clique de expandir (o guard de
   toggleCard ignora cliques no .btn-sound). */
.card.collapsed-card .btn-sound {
  display: none !important;
}

/* Histórico da conversa anterior (após "Retomar" numa conversa não mais
   elegível pra reconectar de verdade — ver
   Conversation#previous_conversation_id): visualmente distinto da conversa
   NOVA que já está rolando, pra deixar claro que já é outro atendimento. */
.chat-history-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  color: #6c757d;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.chat-history-divider::before,
.chat-history-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #dee2e6;
}
.direct-chat-msg.historical {
  opacity: 0.6;
}

/* Mobile (≤576px): launcher minimizado vira ícone circular, sem texto/drag.
   Sinalizado pelo script do PARENT via postMessage (classe no <body> deste
   documento — ver chatbox_controller.js#setMobileMode). Não dá pra usar
   @media aqui: o viewport que importa é o da página hospedeira, não o deste
   iframe (que tem largura própria, sempre pequena, mesmo no desktop). */
body.is-mobile-widget .drag-handle {
  display: none !important;
}
body.is-mobile-widget .card.collapsed-card {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
}
body.is-mobile-widget .card.collapsed-card .card-header {
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
body.is-mobile-widget .card.collapsed-card .card-header .card-title {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1;
}
body.is-mobile-widget .card.collapsed-card .card-header .card-title-text,
body.is-mobile-widget .card.collapsed-card .card-header .card-tools {
  display: none;
}
/* Ícones de collapse/expand */
.card .icon-expand {
  display: none;
}
.card.collapsed-card .icon-collapse {
  display: none;
}
.card.collapsed-card .icon-expand {
  display: inline-block;
}
/* Tela pós-encerramento (post-close) — CSP-safe: substitui style="" no JS */
.post-close {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 300px;
  padding: 30px 20px;
}
.post-close__icon-check       { font-size: 2.5rem; }
.post-close__icon-chat        { font-size: 2.5rem; color: #0d6efd; }
.post-close__title            { font-weight: 600; }
.post-close__actions          { max-width: 260px; }
.post-close__decline-btn      { text-decoration: none; font-size: 0.8rem; }
.post-close__email-sent       { font-weight: 600; color: #0d6efd; font-size: 0.95rem; margin-bottom: 4px; }
.post-close__thanks           { font-size: 0.9rem; }
.post-close__thanks--no-email { font-weight: 600; color: #6c757d; font-size: 1rem; }
.post-close__reset-label      { font-size: 0.8rem; }

/* Overlay de retomar/reiniciar conversa — CSP-safe: substitui style.cssText no JS */
.resume-dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.97);
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  text-align: center;
}
.resume-dialog-overlay__inner { width: 100%; }
.resume-dialog-overlay__icon  { font-size: 2rem; }

/* Feedback overlay */
.feedback-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.97);
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
}
.feedback-overlay h6 {
  font-weight: 600;
  margin-bottom: 12px;
}
.star-rating {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-bottom: 14px;
}
.star-rating .star-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #ddd;
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.15s;
}
.star-rating .star-btn.active,
.star-rating .star-btn:hover {
  color: #ffc107;
}
.star-rating .star-btn:hover ~ .star-btn {
  color: #ddd !important;
}
.feedback-overlay textarea {
  resize: none;
  font-size: 0.85rem;
}
.feedback-overlay .btn-sm {
  font-size: 0.8rem;
}
/* Quebras de linha digitadas (Shift+Enter) renderizam na bolha; palavras/URLs
   compridas sem espaço quebram em vez de estourar a largura. */
.direct-chat-text .message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* Vídeo anexado na bolha do widget: cap de tamanho como o das imagens. */
.direct-chat-text .message-attachment.video-attachment video {
  max-width: 220px;
  max-height: 160px;
  border-radius: 6px;
  display: block;
}
/* Campo de mensagem: textarea auto-crescente (mensagem longa QUEBRA linha em
   vez de rolar horizontalmente — mesmo ajuste do painel do atendente).
   Altura controlada pelo JS (autosizeField); depois do teto, rola dentro. */
.chat-input-autogrow {
  resize: none;
  overflow-y: auto;
  max-height: 120px;
}

/* Barra de departamento */
.choice-departament {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f4f6f9;
  border-bottom: 1px solid #dee2e6;
  padding: 6px 12px;
  font-size: 0.8rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing indicator animation */
.typing-indicator {
  animation: fadeIn 0.3s ease-in-out;
}
.typing-bubble {
  padding: 8px 14px !important;
  min-width: 60px;
}
.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
}
.typing-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #90949c;
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Estilo do footer estilo WhatsApp */
.chat-footer .input-group {
  align-items: center;
  gap: 8px;
}
.chat-footer .btn-attachment,
.chat-footer .btn-emoji {
  background: transparent;
  border: none;
  color: #6c757d;
  font-size: 1.25rem;
  padding: 6px;
  cursor: pointer;
  transition: color 0.2s;
}
.chat-footer .btn-attachment:hover,
.chat-footer .btn-emoji:hover {
  color: #007bff;
}
.chat-footer .form-control {
  border-radius: 20px;
  padding-left: 15px;
  padding-right: 15px;
}
.chat-footer .btn-primary {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Emoji Picker */
.emoji-picker-container {
  position: absolute;
  bottom: 60px;
  left: 10px;
  right: 10px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 100;
  display: none;
}
.emoji-picker-container.show {
  display: block;
}
.emoji-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
}
.emoji-picker-header .emoji-search {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 15px;
  padding: 5px 12px;
  font-size: 0.85rem;
  margin-right: 8px;
}
.emoji-picker-header .close-emoji {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #999;
  cursor: pointer;
}
.emoji-categories {
  display: flex;
  padding: 5px 10px;
  gap: 5px;
  border-bottom: 1px solid #eee;
}
.emoji-categories button {
  background: none;
  border: none;
  font-size: 1.1rem;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}
.emoji-categories button:hover,
.emoji-categories button.active {
  background: #e9ecef;
}
.emoji-list {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 10px;
  max-height: 200px;
  overflow-y: auto;
}
.emoji-list button {
  background: none;
  border: none;
  font-size: 1.4rem;
  padding: 5px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}
.emoji-list button:hover {
  background: #e9ecef;
}

/* File attachment preview */
.attachment-preview {
  display: none;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}
.attachment-preview.show {
  display: flex;
  align-items: center;
  gap: 10px;
}
.attachment-preview .file-info {
  flex: 1;
  font-size: 0.85rem;
  color: #495057;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-preview .file-info i {
  margin-right: 5px;
  color: #6c757d;
}
.attachment-preview .remove-attachment {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 2px 6px;
}

/* Message attachments */
.message-attachment {
  margin-top: 8px;
}
.message-attachment.image-attachment img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}
.message-attachment.image-attachment img:hover {
  transform: scale(1.02);
}
.message-attachment.file-attachment .attachment-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  color: #495057;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.message-attachment.file-attachment .attachment-link:hover {
  background: rgba(0, 0, 0, 0.1);
}
.message-attachment.file-attachment .attachment-link i:first-child {
  font-size: 1.5rem;
  color: #6c757d;
}
.message-attachment.file-attachment .attachment-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-attachment.file-attachment .bi-download {
  color: #007bff;
}

.choice-departament .name {
  font-weight: 600;
  color: #495057;
}
.choice-departament .acao-departamento a {
  color: #dc3545;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.78rem;
}
.choice-departament .acao-departamento a:hover {
  text-decoration: underline;
}

/* ---- Formulário offline (fora do horário comercial — ver _offline_form) ---- */
.offline-hours-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.375rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #495057;
}
.offline-hours-note .bi-clock {
  color: #0d6efd;
  margin-top: 0.1rem;
}
.offline-success {
  text-align: center;
  padding: 1.5rem 0.5rem;
}
.offline-success .bi-check-circle {
  font-size: 2.2rem;
  color: #198754;
}
.offline-success h6 {
  margin-top: 0.5rem;
  font-weight: 600;
}
.offline-success-message {
  font-size: 0.9rem;
  color: #495057;
  margin-bottom: 0.35rem;
}
.offline-success-protocol {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0d6efd;
}
/* O embed roda num iframe de altura fixa (370x550, ver widget_script.js.erb).
   O formulário offline é mais alto que o de início de chat (nota de horário +
   campo de mensagem) e estourava o card: o botão de enviar ficava cortado e
   inalcançável. Rola por dentro do card — mesmo papel do .direct-chat-messages,
   que já é o único scroll enquanto o chat está aberto. */
.card.direct-chat .card-body > .form-conversation-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* Só o eixo vertical rola. Sem isto o overflow-x, que era `visible`, computa
     para `auto` junto com o -y (regra do CSS quando um dos eixos deixa de ser
     visible) e aparece uma barra horizontal no rodapé do widget. */
  overflow-x: hidden;
}

/* O .row do Bootstrap tem margem negativa nas laterais e o container não tem
   padding compensando: o formulário estourava ~12px de cada lado desde sempre,
   escondido pelo overflow do card. Zera na raiz — o overflow-x acima é só
   cinto de segurança. */
.form-conversation-container > .row {
  margin-left: 0;
  margin-right: 0;
}
.offline-success-reset {
  font-size: 0.8rem;
  color: #6c757d;
  margin: 0.75rem 0 0.5rem;
}
