/* Bzap: chat do visitante (/c). Celular primeiro; no computador vira uma coluna centrada. */

.c-app {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 760px; height: 100%; height: var(--alt, 100%);
  margin: 0 auto; background: var(--papel); overflow: hidden;
}
.c-sem-js { padding: 24px; text-align: center; }

/* ---------- topo ---------- */
.c-topo {
  flex: none; display: flex; align-items: center; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--superficie); border-bottom: 1px solid var(--linha);
}
.c-topo .bz-marca-av { margin-right: 12px; }
.c-topo-txt { min-width: 0; }
.c-topo h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.0625rem; font-weight: 700; }
.c-topo p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--suave); font-size: 0.8125rem; }
.c-conexao { flex: none; margin: 0; padding: 7px 16px; background: var(--nota-fundo); color: var(--nota-texto); font-size: 0.8125rem; font-weight: 600; text-align: center; animation: bz-entra 0.2s var(--curva) both; }

/* ---------- corpo ---------- */
.c-corpo { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.c-msgs { flex: 1 1 auto; min-height: 0; padding: 14px 14px 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.c-vazio { flex: none; padding: 36px 28px 8px; text-align: center; animation: bz-entra 0.25s var(--curva) both; }
.c-vazio .bz-marca-av { margin: 0 auto 14px; }
.c-vazio h2 { margin: 0 0 8px; font-size: 1.375rem; font-weight: 700; }
.c-vazio p { max-width: 30ch; margin: 0 auto; color: var(--suave); font-size: 0.9375rem; }
.c-novas {
  position: absolute; left: 0; right: 0; bottom: 10px; z-index: 5; width: max-content; max-width: calc(100% - 32px); min-height: 44px; margin: 0 auto; padding: 0 16px;
  border: 3px solid var(--papel); border-radius: 999px; background: var(--marca); color: var(--marca-txt); font-size: 0.875rem; font-weight: 700;
  animation: bz-entra 0.2s var(--curva) both;
}

/* tela cheia de aviso: carregando, indisponível, sem conexão, link vencido */
.c-tela { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; animation: bz-entra 0.25s var(--curva) both; }
.c-tela .bz-marca-av { margin: 0 0 16px; }
.c-tela h2 { margin: 0 0 8px; font-size: 1.375rem; font-weight: 700; }
.c-tela p { max-width: 32ch; margin: 0 0 20px; color: var(--suave); font-size: 0.9375rem; }
.c-tela .bz-btn { min-width: 200px; }
.c-tela .bz-btn + .bz-btn { margin-top: 10px; }
.c-esq { width: 100%; max-width: 320px; }
.c-esq .bz-esq { height: 44px; margin: 0 0 10px; width: 70%; }
.c-esq .bz-esq:nth-child(2) { width: 52%; margin-left: auto; }
.c-esq .bz-esq:nth-child(3) { width: 80%; height: 64px; }
.c-app.so-tela .c-pe, .c-app.so-tela .c-msgs, .c-app.so-tela .c-vazio, .c-app.so-tela .c-novas { display: none; }

/* ---------- pé: ações + escrever ---------- */
.c-pe { flex: none; background: var(--superficie); border-top: 1px solid var(--linha); padding-bottom: env(safe-area-inset-bottom, 0px); }
.c-falhas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 14px; background: var(--erro-fundo); color: var(--erro); font-size: 0.875rem; font-weight: 600; animation: bz-entra 0.2s var(--curva) both; }
.c-falhas[hidden] { display: none; }
.c-falhas-txt { flex: 1 1 auto; }
.c-acoes { max-height: 55vh; max-height: calc(var(--alt, 100vh) * 0.55); padding: 10px 14px 4px; overflow-y: auto; animation: bz-entra 0.2s var(--curva) both; }
.c-chamar { margin: 0 0 6px; }
.c-nome-form .bz-campo { margin-bottom: 10px; }
.c-nome-form .bz-campo input { min-height: 46px; }
.c-nome-form-botoes { display: flex; margin: 4px 0 8px; }
.c-nome-form-botoes .bz-btn { flex: 1 1 auto; min-height: 46px; }
.c-nome-form-botoes .bz-btn + .bz-btn { flex: none; margin-left: 8px; }

.c-nota { padding: 2px 0 6px; text-align: center; }
.c-nota p { margin: 0 0 4px; font-size: 0.9375rem; font-weight: 600; }
.c-estrelas { display: flex; justify-content: center; }
.c-estrelas button { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #9a8873; transition: transform 0.12s var(--curva), color 0.15s ease-out; }
.c-estrelas button .bz-ic { width: 32px; height: 32px; }
.c-estrelas button.ligada { color: var(--marca-tinta); }
.c-estrelas button:active { transform: scale(0.9); }
.c-nota-rotulo { height: 20px; margin: 0; color: var(--suave); font-size: 0.8125rem; }
.c-obrigado { margin: 0; padding: 8px 0 10px; color: var(--suave); font-size: 0.9375rem; text-align: center; }

.c-form { margin: 0; padding: 8px 10px 10px; }
.c-form .bz-erro-texto { margin: 0 4px 8px; }
.c-linha { display: flex; align-items: flex-end; }
.c-linha textarea {
  flex: 1 1 auto; display: block; min-width: 0; min-height: 48px; max-height: 132px; margin: 0 6px 0 0; padding: 12px 16px; border: 1px solid var(--linha-forte); border-radius: 24px;
  background: var(--papel); font-size: 1rem; line-height: 1.3; resize: none; transition: border-color 0.15s ease-out, background-color 0.15s ease-out;
}
.c-linha textarea:focus { border-color: var(--marca-tinta); background: var(--superficie); outline-offset: 0; }
.c-linha textarea::placeholder { color: var(--suave); opacity: 0.85; }
.c-anexar, .c-linha .bz-btn-icone { width: 46px; height: 48px; }
.c-anexar { position: relative; cursor: pointer; }
.c-anexar:focus-within { outline: 3px solid var(--marca-tinta); outline-offset: 0; }
.c-enviar {
  flex: none; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: var(--marca); color: var(--marca-txt); transition: transform 0.12s var(--curva), opacity 0.15s ease-out;
}
.c-enviar:active { transform: scale(0.93); }
.c-enviar[aria-disabled="true"] { opacity: 0.4; }

.c-anexo { display: flex; align-items: center; margin: 0 0 8px; padding: 6px 6px 6px 8px; border-radius: 14px; background: var(--afundo); animation: bz-entra 0.2s var(--curva) both; }
.c-anexo-mini { display: flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; margin-right: 10px; border-radius: 10px; background: var(--superficie); overflow: hidden; color: var(--marca-tinta); }
.c-anexo-mini img { display: block; width: 100%; height: 100%; object-fit: cover; }
.c-anexo-txt { flex: 1 1 auto; min-width: 0; }
.c-anexo-txt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; }
.c-anexo-txt small { display: block; color: var(--suave); font-size: 0.8125rem; }

.c-gravando { display: flex; align-items: center; min-height: 48px; padding: 0 2px; animation: bz-entra 0.2s var(--curva) both; }
.c-gravando .c-rec { flex: none; width: 12px; height: 12px; margin: 0 10px 0 14px; border-radius: 50%; background: var(--erro); }
.c-gravando .c-tempo { flex: 1 1 auto; font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.c-gravando .bz-btn-icone { flex: none; }
.c-gravando .c-enviar { margin-left: 4px; }
.c-app.gravando #c-linha { display: none; }

/* ---------- "Ver meu acesso" (folha de baixo; no computador, janela no meio) ---------- */
.c-camada { position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(38, 29, 21, 0.5); opacity: 0; transition: opacity 0.15s ease-out; }
.c-camada.aberta { opacity: 1; transition: opacity 0.25s var(--curva); }
.c-folha {
  width: 100%; max-width: 460px; max-height: 100%; overflow-y: auto; padding: 22px 20px 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 24px 24px 0 0; background: var(--superficie); transform: translateY(16px); transition: transform 0.15s ease-out;
}
.c-camada.aberta .c-folha { transform: none; transition: transform 0.25s var(--curva); }
.c-folha h2 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 700; }
.c-folha-aviso { margin: 0 0 16px; color: var(--suave); font-size: 0.9375rem; }
.c-folha-aviso.erro { padding: 10px 14px; border-radius: 12px; background: var(--erro-fundo); color: var(--erro); font-weight: 600; }
.c-acesso-linha { display: flex; align-items: flex-end; margin: 0 0 4px; }
.c-acesso-linha .bz-campo { flex: 1 1 auto; min-width: 0; margin: 0 8px 14px 0; }
.c-acesso-linha .bz-campo input { font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.c-acesso-linha .c-copiar { flex: none; min-height: 48px; margin: 0 0 14px; padding: 0 14px; }
@media (max-width: 420px) {
  /* celular estreito: só o ícone no Copiar (o nome está no rótulo falado), para o endereço do servidor caber no campo */
  .c-acesso-linha .c-copiar { width: 48px; padding: 0; justify-content: center; }
  .c-acesso-linha .c-copiar .bz-ic { margin-right: 0; }
  .c-copiar-txt { display: none; }
}
.c-acesso-esq { margin: 0 0 12px; }
.c-acesso-esq .bz-esq { height: 48px; margin: 0 0 10px; }
.c-acesso-esq .bz-esq:nth-child(2) { width: 85%; }
.c-acesso-esq .bz-esq:nth-child(3) { width: 70%; }
.c-folha-botoes { display: flex; flex-wrap: wrap; margin: -5px; }
.c-folha-botoes .bz-btn { flex: 1 1 0; min-width: -webkit-max-content; min-width: max-content; margin: 5px; white-space: nowrap; }

/* ---------- computador ---------- */
@media (min-width: 800px) {
  body { background: var(--afundo); }
  .c-camada { align-items: center; }
  .c-folha { border-radius: 24px; padding-bottom: 22px; }
  .c-app { border-left: 1px solid var(--linha); border-right: 1px solid var(--linha); }
  .c-msgs { padding: 20px 24px 10px; }
  .c-form { padding: 10px 16px 14px; }
  .c-acoes { padding: 12px 20px 4px; }
}
@media (max-height: 520px) {
  .c-vazio { padding-top: 14px; }
  .c-vazio .bz-marca-av { display: none; }
  .c-acoes { max-height: 72vh; max-height: calc(var(--alt, 100vh) * 0.72); }
}
