/* fontes da marca: Inter nos textos (feita para tela, números alinhados) e Manrope nos títulos e no logo */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");
/* Fórmula Chat: acabamento por cima do Chatwoot CE.
   Carregado pelo DASHBOARD_SCRIPTS (configuração oficial); formula.js põe a
   classe fm-login no <html> só nas telas de entrada. */

/* ---------- Tela de login: minimalista, estilo Apple ----------
   Fundo quase branco liso, muito respiro, tipografia do sistema, cartão com
   borda fina. Sem formas decorativas. A cor de ação vem da camada verde. */
html.fm-login body {
  background: #fbfbfd;
  -webkit-font-smoothing: antialiased;
}
html.fm-login #app,
html.fm-login #app button,
html.fm-login #app input,
html.fm-login #app label {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
html.fm-login #app main.min-h-screen {
  background: transparent !important;
  padding-top: 9vh;
}
html.fm-login #app section.max-w-5xl img {
  height: 2.6rem !important;
}
html.fm-login #app section.max-w-5xl h2 {
  margin-top: 2.25rem;
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.022em;
  color: #1d1d1f;
}
html.fm-login #app section.max-w-5xl h2::after {
  content: "Acesse com o e-mail e a senha da sua equipe.";
  display: block;
  margin-top: .6rem;
  font-size: .95rem;
  font-weight: 400;
  letter-spacing: -.01em;
  color: #6e6e73;
}
html.fm-login #app section.shadow,
html.fm-login #app section[class*="sm:shadow-lg"] {
  max-width: 26rem !important;
  margin-top: 2rem !important;
  padding: 2.25rem 2.25rem 2rem !important;
  border-radius: 20px !important;
  border: 1px solid rgba(0, 0, 0, .07);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 18px 48px rgba(0, 0, 0, .05) !important;
}
html.fm-login #app form label {
  font-size: .8rem;
  font-weight: 500;
  color: #6e6e73;
}
html.fm-login #app form input {
  min-height: 2.9rem;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: none !important;
  outline: 1px solid #d2d2d7 !important;
  font-size: 1rem;
  color: #1d1d1f;
  transition: outline-color .15s, box-shadow .15s;
}
html.fm-login #app form input:focus {
  outline: 1px solid #0d9f76 !important;
  box-shadow: 0 0 0 4px rgba(15, 157, 107, .14) !important;
}
html.fm-login #app form button[type="submit"] {
  min-height: 3rem;
  border-radius: 12px;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -.01em;
  box-shadow: none;
}
.fm-rodape {
  text-align: center;
  font-size: 12px;
  letter-spacing: -.005em;
  color: #86868b;
  margin-top: 2.5rem;
}
@media (max-width: 640px) {
  html.fm-login body { background: #fff; }
  html.fm-login #app main.min-h-screen { padding-top: 3.5rem; }
  html.fm-login #app section.max-w-5xl img { height: 2.25rem !important; }
  html.fm-login #app section.max-w-5xl h2 { font-size: 1.5rem; padding: 0 20px; }
  html.fm-login #app section.shadow,
  html.fm-login #app section[class*="sm:shadow-lg"] {
    margin-left: 4px; margin-right: 4px;
    padding: 1.5rem 1.25rem !important;
    border: 0; box-shadow: none !important;
  }
}

/* ---------- Selo de conexão do WhatsApp (canto inferior do menu) ---------- */
#fm-selo {
  position: fixed;
  left: 10px;
  bottom: 62px;
  z-index: 1; /* dentro do aside: abaixo dos menus que abrem por cima (perfil, disponibilidade) */
  max-width: 180px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font: 600 11.5px/1.2 Inter, system-ui, sans-serif;
  background: #f1f3f6;
  color: #5b616b;
  border: 1px solid #e3e6eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
#fm-selo.no-menu { position: absolute; }

