/* Aba Atendimento: o WhatsApp e o Instagram da loja dentro do console. Lista a esquerda, conversa no meio,
   tradutor a direita. O desenho de conversa e o do WhatsApp (baloes com bico, tiques, dia no meio) para o
   dono nao precisar aprender nada. Cliente a esquerda em branco; voce a direita em azul; a IA a direita em
   azul claro, para saber de longe quem falou. As cores vem do styles.css. */

body.no-atendimento { overflow-x: clip; }
body.no-atendimento .app { max-width: 104rem; padding: 0 16px 16px; }
body.no-atendimento .topo { margin-bottom: 14px; padding-left: 20px; padding-right: 20px; }

.aba__conta {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 2px;
  padding: 0 5px;
  border-radius: 9999px;
  background: var(--azul);
  color: var(--sobre-azul);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.aba[aria-selected='true'] .aba__conta { background: var(--sobre-azul); color: var(--azul-forte); }

.at {
  position: relative;
  display: grid;
  grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: calc(100dvh - 89px);
  min-height: 30rem;
  background: var(--branco);
  border: 1px solid var(--linha-forte);
  border-radius: var(--r-painel);
  box-shadow: var(--sombra-alta);
  overflow: hidden;
}
.at.com-tradutor { grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr) minmax(19rem, 23rem); }

/* ---------- lista ---------- */
.at-lado {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--linha);
  background: var(--branco);
}

.at-filtros { display: flex; gap: 3px; margin: 12px 12px 8px; padding: 3px; border-radius: 12px; background: var(--fundo); }
.at-filtros button {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 7px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--apagado);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s var(--padrao), color 0.15s var(--padrao);
}
.at-filtros button:hover { color: var(--tinta); }
.at-filtros button[aria-selected='true'] { color: var(--azul-texto); background: var(--branco); box-shadow: var(--sombra); }
.at-filtros b {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9999px;
  background: var(--azul); color: var(--sobre-azul); font-size: 10.5px; font-weight: 700;
}
.at-filtros b:empty { display: none; }

input.at-busca {
  width: calc(100% - 24px);
  margin: 0 12px 8px;
  padding: 8px 12px 8px 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--fundo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235d6b8a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.500-3.500'/%3E%3C/svg%3E") 12px center no-repeat;
  font-size: 14px;
}

.at-lista { list-style: none; margin: 0; padding: 0 8px 10px; overflow-y: auto; flex: 1; min-height: 0; }
.at-lista__vazio { color: var(--fraco); font-size: 13.5px; padding: 18px 10px; line-height: 1.5; }

