/* Atalho discreto no rodape (abaixo do telefone) */
.chat-rodape-btn { background: none; border: 0; color: #fff; font: inherit; font-size: 11.5px; opacity: .9; cursor: pointer; padding: 0; margin: 2px 0 0; }
.chat-rodape-btn:hover { opacity: 1; text-decoration: underline; }
.chat-rodape-btn i { margin-right: 8px; width: 16px; }
.chat-rodape-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Chat Online (2026-10-10) - painel discreto, abre perto do cabecalho */
.chat-online-btn {
    cursor: pointer; border: 0; background: none; padding: 0; margin-left: 8px; flex-shrink: 0;
    display: inline-flex; flex-direction: column; align-items: center; gap: 1px; color: #fff;
}
.chat-online-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 8px; }
.chat-btn-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%; font-size: 14px; color: #fff;
    transition: transform .2s, background .3s;
}
.chat-online-btn:hover .chat-btn-ico { transform: scale(1.08); }
.chat-btn-rotulo { font-size: 10.5px; font-weight: 600; line-height: 1; letter-spacing: .3px; text-transform: lowercase; opacity: .95; }
/* Online: verde pulsante */
.chat-st-on .chat-btn-ico { background: #16a34a; animation: chatPulso 2s ease-out infinite; }
.chat-st-on .chat-btn-rotulo { color: #bbf7d0; }
/* Offline: vermelho, parado */
.chat-st-off .chat-btn-ico { background: #dc2626; animation: none; }
.chat-st-off .chat-btn-rotulo { color: #fecaca; }
@keyframes chatPulso {
    0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, .75); }
    70%  { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
@media (prefers-reduced-motion: reduce) { .chat-st-on .chat-btn-ico { animation: none; } }

/* Fila de atendimento */
.chat-fila {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
    background: linear-gradient(135deg, #ecfdf5, #eff6ff); border: 1px solid #bbf7d0; color: #14532d;
}
.chat-fila[hidden], .chat-fila-aviso[hidden] { display: none; }
.chat-fila-num {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: #16a34a; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px;
    animation: chatPulso 2s ease-out infinite;
}
.chat-fila-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chat-fila-txt strong { font-size: 13.5px; }
.chat-fila-txt small { font-size: 12px; color: #3f6212; color: #166534; }
.chat-fila-aviso { margin: 0; padding: 7px 10px; border-radius: 8px; background: #eff6ff; color: #1e3a8a; font-size: 12px; border: 1px solid #bfdbfe; }
@media (prefers-reduced-motion: reduce) { .chat-fila-num { animation: none; } }

.chat-painel {
    position: fixed; top: 64px; right: 16px; z-index: 1200;
    width: 360px; max-width: calc(100vw - 24px);
    max-height: calc(100vh - 80px); display: flex; flex-direction: column;
    background: #fff; color: #1f2937; border: 1px solid #d1d5db; border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .22); font-size: 14px; overflow: hidden;
}
.chat-painel[hidden] { display: none; }
.chat-topo { display: flex; align-items: center; gap: 8px; background: #2d5a8e; color: #fff; padding: 10px 12px; }
.chat-topo strong { flex: 1; font-size: 14px; }
.chat-situacao { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: rgba(255,255,255,.18); }
.chat-situacao.on::before { content: "\25CF  "; color: #86efac; }
.chat-situacao.off::before { content: "\25CF  "; color: #fca5a5; }
.chat-fechar { background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.chat-fechar:focus-visible, .chat-link:focus-visible, .chat-btn:focus-visible { outline: 2px solid #2d5a8e; outline-offset: 2px; }
.chat-topo .chat-fechar:focus-visible { outline-color: #fff; }
.chat-offline { margin: 0; padding: 8px 12px; background: #fef3c7; color: #92400e; font-size: 12.5px; }
.chat-tela { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.chat-tela[hidden] { display: none; }
.chat-tela label { font-size: 12px; font-weight: 600; margin-top: 4px; display: block; }
.chat-tela input[type=text], .chat-tela select, .chat-tela textarea {
    width: 100%; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 6px;
    padding: 7px 9px; font: inherit; background: #fff;
}
.chat-tela select { height: 38px; }
.chat-isca { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.chat-horario { font-size: 10px; color: #6b7280; margin: 8px 0 0; text-align: center; white-space: nowrap; letter-spacing: -.1px; }
.chat-aviso-priv { font-size: 11.5px; color: #6b7280; margin: 6px 0; }
.chat-btn { background: #2d5a8e; color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.chat-btn:disabled { opacity: .6; cursor: wait; }
.chat-btn-sec { background: #fff; color: #2d5a8e; border: 1px solid #2d5a8e; margin-top: 6px; }
.chat-link { background: none; border: 0; color: #2d5a8e; text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }
.chat-retomar { border-top: 1px solid #e5e7eb; padding-top: 8px; font-size: 13px; }
.chat-retomar summary { cursor: pointer; color: #2d5a8e; }
.chat-codigo { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.chat-codigo code { font-size: 15px; font-weight: 700; letter-spacing: 1px; user-select: all; }
.chat-msgs { flex: 1; min-height: 140px; max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.chat-msg { max-width: 85%; padding: 6px 10px; border-radius: 10px; }
.chat-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg small { display: block; font-size: 10.5px; opacity: .7; margin-top: 2px; }
.chat-msg.vis { align-self: flex-end; background: #dbeafe; }
.chat-msg.adm { align-self: flex-start; background: #f3f4f6; border: 1px solid #e5e7eb; }
.chat-enviar { display: flex; gap: 6px; align-items: flex-end; }
.chat-enviar[hidden] { display: none; }
.chat-enviar textarea { flex: 1; resize: none; }
.chat-erro { margin: 0; color: #b91c1c; font-size: 12.5px; padding: 0 12px 8px; }
.chat-erro[hidden], .chat-offline[hidden], .chat-codigo[hidden], .chat-encerrado[hidden] { display: none; }
.chat-encerrado { font-size: 13px; color: #6b7280; margin: 0; }
.chat-sair { font-size: 12px; align-self: flex-start; }
.chat-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (max-width: 768px) {
    .chat-painel { top: 56px; right: 8px; left: 8px; width: auto; max-height: calc(100vh - 64px); }
}
@media (prefers-reduced-motion: no-preference) {
    .chat-painel { animation: chatEntra .15s ease-out; }
    @keyframes chatEntra { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

.chat-rodape-estado { font-size: 13.5px; font-weight: 600; margin-left: 2px; }
.chat-rodape-estado.on { color: #86efac; animation: chatRodapePulso 1.8s ease-in-out infinite; }
.chat-rodape-estado.off { color: #fecaca; animation: none; }
@keyframes chatRodapePulso { 0%, 100% { opacity: 1; text-shadow: 0 0 6px rgba(134,239,172,.9); } 50% { opacity: .45; text-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .chat-rodape-estado.on { animation: none; } }

/* Emojis e anexos (2026-10-11) */
.chat-ferramentas { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.chat-ferramentas .chat-btn { margin-left: auto; }
.chat-ico-btn { background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 8px; width: 34px; height: 34px; font-size: 16px; cursor: pointer; line-height: 1; color: #374151; }
.chat-ico-btn:hover { background: #e5e7eb; }
.chat-emojis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; margin-top: 6px; padding: 6px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; max-height: 120px; overflow-y: auto; }
.chat-emojis[hidden], .chat-arquivo-sel[hidden] { display: none; }
.chat-emojis button { background: none; border: 0; font-size: 18px; cursor: pointer; padding: 3px; border-radius: 6px; }
.chat-emojis button:hover { background: #eff6ff; }
.chat-arquivo-sel { margin: 6px 0 0; font-size: 12px; color: #374151; overflow-wrap: anywhere; }
.chat-anexo { margin-top: 6px; }
.chat-anexo a { color: inherit; text-decoration: underline; overflow-wrap: anywhere; display: block; }
.chat-anexo img { display: block; max-width: 100%; max-height: 160px; border-radius: 6px; margin-bottom: 4px; }