/* nome no topo do menu com o desenho do logo */
.fm-marca-f { font-weight: 700; letter-spacing: -.01em; color: #1d1d1f; }
.fm-marca-c { font-weight: 300; color: #1d1d1f; }
.dark .fm-marca-f, .dark .fm-marca-c { color: #f5f5f7; }

/* ---------- Conversa com cara de WhatsApp Web ----------
   Fundo bege com estampa própria (asteriscos da Fórmula, não a estampa do WhatsApp),
   balão de quem atende em verde-claro, do cliente em branco, sombra fina, horário discreto. */
.conversation-panel {
  background-color: #efeae2 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23000' stroke-opacity='.045' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M30 18v14M23.9 21.5l12.2 7M23.9 28.5l12.2-7'/%3E%3Cpath d='M90 78v14M83.9 81.5l12.2 7M83.9 88.5l12.2-7'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
}
.conversation-panel ul.bg-n-surface-1 { background: transparent !important; }
.right-bubble.bg-n-solid-blue {
  background: #d9fdd3 !important;
  color: #111b21 !important;
}
.left-bubble.bg-n-slate-4 {
  background: #ffffff !important;
  color: #111b21 !important;
}
.right-bubble, .left-bubble {
  border-radius: 8px !important;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13);
}
.right-bubble { border-top-right-radius: 2px !important; }
.left-bubble { border-top-left-radius: 2px !important; }
.right-bubble .text-n-slate-11, .left-bubble .text-n-slate-11 { color: #667781 !important; }
/* modo escuro: os tons do WhatsApp à noite */
.dark .conversation-panel {
  background-color: #0b141a !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.04' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M30 18v14M23.9 21.5l12.2 7M23.9 28.5l12.2-7'/%3E%3Cpath d='M90 78v14M83.9 81.5l12.2 7M83.9 88.5l12.2-7'/%3E%3C/g%3E%3C/svg%3E");
}
.dark .right-bubble.bg-n-solid-blue { background: #005c4b !important; color: #e9edef !important; }
.dark .left-bubble.bg-n-slate-4 { background: #202c33 !important; color: #e9edef !important; }
.dark .right-bubble .text-n-slate-11, .dark .left-bubble .text-n-slate-11 { color: #8696a0 !important; }

/* Relatório de SLA: só existe na versão paga (o servidor não tem a parte enterprise). Esconde o item. */
aside a[href*="/reports/sla"], aside li:has(> a[href*="/reports/sla"]) { display: none !important; }

/* ---------- Fonte e lista no jeito do WhatsApp Web ----------
   Fonte do sistema (a mesma família que o WhatsApp Web usa), nomes maiores, prévia legível,
   fotos maiores e mais respiro entre as conversas. */
body, #app {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}
.conversations-list h4.conversation--user {
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  letter-spacing: -.005em;
}
.conversations-list h4.conversation--user ~ *,
.conversations-list h4.conversation--user + * {
  font-size: 14px !important;
}
.conversations-list span.group\/avatar,
.conversations-list span.group\/avatar img,
.conversations-list span.group\/avatar > span {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
}
.conversations-list > div > div > div {
  padding-top: 4px;
  padding-bottom: 4px;
}
.right-bubble, .left-bubble { font-size: 14.5px !important; line-height: 1.45 !important; }

/* ---------- Lista de conversas: limpa como o WhatsApp (v0.1.3) ----------
   Sem a linha "{ } nome da caixa · responsável" em cada conversa; foto, nome, prévia, hora e contador. */
.conversations-list .conversation .flex.items-center.min-w-0.gap-1:has(.text-label-small) { display: none !important; }
.conversations-list .conversation { border-radius: 12px; margin: 2px 8px; transition: background .12s; }
.conversations-list .conversation:hover { background: rgba(0, 0, 0, .035); }
.dark .conversations-list .conversation:hover { background: rgba(255, 255, 255, .04); }
.conversations-list .conversation.active,
.conversations-list .conversation.selected { background: rgba(15, 157, 107, .08) !important; }
.conversations-list .conversation > div { border-bottom-color: transparent !important; }
.conversations-list .conversation span.group\/avatar { margin-top: 12px !important; }
.conversations-list .conversation .bg-n-teal-9 { background: #0d9f76 !important; min-width: 20px; height: 20px; font-size: 11px; }
.conversations-list .conversation .text-xxs { font-size: 11.5px !important; }
.conversations-list h4.conversation--user { color: #111b21; }
.dark .conversations-list h4.conversation--user { color: #e9edef; }

/* filtros estilo WhatsApp acima da lista */
#fm-filtros { display: flex; gap: 8px; padding: 8px 14px 10px; overflow-x: auto; scrollbar-width: none; }
#fm-filtros::-webkit-scrollbar { display: none; }
#fm-filtros button {
  height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, .1);
  background: transparent; color: #54656f; font: 500 14px/1 "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  white-space: nowrap; cursor: pointer; transition: background .12s, color .12s;
}
#fm-filtros button span { margin-left: 4px; font-size: 12px; opacity: .8; }
#fm-filtros button:hover { background: rgba(0, 0, 0, .04); }
#fm-filtros button.on { background: #d9fdd3; border-color: transparent; color: #0b7a52; }
#fm-filtros button.mais { width: 32px; padding: 0; font-size: 18px; font-weight: 400; }
.dark #fm-filtros button { border-color: rgba(255, 255, 255, .14); color: #aebac1; }
.dark #fm-filtros button:hover { background: rgba(255, 255, 255, .06); }
.dark #fm-filtros button.on { background: #103529; color: #e9edef; }
html.fm-so-naolidas .conversations-list .conversation:not(:has(.bg-n-teal-9)) { display: none !important; }

/* transcrição de áudio */
.fm-transcrever {
  margin-top: 6px; height: 26px; padding: 0 10px; border-radius: 8px;
  border: 1px solid rgba(15, 157, 107, .35); background: rgba(15, 157, 107, .08);
  color: #0b7a52; font: 600 12px/1 Inter, system-ui, sans-serif; cursor: pointer;
}
.fm-transcrever:disabled { opacity: .7; cursor: progress; }
.fm-transcricao {
  margin-top: 6px; padding: 8px 10px; border-radius: 8px; max-width: 420px;
  background: rgba(0, 0, 0, .04); color: #3b4a54; font-size: 13px; line-height: 1.45;
  border-left: 3px solid #0d9f76;
}
.dark .fm-transcrever { color: #56d39a; }
.dark .fm-transcricao { background: rgba(255, 255, 255, .06); color: #d1d7db; }

/* botão de dia/noite: canto superior direito do menu, discreto */
#fm-tema {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #6e6e73;
  cursor: pointer;
  transition: background .15s, color .15s;
}
#fm-tema:hover { background: rgba(0, 0, 0, .06); color: #1d1d1f; }
.dark #fm-tema { color: #a1a1a6; }
.dark #fm-tema:hover { background: rgba(255, 255, 255, .08); color: #f5f5f7; }
#fm-selo i { width: 8px; height: 8px; border-radius: 50%; background: #a0a6b0; flex: none; }
#fm-selo.ok { background: #eaf8ef; color: #17803d; border-color: #c8ecd5; }
#fm-selo.ok i { background: #23a455; box-shadow: 0 0 0 3px rgba(35, 164, 85, .18); }
#fm-selo.alerta { background: #fff4e5; color: #a15c00; border-color: #ffe0b2; }
#fm-selo.alerta i { background: #f59e0b; }
#fm-selo.erro { background: #fdecec; color: #b42318; border-color: #f7c7c3; }
#fm-selo.erro i { background: #e5484d; }
@media (max-width: 768px) { #fm-selo { display: none; } }
.dark #fm-selo { background: #1f2125; border-color: #2c2f34; color: #b5bac1; }

/* ---------- Caixa de mensagem: uma linha só, como no WhatsApp Web ----------
   [+ anexo] [emoji] [/ respostas prontas]  ( Digite uma mensagem )  [microfone | enviar]
   O seletor "Responder / Nota interna" fica numa faixa fina em cima. Tudo por CSS sobre
   a caixa do Chatwoot; o botão "/" vem do formula.js. */
.reply-box {
  display: grid !important;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  column-gap: 2px;
  align-items: end;
  padding: 0 12px 10px;
  background: #f0f2f5 !important;
  border-top: 1px solid rgba(11, 20, 26, .06) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.reply-box > * { grid-column: 1 / -1; }
.reply-box > :first-child { height: 2.4rem !important; padding-left: 0 !important; padding-right: 0 !important; }
.reply-box > :last-child,
.reply-box .left-wrap,
.reply-box .right-wrap { display: contents !important; }
.reply-box > .reply-box__top {
  grid-column: 4; grid-row: 2;
  margin: 0 6px;
  padding: 0 16px !important;
  display: flex; align-items: center;
  min-height: 44px;
  background: #fff;
  border-radius: 22px;
}
.reply-box > .reply-box__top > div { flex: 1; }
/* o Chatwoot fixa a caixa em 120px; aqui ela cresce com o texto, como no WhatsApp */
.reply-box .reply-box__top > div,
.reply-box .reply-box__top .editor-mount,
.reply-box .reply-box__top .ProseMirror-menubar-wrapper { height: auto !important; min-height: 0 !important; max-height: none !important; }
.reply-box .reply-box__top .ProseMirror {
  height: auto !important; min-height: 22px !important; max-height: 9.5rem !important;
  font-size: 15px; line-height: 22px; color: #111b21;
}
.reply-box .ProseMirror p.empty-node::before { content: "Digite uma mensagem" !important; color: #8696a0 !important; }
/* botões redondos em volta da caixa */
.reply-box .left-wrap > button,
.reply-box .left-wrap > .file-uploads > button,
.reply-box .right-wrap > button,
#fm-barra-pronta {
  grid-row: 2;
  width: 42px !important; height: 42px !important; min-width: 42px; padding: 0 !important;
  justify-content: center; border-radius: 50% !important;
  background: transparent !important; color: #54656f !important; outline: none !important;
}
.reply-box .left-wrap > button:hover,
.reply-box .left-wrap > .file-uploads > button:hover,
#fm-barra-pronta:hover { background: rgba(11, 20, 26, .06) !important; }
.reply-box .left-wrap > button [class*="i-ph-"],
.reply-box .left-wrap > .file-uploads [class*="i-ph-"] { width: 24px !important; height: 24px !important; }
.reply-box .left-wrap > .file-uploads { grid-column: 1; grid-row: 2; }
.reply-box .left-wrap > button:has(.i-ph-smiley-sticker) { grid-column: 2; }
#fm-barra-pronta { grid-column: 3; display: inline-flex; align-items: center; border: 0; cursor: pointer; font: 600 19px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
.reply-box .left-wrap > button:has(.i-ph-microphone),
.reply-box .right-wrap > button { grid-column: 5; }
.reply-box .left-wrap > button:has(.i-ph-signature) { display: none !important; }
/* anexo vira "+", como no WhatsApp e no BotConversa */
.reply-box .file-uploads .i-ph-paperclip {
  --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
/* microfone com a caixa vazia; enviar (verde, redondo) quando há texto */
.reply-box:has(.right-wrap > button[type="submit"]:disabled) .right-wrap > button[type="submit"] { display: none !important; }
.reply-box:has(.right-wrap > button[type="submit"]:not(:disabled)) .left-wrap > button:has(.i-ph-microphone) { display: none !important; }
.reply-box .right-wrap > button[type="submit"] {
  background: #0d9f76 !important; color: #fff !important; font-size: 0 !important;
}
.reply-box .right-wrap > button[type="submit"] > * { display: none !important; }
.reply-box .right-wrap > button[type="submit"]::before {
  content: ""; width: 22px; height: 22px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.4 20.4 21 12 3.4 3.6 3.4 10l12.6 2-12.6 2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.4 20.4 21 12 3.4 3.6 3.4 10l12.6 2-12.6 2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.reply-box .right-wrap > button[type="submit"]:hover { filter: brightness(1.08); }
/* nota interna: a caixa fica amarelada, para nunca ser confundida com mensagem ao cliente */
.reply-box.is-private > .reply-box__top { background: #fff6d6; }
/* modo escuro: tons do WhatsApp à noite */
.dark .reply-box { background: #202c33 !important; border-top-color: rgba(255, 255, 255, .04) !important; }
.dark .reply-box > .reply-box__top { background: #2a3942; }
.dark .reply-box .reply-box__top .ProseMirror { color: #d1d7db; }
.dark .reply-box .left-wrap > button,
.dark .reply-box .left-wrap > .file-uploads > button,
.dark #fm-barra-pronta { color: #aebac1 !important; }
.dark .reply-box .left-wrap > button:hover,
.dark .reply-box .left-wrap > .file-uploads > button:hover,
.dark #fm-barra-pronta:hover { background: rgba(255, 255, 255, .06) !important; }
.dark .reply-box.is-private > .reply-box__top { background: #3b3522; }

/* ---------- Símbolo Núcleo vivo (menu lateral) ----------
   Um halo menta que respira devagar (quase imperceptível) e um reflexo de luz que passa
   UMA vez quando o formula.js põe a classe "brilha" (entrada, mensagem nova, conexão). */
.fm-nucleo { position: relative; isolation: isolate; width: 28px !important; height: 28px !important; }
.fm-nucleo img { width: 28px !important; height: 28px !important; max-width: none !important; }
.fm-nucleo::before {
  content: ""; position: absolute; inset: -12px; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(101, 230, 189, .7) 30%, rgba(101, 230, 189, 0) 72%);
  opacity: 0; animation: fm-respira 7s ease-in-out infinite;
}
.fm-nucleo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .95) 50%, transparent 65%) 150% 0 / 300% 100% no-repeat;
  -webkit-mask: url("/marca/simbolo.png") center / 28px 28px no-repeat;
          mask: url("/marca/simbolo.png") center / 28px 28px no-repeat;
  opacity: 0;
}
.fm-nucleo.brilha::after { animation: fm-reflexo 1.3s cubic-bezier(.4, 0, .2, 1) 1; }
.fm-nucleo.brilha::before { animation: fm-acende 1.6s ease-out 1, fm-respira 7s ease-in-out 1.6s infinite; }
@keyframes fm-respira { 0%, 100% { opacity: 0; transform: scale(.85); } 50% { opacity: .35; transform: scale(1); } }
@keyframes fm-acende { 0% { opacity: 0; transform: scale(.7); } 35% { opacity: .9; transform: scale(1.15); } 100% { opacity: 0; transform: scale(1); } }
@keyframes fm-reflexo { 0% { opacity: 1; background-position: 150% 0; } 100% { opacity: 1; background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) {
  .fm-nucleo::before, .fm-nucleo::after, .fm-nucleo.brilha::before, .fm-nucleo.brilha::after { animation: none !important; }
}

/* ---------- Convite para instalar no celular ---------- */
#fm-instalar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: #fff; color: #111b21; border: 1px solid rgba(11, 20, 26, .08); border-radius: 18px;
  box-shadow: 0 10px 30px rgba(7, 27, 25, .16);
  font: 13px/1.35 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  animation: fm-sobe .35s cubic-bezier(.2, .8, .2, 1);
}
#fm-instalar img { width: 40px; height: 40px; border-radius: 11px; flex: none; }
#fm-instalar div { flex: 1; min-width: 0; }
#fm-instalar b { display: block; font-size: 14px; font-weight: 600; }
#fm-instalar span { color: #667781; }
#fm-instalar button { flex: none; border: 0; border-radius: 999px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; background: transparent; color: #667781; }
#fm-instalar button[data-a="sim"] { background: #0d9f76; color: #fff; }
.dark #fm-instalar { background: #202c33; color: #e9edef; border-color: rgba(255, 255, 255, .06); }
.dark #fm-instalar span, .dark #fm-instalar button[data-a="nao"] { color: #8696a0; }
@keyframes fm-sobe { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #fm-instalar { animation: none; } }

/* ---------- Menu recolhido: só o símbolo e os ícones ----------
   O formula.js põe html.fm-menu-curto quando o menu fica estreito. */
.fm-menu-curto #fm-tema { display: none !important; }
.fm-menu-curto aside .fm-nucleo { margin: 4px auto; }
.fm-menu-curto #fm-funil .truncate,
.fm-menu-curto #fm-conexao .truncate, .fm-menu-curto #fm-hoje .truncate { display: none !important; }
.fm-menu-curto #fm-funil > a,
.fm-menu-curto #fm-conexao > a, .fm-menu-curto #fm-hoje > a { justify-content: center !important; padding-left: 0 !important; padding-right: 0 !important; width: 2.5rem; margin: 0 auto; }

/* ---------- Celular (mobile first) ----------
   Lista do tamanho da tela, barra de abas embaixo, conversa e caixa de mensagem enxutas. */
@media (max-width: 767px) {
  /* a largura da lista arrastada no computador não vale no celular */
  .conversations-list-wrap { width: 100% !important; max-width: 100vw !important; flex-shrink: 1 !important; }
  .fm-com-barra .conversations-list { padding-bottom: 76px; }
  .fm-com-barra .fm-fab { display: none !important; }
  #fm-filtros { padding: 6px 12px 10px; }
  #fm-filtros button { height: 34px; padding: 0 14px; }
  /* conversa: voltar só com a seta; caixa de mensagem com espaço para o texto */
  .conversation-panel { padding-bottom: 4px; }
  button:has(> .i-lucide-chevron-left) { font-size: 0 !important; padding: 6px !important; }
  button:has(> .i-lucide-chevron-left) .i-lucide-chevron-left { font-size: 24px; margin: 0 !important; }
  .reply-box { padding: 0 6px calc(8px + env(safe-area-inset-bottom)) !important; column-gap: 0; }
  .reply-box > :first-child { height: 2.2rem !important; }
  .reply-box > .reply-box__top { margin: 0 4px; padding: 0 14px !important; }
  .reply-box .left-wrap > button,
  .reply-box .left-wrap > .file-uploads > button,
  .reply-box .right-wrap > button { width: 40px !important; height: 44px !important; min-width: 40px; }
  #fm-barra-pronta { display: none !important; } /* no celular, digitar "/" abre as respostas prontas */
  .reply-box .reply-box__top .ProseMirror { font-size: 16px; scrollbar-width: none; } /* 16px: o iPhone não dá zoom ao tocar */
}
.reply-box .reply-box__top .ProseMirror::-webkit-scrollbar { display: none; }
.reply-box .reply-box__top .ProseMirror { scrollbar-width: none; }

#fm-barra-celular {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; /* abaixo da gaveta do Chatwoot (40) */
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid rgba(11, 20, 26, .08);
  font: 500 11px/1.2 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
#fm-barra-celular a {
  display: grid; justify-items: center; gap: 3px; padding: 6px 0; border-radius: 14px;
  color: #54656f; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
#fm-barra-celular svg { width: 24px; height: 24px; }
#fm-barra-celular a.on { color: #0d9f76; }
#fm-barra-celular a.on svg { background: rgba(13, 159, 118, .12); border-radius: 999px; padding: 3px 16px; box-sizing: content-box; }
#fm-barra-celular a:active { transform: scale(.96); }
.dark #fm-barra-celular { background: rgba(17, 27, 33, .92); border-top-color: rgba(255, 255, 255, .06); }
.dark #fm-barra-celular a { color: #aebac1; }
.dark #fm-barra-celular a.on { color: #65e6bd; }
.dark #fm-barra-celular a.on svg { background: rgba(101, 230, 189, .14); }
.fm-com-barra #fm-instalar { bottom: calc(84px + env(safe-area-inset-bottom)); }
.fm-com-barra #fm-selo { display: none !important; }

/* ---------- Acabamento 0.2.0 (pesquisa de design, 28/10) ----------
   Sombras em camadas tingidas no verde profundo em vez de bordas sólidas, números tabulares,
   contorno interno nas fotos, toque firme e rápido. Referências: Jakub Krehel, Vercel Web
   Interface Guidelines, Josh Comeau (sombras), Apple HIG (tab bars, dark mode). */
:root { --fm-sombra: 165deg 60% 10%; }
/* horários, contadores e números não "pulam" ao mudar */
.conversations-list time, .conversations-list .bg-n-teal-9, .conversations-list [class*="text-xxs"],
#fm-filtros span, .right-bubble .text-n-slate-11, .left-bubble .text-n-slate-11, #fm-barra-celular { font-variant-numeric: tabular-nums; }
/* fotos e avatares com contorno interno: foto clara não some no fundo claro */
.conversations-list img, .conversation-panel img[class*="rounded-full"], header img[class*="rounded-full"] { outline: 1px solid rgba(7, 27, 25, .08); outline-offset: -1px; }
.dark .conversations-list img, .dark .conversation-panel img[class*="rounded-full"], .dark header img[class*="rounded-full"] { outline-color: rgba(255, 255, 255, .1); }
/* prévias de mensagem quebram sem deixar palavra sozinha */
.conversations-list .conversation p, .conversations-list .conversation span { text-wrap: pretty; }
/* balões: sombra em duas camadas, tingida, quase imperceptível */
.right-bubble, .left-bubble { box-shadow: 0 0 0 .5px hsl(var(--fm-sombra) / .06), 0 1px 1.5px hsl(var(--fm-sombra) / .1) !important; }
.dark .right-bubble, .dark .left-bubble { box-shadow: 0 0 0 .5px rgba(255, 255, 255, .04), 0 1px 1.5px rgba(0, 0, 0, .35) !important; }
/* campo de mensagem: anel fino em vez de chapado, e acende ao focar */
.reply-box > .reply-box__top { box-shadow: 0 0 0 1px hsl(var(--fm-sombra) / .07), 0 1px 2px -1px hsl(var(--fm-sombra) / .08); transition: box-shadow .16s ease-out; }
.reply-box.is-focused > .reply-box__top { box-shadow: 0 0 0 1px rgba(13, 159, 118, .45), 0 0 0 4px rgba(13, 159, 118, .1); }
.dark .reply-box > .reply-box__top { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }
.dark .reply-box.is-focused > .reply-box__top { box-shadow: 0 0 0 1px rgba(101, 230, 189, .4), 0 0 0 4px rgba(101, 230, 189, .08); }
/* enviar: o único elemento com cor cheia; sombra verde suave */
.reply-box .right-wrap > button[type="submit"] { box-shadow: 0 1px 2px hsl(var(--fm-sombra) / .2), 0 6px 16px -6px rgba(13, 159, 118, .55); }
/* toque: resposta imediata ao pressionar, sem zoom de duplo toque */
.reply-box button, #fm-filtros button, #fm-barra-celular a, #fm-instalar button, .conversations-list .conversation {
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.reply-box .left-wrap > button:active, .reply-box .left-wrap > .file-uploads > button:active,
.reply-box .right-wrap > button:active, #fm-barra-pronta:active, #fm-filtros button:active { transform: scale(.94); }
.reply-box .left-wrap > button, .reply-box .left-wrap > .file-uploads > button, .reply-box .right-wrap > button,
#fm-barra-pronta, #fm-filtros button { transition: transform .16s ease-out, background-color .16s ease-out; }
/* filtros: pílula ativa com sombra de relevo mínima */
#fm-filtros button.on { box-shadow: 0 0 0 1px rgba(13, 159, 118, .18), 0 1px 2px hsl(var(--fm-sombra) / .08); }
/* barra de abas: contador de não lidas só em Conversas */
#fm-barra-celular a { position: relative; }
#fm-barra-celular a b {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #0d9f76; color: #fff; font: 700 11px/18px "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 0 0 2px #fff;
}
.dark #fm-barra-celular a b { box-shadow: 0 0 0 2px #111b21; }
@media (max-width: 767px) {
  /* o campo e a barra acompanham o teclado e a borda de baixo do iPhone */
  .reply-box { padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important; }
}

/* ---------- Refinamento 0.2.2: mais leve, branco limpo ----------
   Lista no desenho do WhatsApp atual: linhas sem cartão, separador fino que começa no texto,
   pesos mais leves, hora verde quando há não lidas; filtros em pílula cheia, sem borda. */
.conversations-list .conversation { margin: 0 !important; border-radius: 0 !important; padding-left: 14px; }
.conversations-list .conversation > div.border-line,
.conversations-list .conversation .border-line {
  border-bottom: .5px solid rgba(11, 20, 26, .08) !important; padding-top: 12px !important; padding-bottom: 12px !important;
}
.dark .conversations-list .conversation .border-line { border-bottom-color: rgba(255, 255, 255, .06) !important; }
.conversations-list .conversation span.group\/avatar { margin-top: 10px !important; }
.conversations-list span.group\/avatar, .conversations-list span.group\/avatar img, .conversations-list span.group\/avatar > span {
  width: 48px !important; height: 48px !important; min-width: 48px !important;
}
.conversations-list h4.conversation--user { font-size: 16px !important; font-weight: 500 !important; letter-spacing: -.01em; color: #111b21; }
.conversations-list h4.conversation--user ~ *, .conversations-list h4.conversation--user + * { color: #667781; font-weight: 400 !important; }
.dark .conversations-list h4.conversation--user ~ *, .dark .conversations-list h4.conversation--user + * { color: #8696a0; }
.conversations-list .conversation .text-xxs { color: #667781; font-weight: 400; }
.conversations-list .conversation:has(.bg-n-teal-9) .text-xxs { color: #0d9f76 !important; font-weight: 600; }
.conversations-list .conversation:has(.bg-n-teal-9) h4.conversation--user { font-weight: 600 !important; }
.conversations-list .conversation .bg-n-teal-9 { min-width: 20px; height: 20px; padding: 0 6px; font-size: 11.5px; font-weight: 600; }
.conversations-list .conversation:active { background: rgba(11, 20, 26, .05); }
#fm-filtros { gap: 6px; }
#fm-filtros button {
  height: 32px; padding: 0 13px; border: 0 !important; background: #f0f2f5; color: #54656f; font-weight: 500;
}
#fm-filtros button:hover { background: #e9edef; }
#fm-filtros button.on { background: #d8fbea; color: #087a5b; box-shadow: none; }
#fm-filtros button.mais { background: transparent; color: #8696a0; }
.dark #fm-filtros button { background: #202c33; color: #aebac1; }
.dark #fm-filtros button.on { background: #0f3b31; color: #65e6bd; }
/* abas Minhas / Não atribuídas / Todos: contador em cinza leve */
.conversations-list-wrap [class*="rounded-md"][class*="bg-n-"] { font-variant-numeric: tabular-nums; }

/* botão dia/noite: no celular, círculo com fundo suave no topo da gaveta do Menu (a gaveta tem 200px:
   sem rótulo, para não cobrir o nome) */
#fm-tema .rotulo { display: none; }
@media (max-width: 767px) {
  #fm-tema {
    width: 32px !important; height: 32px !important; border-radius: 999px !important; top: 8px !important; right: 8px !important;
    background: #f0f2f5 !important; color: #3b4a54 !important;
  }
  .dark #fm-tema { background: #202c33 !important; color: #d1d7db !important; }
  /* gaveta: mais respiro e pesos leves */
  aside a, aside button { font-weight: 500; }
  #fm-barra-celular { background: rgba(255, 255, 255, .94); border-top: .5px solid rgba(11, 20, 26, .1); }
}

/* ---------- Entrada do app ----------
   Enquanto o Chatwoot carrega (o #app ainda vazio), fundo branco com o símbolo Núcleo:
   ele aparece, respira e um reflexo de luz passa por ele. Some sozinho quando o app desenha a tela. */
body:has(#app:empty)::before {
  content: ""; position: fixed; inset: 0; z-index: 9998;
  background: #fff url("/marca/simbolo.png?v=5") center / 76px 76px no-repeat;
  animation: fm-entra-simbolo .5s cubic-bezier(.2, .8, .2, 1) both;
}
body:has(#app:empty)::after {
  content: ""; position: fixed; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; z-index: 9999;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .95) 50%, transparent 65%) 150% 0 / 300% 100% no-repeat;
  -webkit-mask: url("/marca/simbolo.png?v=5") center / contain no-repeat; mask: url("/marca/simbolo.png?v=5") center / contain no-repeat;
  animation: fm-reflexo-entrada 1.6s cubic-bezier(.4, 0, .2, 1) .35s infinite;
}
.dark body:has(#app:empty)::before, body.dark:has(#app:empty)::before { background-color: #0b141a; }
@keyframes fm-entra-simbolo { from { opacity: 0; background-size: 60px 60px; } to { opacity: 1; background-size: 76px 76px; } }
@keyframes fm-reflexo-entrada { 0% { background-position: 150% 0; } 60%, 100% { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { body:has(#app:empty)::before, body:has(#app:empty)::after { animation: none; } }

/* ---------- Conversa aberta (0.2.5) ----------
   Cabeçalho em uma linha (o Chatwoot empilha em duas abaixo de 1280px): voltar, foto, nome e,
   à direita, Resolver e o menu. No celular some o subtítulo técnico ("#26 · { } caixa") e o
   ícone de remetente ao lado dos balões enviados, como no WhatsApp. */
div:has(> .header-actions-wrap) {
  flex-direction: row !important; height: auto !important; min-height: 56px; gap: 8px !important;
  padding: 8px 12px !important; align-items: center !important;
}
.header-actions-wrap { width: auto !important; flex-shrink: 0; }
div:has(> .header-actions-wrap) > div:first-child { flex: 1 1 auto; width: auto !important; }
.conversation--header--actions { font-size: 12px; color: #667781; }
/* botão do painel do contato: círculo leve com sombra tingida */
button:has(> .i-ph-user-bold) {
  background: rgba(255, 255, 255, .92) !important; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 0 0 .5px rgba(7, 27, 25, .1), 0 4px 12px -4px rgba(7, 27, 25, .2) !important;
}
.dark button:has(> .i-ph-user-bold) { background: rgba(32, 44, 51, .92) !important; }
@media (max-width: 767px) {
  .conversation--header--actions { display: none !important; }
  div:has(> div > .right-bubble) > .v-popper--has-tooltip:first-child { display: none !important; }
  div:has(> .header-actions-wrap) { padding: 6px 8px !important; min-height: 52px; }
  .header-actions-wrap button { height: 34px; }
}
/* botão "Marcar como não lida" no topo da conversa */
#fm-naolida {
  width: 34px; height: 34px; border-radius: 999px; border: 0; display: inline-grid; place-items: center;
  background: transparent; color: #54656f; cursor: pointer; transition: background .16s ease-out, transform .16s ease-out;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
#fm-naolida:hover { background: rgba(11, 20, 26, .06); }
#fm-naolida:active { transform: scale(.94); }
#fm-naolida:disabled { opacity: .5; }
.dark #fm-naolida { color: #aebac1; }
.dark #fm-naolida:hover { background: rgba(255, 255, 255, .06); }
/* convite de instalar: texto em duas linhas no máximo, botões compactos */
@media (max-width: 767px) {
  #fm-instalar { gap: 10px; padding: 10px 10px 10px 12px; }
  #fm-instalar span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; }
  #fm-instalar button { padding: 8px 10px; }
}

/* ---------- Direção 0.3.0: vidro calmo + profundidade suave ----------
   Vidro fosco só no que flutua (topo da conversa, campo de mensagem, barra de abas);
   balões com brilho interno e sombra tingida em camadas; verde vivo só na ação principal;
   nota interna amarela que se reconhece de longe. Grade de 4/8 px. */
.conversation-panel {
  background-image:
    radial-gradient(60% 40% at 85% 0%, rgba(101, 230, 189, .16), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%230d9f76' stroke-opacity='.06' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M30 18v14M23.9 21.5l12.2 7M23.9 28.5l12.2-7'/%3E%3Cpath d='M90 78v14M83.9 81.5l12.2 7M83.9 88.5l12.2-7'/%3E%3C/g%3E%3C/svg%3E") !important;
}
.right-bubble, .left-bubble { border-radius: 18px !important; padding-top: 8px; }
.left-bubble {
  border-top-left-radius: 6px !important;
  background: rgba(255, 255, 255, .9) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 .5px hsl(var(--fm-sombra) / .07),
    0 2px 4px -1px hsl(var(--fm-sombra) / .08), 0 10px 24px -14px hsl(var(--fm-sombra) / .28) !important;
}
.right-bubble.bg-n-solid-blue {
  border-top-right-radius: 6px !important;
  background: linear-gradient(180deg, #dcfcec, #c6f5df) !important; color: #06332a !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 .5px rgba(13, 159, 118, .2),
    0 2px 4px -1px rgba(13, 159, 118, .16), 0 10px 24px -14px rgba(13, 159, 118, .45) !important;
}
/* nota interna: amarela, com aviso de que só a equipe vê */
.bg-n-solid-amber.right-bubble, .right-bubble.bg-n-solid-amber {
  background: #fff4cf !important; color: #5c4300 !important;
  box-shadow: inset 0 0 0 .5px rgba(180, 120, 0, .3), 0 6px 16px -10px rgba(180, 120, 0, .4) !important;
}
.right-bubble.bg-n-solid-amber::before {
  content: "Nota interna · só a equipe vê"; display: block; margin-bottom: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; color: #8a6400;
}
/* topo da conversa em vidro */
div:has(> .header-actions-wrap) {
  background: rgba(255, 255, 255, .72) !important;
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px);
  border-bottom: .5px solid rgba(7, 27, 25, .08) !important;
}
/* campo de mensagem em vidro, acima do fundo */
.reply-box { background: transparent !important; border-top: 0 !important; }
.reply-box > :first-child { background: transparent !important; }
.reply-box > .reply-box__top {
  background: rgba(255, 255, 255, .78) !important;
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 .5px hsl(var(--fm-sombra) / .1), 0 12px 28px -16px hsl(var(--fm-sombra) / .4);
}
/* enviar e microfone: o único verde cheio, com brilho */
.reply-box .right-wrap > button[type="submit"] {
  background: radial-gradient(circle at 30% 25%, #3fd7a6, #0d9f76 60%, #0a8664) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 18px -8px rgba(13, 159, 118, .75) !important;
}
.reply-box .left-wrap > button:has(.i-ph-microphone) {
  background: radial-gradient(circle at 30% 25%, #3fd7a6, #0d9f76 60%, #0a8664) !important; color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 18px -8px rgba(13, 159, 118, .75) !important;
}
/* modo escuro: as mesmas camadas, em verde profundo */
.dark .conversation-panel { background-color: #0b141a !important; }
.dark .left-bubble { background: rgba(32, 44, 51, .92) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 0 0 .5px rgba(255, 255, 255, .05), 0 10px 24px -14px rgba(0, 0, 0, .6) !important; }
.dark .right-bubble.bg-n-solid-blue { background: linear-gradient(180deg, #0b5e4b, #054c3d) !important; color: #e9f7f1 !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 24px -14px rgba(0, 0, 0, .6) !important; }
.dark .right-bubble.bg-n-solid-amber { background: #3a3218 !important; color: #f3e3b0 !important; }
.dark .right-bubble.bg-n-solid-amber::before { color: #e0c46a; }
.dark div:has(> .header-actions-wrap) { background: rgba(17, 27, 33, .72) !important; border-bottom-color: rgba(255, 255, 255, .06) !important; }
.dark .reply-box > .reply-box__top { background: rgba(42, 57, 66, .78) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 12px 28px -16px rgba(0, 0, 0, .6); }
/* caixa de mensagem estreita (tablet, painel lateral aberto): pela largura da própria coluna,
   não da tela. Some o "/" e o seletor Responder/Nota fica numa linha. */
div:has(> .reply-box) { container-type: inline-size; }
@container (max-width: 420px) {
  #fm-barra-pronta { display: none !important; }
  .reply-box { padding-left: 6px !important; padding-right: 6px !important; }
  .reply-box > :first-child button div { white-space: nowrap; font-size: 12.5px; padding-left: 6px !important; padding-right: 6px !important; }
  .reply-box .left-wrap > button, .reply-box .left-wrap > .file-uploads > button,
  .reply-box .right-wrap > button { width: 38px !important; min-width: 38px; }
}
@container (max-width: 300px) {
  .reply-box .left-wrap > button:has(.i-ph-smiley-sticker) { display: none !important; }
  .reply-box > .reply-box__top { margin: 0 2px; padding: 0 10px !important; }
}

/* ---------- Fixar e silenciar (0.4.0) ---------- */
#fm-acoes { display: inline-flex; gap: 2px; }
#fm-acoes button {
  width: 34px; height: 34px; border-radius: 999px; border: 0; display: inline-grid; place-items: center;
  background: transparent; color: #54656f; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background .16s ease-out, color .16s ease-out, transform .16s ease-out;
}
#fm-acoes button:hover { background: rgba(11, 20, 26, .06); }
#fm-acoes button:active { transform: scale(.94); }
#fm-acoes button.on { color: #0d9f76; background: rgba(13, 159, 118, .12); }
.dark #fm-acoes button { color: #aebac1; }
.dark #fm-acoes button.on { color: #65e6bd; background: rgba(101, 230, 189, .12); }

/* ---------- Etapa e responsável no topo da conversa (0.4.0) ---------- */
div:has(> .header-actions-wrap) { flex-wrap: wrap !important; flex: none !important; }
#fm-chips { order: 3; flex: 1 0 100%; display: flex; gap: 6px; padding: 2px 0 2px 44px; overflow-x: auto; scrollbar-width: none; }
#fm-chips::-webkit-scrollbar { display: none; }
#fm-chips .chip {
  position: relative; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; flex: none;
  border-radius: 999px; background: rgba(13, 159, 118, .1); color: #087a5b; font-size: 12.5px; font-weight: 600;
  box-shadow: inset 0 0 0 .5px rgba(13, 159, 118, .25); cursor: pointer; transition: box-shadow .2s ease-out;
}
#fm-chips .chip.resp { background: rgba(11, 20, 26, .05); color: #3b4a54; box-shadow: inset 0 0 0 .5px rgba(11, 20, 26, .1); }
#fm-chips .chip span { font-weight: 500; opacity: .7; }
#fm-chips select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600;
  padding-right: 14px; cursor: pointer; outline: none; max-width: 160px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667781' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center; background-size: 12px;
}
#fm-chips .chip.salvo { box-shadow: inset 0 0 0 1.5px #0d9f76; }
#fm-chips .chip.erro { box-shadow: inset 0 0 0 1.5px #e5484d; }
.dark #fm-chips .chip { background: rgba(101, 230, 189, .12); color: #65e6bd; }
.dark #fm-chips .chip.resp { background: rgba(255, 255, 255, .06); color: #d1d7db; }
@media (max-width: 767px) { #fm-chips { padding-left: 4px; } #fm-chips select { font-size: 16px; } #fm-chips .chip { height: 30px; } }
/* topo da conversa: nome encolhe antes de quebrar linha, ações ficam na mesma linha */
div:has(> .header-actions-wrap) > div:first-child { flex: 1 1 0 !important; min-width: 0 !important; }
.header-actions-wrap { flex: none !important; }
@media (max-width: 767px) {
  .header-actions-wrap .actions--container { gap: 2px !important; }
  #fm-acoes button, #fm-naolida { width: 32px; height: 32px; }
}
/* telefone e e-mail escondidos para atendentes, quando a conta liga "mascarar-telefone" */
html.fm-mascarar .fm-oculto { filter: blur(5px); user-select: none; -webkit-user-select: none; pointer-events: none; }
html.fm-mascarar button:has(> .i-lucide-copy), html.fm-mascarar button:has(> [class*="i-ph-copy"]) { display: none !important; }

/* ---------- Conversa mais compacta, como no WhatsApp (0.5.2) ----------
   Horário no canto da última linha (não numa linha só dele), balão mais justo e 3px entre
   mensagens seguidas. Balão de uma linha cai de ~67px para ~36px. */
.left-bubble, .right-bubble {
  display: flex !important; flex-wrap: wrap; align-items: flex-end; column-gap: 8px;
  padding: 6px 9px 5px 10px !important; line-height: 1.38 !important;
}
.left-bubble > div:first-child, .right-bubble > div:first-child { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.left-bubble > .mt-2:last-child, .right-bubble > .mt-2:last-child {
  margin: 0 0 -1px auto !important; font-size: 11px !important; line-height: 1 !important; padding-top: 4px; white-space: nowrap;
}
.left-bubble .gap-3, .right-bubble .gap-3 { gap: 6px !important; }
.conversation-panel .flex.w-full.mb-2 { margin-bottom: 3px !important; }
.conversation-panel .message-bubble-container:not(.justify-center) + .message-bubble-container:not(.justify-center) { margin-top: 0; }
/* celular: botões da conversa à direita na linha das pílulas */
#fm-chips #fm-acoes { margin-left: auto; flex: none; order: 2; }
#fm-chips #fm-naolida { flex: none; order: 3; }

/* ---------- Tipografia 0.6.0: Inter em tudo, Manrope nos títulos e na marca ---------- */
:root { --fm-fonte: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; --fm-titulo: "Manrope", "Inter", -apple-system, sans-serif; }
body, #app, #app button, #app input, #app textarea, #app select, .ProseMirror { font-family: var(--fm-fonte) !important; font-feature-settings: "cv11", "ss01"; }
#app h1, #app h2, .fm-marca-f, .fm-marca-c, html.fm-login #app section.max-w-5xl h2 { font-family: var(--fm-titulo) !important; letter-spacing: -.02em; }

/* ---------- Boas-vindas (0.6.0) ---------- */
#fm-boasvindas {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; width: min(380px, calc(100vw - 24px));
  padding: 18px; border-radius: 22px; background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px);
  box-shadow: 0 0 0 .5px hsl(var(--fm-sombra) / .1), 0 24px 60px -24px hsl(var(--fm-sombra) / .45);
  font-family: var(--fm-fonte); color: #0b1f1c; animation: fm-sobe .4s cubic-bezier(.2, .8, .2, 1);
}
#fm-boasvindas .fm-bv-topo { display: flex; gap: 12px; align-items: center; }
#fm-boasvindas .fm-bv-topo img { width: 40px; height: 40px; }
#fm-boasvindas .fm-bv-topo b { display: block; font: 700 17px/1.2 var(--fm-titulo); letter-spacing: -.02em; }
#fm-boasvindas .fm-bv-topo span { color: #5d726d; font-size: 13.5px; }
#fm-boasvindas ol { list-style: none; margin: 14px 0 10px; padding: 0; display: grid; gap: 6px; }
#fm-boasvindas a { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 14px; text-decoration: none; color: inherit; transition: background .16s ease-out; }
#fm-boasvindas a:hover { background: rgba(13, 159, 118, .07); }
#fm-boasvindas em { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 13px; color: #fff; background: #0d9f76; }
#fm-boasvindas a b { display: block; font-size: 14.5px; }
#fm-boasvindas a small { display: block; color: #5d726d; font-size: 13px; line-height: 1.35; margin-top: 1px; }
#fm-boasvindas [data-a="fechar"] { width: 100%; min-height: 44px; border: 0; border-radius: 999px; background: #f0f2f5; color: #3b4a54; font: 600 14px/1 var(--fm-fonte); cursor: pointer; }
.dark #fm-boasvindas { background: rgba(17, 27, 33, .96); color: #e9edef; }
.dark #fm-boasvindas [data-a="fechar"] { background: #202c33; color: #d1d7db; }
.fm-com-barra #fm-boasvindas { bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; }

/* tela vazia da conversa: convite útil e sem a lista de atalhos de teclado */
.fm-tela-vazia { text-align: center; }
.fm-tela-vazia > div:has(kbd) { display: none !important; }
.fm-vazia-link { display: inline-block; margin-top: 10px; color: #0d9f76; font-weight: 600; text-decoration: none; }

/* o botão de IA do próprio Chatwoot (Captain/Copilot) não está ligado aqui: some para não levar a um beco */
.reply-box button:has(.i-ph-sparkle-fill) { display: none !important; }

/* ---------- Acessibilidade (0.6.0): foco visível e toque de 44px no celular ---------- */
#fm-filtros button:focus-visible, #fm-barra-celular a:focus-visible, #fm-acoes button:focus-visible, #fm-naolida:focus-visible,
#fm-chips select:focus-visible, #fm-boasvindas a:focus-visible, #fm-boasvindas button:focus-visible, #fm-tema:focus-visible {
  outline: 2px solid #0d9f76; outline-offset: 2px;
}
@media (max-width: 767px) {
  #fm-acoes button, #fm-naolida { width: 44px !important; height: 44px !important; }
  #fm-filtros button { min-height: 36px; }
  #fm-barra-celular a { min-height: 52px; }
}