.at-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 2px 11px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s var(--padrao);
}
.at-item:hover { background: var(--fundo); }
.at-item[aria-current='true'] { background: var(--azul-claro); }
.at-item .at-avatar { grid-row: span 2; }
.at-item__nome { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-item__hora { color: var(--fraco); font-size: 12px; justify-self: end; }
.at-item__previa {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--apagado);
  font-size: 13px;
}
.at-item__previa svg { flex: 0 0 auto; color: var(--fraco); }
.at-item__previa span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-item__previa i { font-style: normal; color: var(--fraco); flex: 0 0 auto; }
.at-item__marca {
  justify-self: end;
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 9999px;
  background: var(--azul);
  color: var(--sobre-azul);
  font-size: 11.5px;
  font-weight: 700;
}
.at-item--nova .at-item__hora { color: var(--azul); font-weight: 600; }
.at-item--nova .at-item__previa { color: var(--tinta); font-weight: 500; }
.at-item__etiquetas { grid-column: 2 / -1; display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.at-etiqueta {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 9999px;
  padding: 1px 8px;
}
.at-etiqueta--motivo { color: var(--ambar); background: var(--ambar-claro); }
.at-etiqueta--idioma { color: var(--azul-texto); background: var(--branco); border: 1px solid var(--azul-borda); }

/* avatar com o selo do canal no canto */
.at-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tom, var(--azul-claro));
  color: var(--tom-texto, var(--azul-texto));
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
}
.at-avatar--1 { --tom: #dff4f6; --tom-texto: #0b5c66; }
.at-avatar--2 { --tom: #e9e6fd; --tom-texto: #3f2fa8; }
.at-avatar--3 { --tom: #1752d8; --tom-texto: #ffffff; }
.at-avatar--4 { --tom: #dde9ff; --tom-texto: #102f74; }
.at-selo {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--branco);
  background: #128c4a;
  color: var(--sobre-azul);
}
.at-selo--ig { background: linear-gradient(45deg, #d9480f, #c2255c 50%, #7b2cbf); }
.at-selo svg { width: 10px; height: 10px; }

/* ---------- conversa ---------- */
.at-chat {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #e9f0fc url('/painel/marca/chat-fundo.svg');
}

.at-nada { margin: auto; text-align: center; padding: 28px 24px; max-width: 24rem; background: var(--branco); border-radius: var(--r-painel); box-shadow: var(--sombra); }
.at-nada__titulo { font-family: var(--display); font-weight: 800; font-size: 1.3rem; margin: 0 0 6px; }
.at-nada__titulo::before {
  content: ''; display: block; width: 52px; height: 52px; margin: 0 auto 14px;
  background: url('/painel/marca/icone-128.png') center / contain no-repeat;
}
.at-nada__texto { color: var(--apagado); margin: 0; font-size: 14.5px; }
.at-nada__texto b { color: var(--tinta); }

.at-topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--linha);
  background: var(--branco);
}
.at-topo .at-avatar { width: 40px; height: 40px; font-size: 15px; }
.at-voltar {
  display: none;
  background: transparent;
  border: 0;
  color: var(--tinta);
  padding: 6px;
  margin-left: -6px;
  border-radius: 50%;
  cursor: pointer;
}
.at-quem { min-width: 0; flex: 1; }
.at-quem__nome { margin: 0; font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-quem__info { margin: 1px 0 0; font-size: 12.5px; color: var(--apagado); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-quem__info .ok { color: var(--azul); font-weight: 600; }
.at-quem__info .alerta { color: var(--ambar); font-weight: 600; }

.at-acoes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.at-acoes .botao, .at-tr-botao { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.at-tr-botao { display: inline-flex; align-items: center; gap: 6px; }
.at-tr-botao[aria-pressed='true'] { background: var(--azul-claro); border-color: var(--azul); }

.at-mensagens {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px clamp(12px, 5%, 56px) 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overscroll-behavior: contain;
}
.at-mensagens > :first-child { margin-top: auto; }

.at-dia, .at-novas {
  align-self: center;
  flex: 0 0 auto;
  margin: 12px 0 8px;
  padding: 3px 12px;
  border-radius: 9999px;
  background: var(--branco);
  box-shadow: var(--sombra);
  color: var(--apagado);
  font-size: 12px;
  font-weight: 600;
}
.at-novas { align-self: stretch; text-align: center; background: var(--azul-claro); color: var(--azul-texto); border: 1px solid var(--azul-borda); box-shadow: none; }

.at-msg {
  position: relative;
  flex: 0 0 auto;
  min-width: 6.5rem;
  max-width: min(76%, 34rem);
  padding: 7px 11px 6px;
  border-radius: 14px;
  box-shadow: var(--sombra);
  font-size: 14.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.at-msg--nova { animation: at-entra 0.25s var(--expo) both; }
.at-msg--cliente { align-self: flex-start; background: var(--branco); --balao: var(--branco); }
.at-msg--loja { align-self: flex-end; background: var(--azul); color: var(--sobre-azul); --balao: var(--azul); }
.at-msg--ia { background: #d5e3ff; color: var(--tinta); --balao: #d5e3ff; }
/* bico no primeiro balao de cada sequencia */
.at-msg:not(.at-msg--seguida)::before { content: ''; position: absolute; top: 0; width: 9px; height: 12px; background: var(--balao); }
.at-msg--cliente:not(.at-msg--seguida) { border-top-left-radius: 0; }
.at-msg--cliente:not(.at-msg--seguida)::before { left: -7px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.at-msg--loja:not(.at-msg--seguida) { border-top-right-radius: 0; }
.at-msg--loja:not(.at-msg--seguida)::before { right: -7px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.at-msg + .at-msg:not(.at-msg--seguida) { margin-top: 9px; }
.at-msg--destaque { box-shadow: 0 0 0 3px var(--ciano); }
.at-msg :focus-visible { outline-color: currentColor; }

.at-msg__autor { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; margin-bottom: 1px; color: #cfe0ff; }
.at-msg--ia .at-msg__autor { color: var(--azul-texto); }
.at-msg__texto { white-space: pre-wrap; }
.at-msg__texto a { color: var(--azul); }
.at-msg--loja:not(.at-msg--ia) .at-msg__texto a { color: var(--sobre-azul); }
.at-msg__rodape {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 6px -2px -2px 10px;
  font-size: 11px;
  color: var(--fraco);
  line-height: 1;
}
.at-msg--loja .at-msg__rodape { color: #d3e1ff; }
.at-msg--ia .at-msg__rodape { color: var(--apagado); }
.at-tique { width: 16px; height: 11px; }
.at-msg--loja .at-tique--lida { color: #6ff5ee; }
.at-msg--ia .at-tique--lida { color: var(--azul); }
.at-msg__erro { display: block; clear: both; margin-top: 4px; padding: 3px 8px; border-radius: 8px; font-size: 12px; color: var(--vermelho); background: var(--vermelho-claro); }
.at-msg__sem { color: var(--fraco); font-style: italic; font-size: 13px; }
.at-msg--loja:not(.at-msg--ia) .at-msg__sem { color: #d3e1ff; }

/* traducao dentro do balao */
.at-trad {
  clear: both;
  margin: 5px -3px 2px;
  padding: 6px 9px 7px;
  border-radius: 9px;
  background: var(--fundo);
  color: var(--tinta);
  font-size: 14px;
}
.at-msg--loja .at-trad { background: rgba(0, 20, 70, 0.28); color: var(--sobre-azul); }
.at-msg--ia .at-trad { background: rgba(255, 255, 255, 0.72); color: var(--tinta); }
.at-trad b { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--azul-texto); }
.at-msg--loja:not(.at-msg--ia) .at-trad b { color: #cfe0ff; }
.at-trad span { white-space: pre-wrap; }
.at-trad--indo { color: var(--apagado); font-size: 13px; }

/* ---------- fotos e arquivos ---------- */
.at-midia { position: relative; margin: -3px -7px 5px; }
.at-foto {
  display: block;
  width: 19rem;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #dbe5f7;
  cursor: zoom-in;
}
.at-foto img { display: block; width: 100%; max-height: 22rem; min-height: 7rem; object-fit: cover; }
.at-midia__baixar {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(9, 22, 52, 0.72);
  color: var(--sobre-azul);
  transition: background-color 0.15s var(--padrao);
}
.at-midia__baixar:hover { background: rgba(9, 22, 52, 0.92); }
.at-figurinha { display: block; width: 8rem; height: 8rem; object-fit: contain; }
.at-som { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.at-som audio { width: 15rem; max-width: 100%; height: 40px; }
.at-msg video { display: block; width: 19rem; max-width: 100%; max-height: 22rem; border-radius: 10px; background: #000; }
.at-link-baixar {
  display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
  padding: 5px 10px; border-radius: 9999px; font-size: 12.5px; font-weight: 600; text-decoration: none;
  color: var(--azul-texto); background: var(--azul-claro);
}
.at-msg video + .at-link-baixar { margin-top: 5px; }

.at-arquivo {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  width: 20rem;
  max-width: 100%;
  margin: 0 -3px 3px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--fundo);
  color: var(--tinta);
}
.at-msg--loja .at-arquivo { background: var(--branco); }
.at-arquivo__tipo {
  grid-row: span 2;
  position: relative;
  width: 42px;
  height: 48px;
  display: grid;
  place-items: end center;
  padding-bottom: 7px;
  color: var(--azul);
  font-size: 10px;
  font-weight: 700;
}
.at-arquivo__tipo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.at-arquivo__nome { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.at-arquivo__info { grid-column: 2; font-size: 12px; color: var(--fraco); }
.at-arquivo .at-link-baixar { grid-column: 3; grid-row: 1 / span 2; background: var(--azul); color: var(--sobre-azul); }
.at-arquivo .at-link-baixar:hover { background: var(--azul-forte); }
.at-arquivo__cuidado { grid-column: 1 / -1; margin-top: 6px; padding: 5px 8px; border-radius: 8px; background: var(--ambar-claro); color: var(--ambar); font-size: 12px; line-height: 1.35; }
.at-midia--sumiu {
  display: block; width: 19rem; max-width: 100%; padding: 12px; border-radius: 10px;
  background: var(--fundo); color: var(--apagado); font-size: 13px;
}

.at-msg__citacao {
  display: block;
  width: calc(100% + 6px);
  text-align: left;
  margin: 0 -3px 5px;
  padding: 5px 9px;
  border: 0;
  border-radius: 9px;
  background: var(--fundo);
  color: var(--apagado);
  font-size: 12.5px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.at-msg__citacao b { display: block; color: var(--azul-texto); font-size: 11.5px; }
.at-msg--loja:not(.at-msg--ia) .at-msg__citacao { background: rgba(0, 20, 70, 0.28); color: #e3ecff; }
.at-msg--loja:not(.at-msg--ia) .at-msg__citacao b { color: var(--sobre-azul); }
.at-msg--ia .at-msg__citacao { background: rgba(255, 255, 255, 0.72); }

.at-msg__reacao {
  position: absolute;
  bottom: -11px;
  right: 10px;
  padding: 0 6px;
  border-radius: 9999px;
  background: var(--branco);
  border: 1px solid var(--linha);
  box-shadow: var(--sombra);
  color: var(--tinta);
  font-size: 13px;
  line-height: 19px;
}
.at-msg--cliente .at-msg__reacao { right: auto; left: 10px; }
.at-msg:has(.at-msg__reacao) { margin-bottom: 13px; }

/* botoes ao lado do balao: responder e traduzir */
.at-msg__ferramentas { position: absolute; top: 2px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s var(--padrao); }
.at-msg--cliente .at-msg__ferramentas { left: 100%; padding-left: 6px; }
.at-msg--loja .at-msg__ferramentas { right: 100%; padding-right: 6px; flex-direction: row-reverse; }
.at-msg__ferramentas button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--linha-forte);
  background: var(--branco);
  color: var(--azul-texto);
  cursor: pointer;
}
.at-msg__ferramentas button:hover { background: var(--azul-claro); }
.at-msg__ferramentas button:focus-visible { outline-color: var(--azul); }
.at-msg:hover .at-msg__ferramentas, .at-msg:focus-within .at-msg__ferramentas { opacity: 1; }

.at-descer {
  position: absolute;
  right: 16px;
  bottom: 96px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--linha-forte);
  background: var(--branco);
  color: var(--azul);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--sombra-alta);
}

.at-faixa {
  margin: 0;
  padding: 7px 16px;
  font-size: 13px;
  color: var(--azul-texto);
  background: var(--azul-claro);
  text-align: center;
}
.at-faixa.alerta { color: var(--ambar); background: var(--ambar-claro); }

/* ---------- escrever ---------- */
.at-escrever { padding: 10px 12px 12px; background: var(--branco); border-top: 1px solid var(--linha); }
.at-linha { display: flex; align-items: flex-end; gap: 8px; }
.at-clipe, .at-enviar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s var(--padrao);
}
.at-clipe { color: var(--azul); background: var(--azul-claro); }
.at-clipe:hover, .at-clipe:focus-visible { background: #d9e4fd; }
.at-enviar { border: 0; background: var(--azul); color: var(--sobre-azul); }
.at-enviar:hover { background: var(--azul-forte); }
.at-enviar:disabled { opacity: 0.45; cursor: not-allowed; }
.at-escrever textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  max-height: 9rem;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 22px;
  border: 1px solid var(--linha-forte);
  background: var(--lateral);
  color: var(--tinta);
  font-size: 14.5px;
  line-height: 1.4;
}
.at-escrever textarea:disabled { opacity: 0.55; }

.at-citando, .at-anexo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 7px 8px 7px 12px;
  border-radius: 10px;
  background: var(--azul-claro);
  font-size: 13px;
}
.at-citando__corpo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--apagado); }
.at-citando__corpo b { color: var(--azul-texto); margin-right: 6px; }
.at-anexo img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.at-anexo span { flex: 1; color: var(--apagado); }
.at-x { background: transparent; border: 0; color: var(--apagado); padding: 6px; border-radius: 50%; cursor: pointer; display: grid; }
.at-x:hover { color: var(--tinta); background: rgba(15, 41, 99, 0.08); }
.at-traduzido { margin: 0 4px 6px; font-size: 12.5px; color: var(--azul-texto); }

/* ---------- tradutor ---------- */
.tr {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--lateral);
  border-left: 1px solid var(--linha);
}
.tr-topo { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px 10px 16px; background: var(--azul); color: var(--sobre-azul); }
.tr-topo > div { flex: 1; min-width: 0; }
.tr-topo h2 { margin: 0; font-family: var(--display); font-size: 15px; font-weight: 800; }
.tr-topo p { margin: 1px 0 0; font-size: 12.5px; color: #dbe6ff; }
.tr-topo .at-x { color: var(--sobre-azul); }
.tr-topo .at-x:hover { background: rgba(255, 255, 255, 0.18); }
.tr-topo :focus-visible { outline-color: var(--sobre-azul); }

.tr-ajustes { display: grid; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--linha); }
.tr-idioma { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--apagado); }
.tr-idioma select { width: 100%; font-size: 14px; padding: 7px 10px; }
.tr-auto { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.tr-auto input { width: 16px; height: 16px; }
.tr-desligado { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--ambar-claro); color: var(--ambar); font-size: 13px; }

.tr-corpo { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 18px; }
.tr-parte h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.tr-vazio { margin: 0; font-size: 13.5px; color: var(--fraco); }
.tr-original, .tr-pt, .tr-volta { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tr-original {
  padding: 8px 11px; border-radius: 12px 12px 12px 3px; background: var(--branco); border: 1px solid var(--linha);
  font-size: 13.5px; color: var(--apagado); max-height: 7.5rem; overflow-y: auto;
}
.tr-pt { margin-top: 6px; padding: 9px 11px; border-radius: 12px 12px 12px 3px; background: var(--azul-claro); font-size: 14px; }
.tr-pt b, .tr-volta b { display: block; font-size: 11.5px; font-weight: 700; color: var(--azul-texto); }
.tr-acoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tr-acoes .botao { min-height: 32px; padding: 4px 11px; font-size: 12.5px; }
.tr-chip {
  min-height: 28px; padding: 2px 11px; border-radius: 9999px; border: 1px solid var(--linha-forte);
  background: var(--branco); color: var(--apagado); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.tr-chip:hover { color: var(--azul-texto); border-color: var(--azul); }
.tr-chip:disabled { opacity: 0.5; cursor: wait; }
.tr-resultado {
  display: block; width: 100%; resize: vertical; min-height: 5.5rem; padding: 10px 12px;
  border: 2px solid var(--azul); border-radius: 12px 12px 3px 12px; background: var(--branco); color: var(--tinta);
  font-size: 14px; line-height: 1.45;
}
.tr-volta { margin-top: 8px; font-size: 13px; color: var(--apagado); }
.tr-aviso { margin: 8px 0 0; padding: 7px 10px; border-radius: 9px; background: var(--vermelho-claro); color: var(--vermelho); font-size: 12.5px; overflow-wrap: anywhere; }
.tr-erro { margin: 8px 0 0; padding: 8px 10px; border-radius: 9px; background: var(--vermelho-claro); color: var(--vermelho); font-size: 13px; }

.tr-carregando { display: grid; gap: 7px; margin-top: 8px; }
.tr-carregando i { height: 12px; border-radius: 6px; background: var(--azul-claro); animation: tr-pulsa 1s ease-in-out infinite alternate; }
.tr-carregando i:last-child { width: 62%; }
@keyframes tr-pulsa { from { opacity: 0.45; } to { opacity: 1; } }

.tr-prompt { margin: 0; padding: 12px; background: var(--branco); border-top: 1px solid var(--linha); display: grid; gap: 7px; }
.tr-prompt label { font-size: 13px; font-weight: 700; }
.tr-prompt textarea {
  width: 100%; resize: none; padding: 10px 12px; border: 1px solid var(--linha-forte); border-radius: 12px;
  background: var(--lateral); color: var(--tinta); font-size: 14px; line-height: 1.4;
}
.tr-prompt__linha { display: flex; gap: 8px; }
.tr-prompt__linha input { flex: 1; min-width: 0; font-size: 13px; padding: 7px 10px; }
.tr-prompt__linha .botao { flex: 0 0 auto; }

/* ---------- foto grande ---------- */
.foto {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(7, 18, 45, 0.96);
  color: var(--sobre-azul);
}
.foto[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; animation: at-entra 0.2s var(--expo) both; }
.foto::backdrop { background: rgba(7, 18, 45, 0.9); }
.foto :focus-visible { outline-color: var(--sobre-azul); }
.foto__topo { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.foto__quem { flex: 1; min-width: 0; margin: 0; display: grid; }
.foto__quem b, .foto__quem span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foto__quem span { font-size: 12.5px; color: #b9c9ee; }
.foto__botao {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; min-width: 40px; justify-content: center; padding: 0 13px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.28); background: transparent; color: var(--sobre-azul);
  font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.foto__botao:hover { background: rgba(255, 255, 255, 0.14); }
.foto__botao--forte { background: var(--branco); border-color: var(--branco); color: var(--azul-forte); }
.foto__botao--forte:hover { background: var(--azul-claro); }
.foto__botao:disabled { opacity: 0.35; cursor: default; }
.foto__palco { display: flex; overflow: auto; padding: 4px 16px; min-height: 0; }
.foto__palco img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: zoom-in; }
.foto__palco.real img { max-width: none; max-height: none; cursor: zoom-out; }
.foto__legenda { margin: 0; padding: 8px 20px 0; text-align: center; font-size: 14px; white-space: pre-wrap; max-height: 6rem; overflow-y: auto; }
.foto__nav { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px; font-size: 13px; color: #b9c9ee; }

@keyframes at-entra {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* sem mouse (celular, tablet): os botoes do balao ficam sempre a mao, embaixo dele */
@media (hover: none) {
  .at-msg__ferramentas { position: static; clear: both; opacity: 1; justify-content: flex-end; padding: 6px 0 0 !important; flex-direction: row !important; }
}

/* tela media: o tradutor vira gaveta por cima da conversa */
@media (max-width: 1240px) {
  .at.com-tradutor { grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr); }
  .tr { position: absolute; z-index: 10; top: 0; right: 0; bottom: 0; width: min(23rem, 100%); box-shadow: var(--sombra-alta); }
}

/* ---------- celular: lista OU conversa ---------- */
@media (max-width: 820px) {
  .at, .at.com-tradutor { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 122px); }
  body.no-atendimento .app { padding: 0 8px 8px; }
  body.no-atendimento .topo { margin-bottom: 8px; padding-left: 14px; padding-right: 14px; }
  .at.com-conversa .at-lado { display: none; }
  .at:not(.com-conversa) .at-chat { display: none; }
  .at-voltar { display: grid; }
  .at-topo { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .at-quem { flex: 1 1 8rem; }
  .at-acoes { flex: 1 1 100%; }
  .at-tr-botao span { display: none; }
  .at-mensagens { padding: 10px 14px; }
  .at-msg { max-width: 88%; }
  .tr { width: 100%; border-left: 0; }
  .foto__topo { flex-wrap: wrap; }
  .foto__quem { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .at-msg--nova, .foto[open], .tr-carregando i { animation: none; }
}

/* ---------- opcoes de cada conversa (fixar, apagar, bloquear) ---------- */
.at-item { position: relative; }
.at-item__alfinete { display: inline-block; margin-right: 4px; vertical-align: -1px; color: var(--azul-texto); }
.at-item__menu {
  position: absolute; top: 6px; right: 6px; z-index: 2; display: flex; gap: 2px; padding: 3px;
  background: var(--branco); border: 1px solid var(--linha-forte); border-radius: 10px; box-shadow: var(--sombra-alta);
  opacity: 0; pointer-events: none; transform: translateY(-2px);
  transition: opacity 0.12s var(--padrao), transform 0.12s var(--padrao);
}
.at-item:hover .at-item__menu, .at-item:focus-visible .at-item__menu, .at-item:has(:focus-visible) .at-item__menu, .at-item--menu .at-item__menu { opacity: 1; pointer-events: auto; transform: none; }
.at-item__menu button, .at-item__mais { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--apagado); cursor: pointer; }
.at-item__menu button:hover { background: var(--azul-claro); color: var(--azul-texto); }
.at-item__menu button[data-item='apagar']:hover, .at-item__menu button[data-item='bloquear']:hover { background: var(--vermelho-claro); color: var(--vermelho); }
.at-item__menu button[aria-pressed='true'] { color: var(--azul-texto); background: var(--azul-claro); }
.at-item__mais { display: none; position: absolute; right: 4px; bottom: 4px; }
.at-etiqueta--bloqueado { background: var(--vermelho-claro); color: var(--vermelho); }
.at-bloqueados { border: 0; border-top: 1px solid var(--linha); background: transparent; color: var(--apagado); font: inherit; font-size: 12.5px; font-weight: 600; padding: 10px; cursor: pointer; }
.at-bloqueados:hover { color: var(--tinta); background: var(--fundo); }
/* sem mouse nao existe passar por cima: um botao de tres pontos abre as opcoes */
@media (hover: none) {
  .at-item__mais { display: grid; }
  .at-item:hover .at-item__menu, .at-item:focus-visible .at-item__menu, .at-item:has(:focus-visible) .at-item__menu { opacity: 0; pointer-events: none; }
  .at-item--menu .at-item__menu, .at-item--menu:hover .at-item__menu, .at-item--menu:focus-visible .at-item__menu, .at-item--menu:has(:focus-visible) .at-item__menu { opacity: 1; pointer-events: auto; }
  .at-item__menu button { width: 40px; height: 40px; }
}

/* ---------- soltar arquivo na conversa ---------- */
.at-soltar {
  position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px;
  background: rgba(15, 41, 99, 0.45); backdrop-filter: blur(3px);
  animation: at-soltar-entra 0.16s var(--padrao, ease-out);
  pointer-events: none;
}
.at-soltar[hidden] { display: none; }
.at-soltar__caixa {
  width: min(100%, 420px); padding: 34px 24px; text-align: center; color: var(--azul-texto);
  background: var(--branco); border-radius: 18px;
  border: 2px dashed var(--azul);
  box-shadow: 0 18px 50px rgba(15, 41, 99, 0.35);
  animation: at-soltar-caixa 1.1s ease-in-out infinite;
}
.at-soltar__seta { color: var(--azul); animation: at-soltar-seta 0.9s ease-in-out infinite; }
.at-soltar__titulo { margin: 10px 0 2px; font-size: 18px; font-weight: 700; }
.at-soltar__texto { margin: 0; font-size: 13px; color: var(--apagado); }
@keyframes at-soltar-entra { from { opacity: 0; } to { opacity: 1; } }
@keyframes at-soltar-caixa { 0%, 100% { transform: scale(1); border-color: var(--azul); } 50% { transform: scale(1.025); border-color: var(--azul-borda); } }
@keyframes at-soltar-seta { 0%, 100% { transform: translateY(4px); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .at-soltar, .at-soltar__caixa, .at-soltar__seta { animation: none; }
}
