/* Adlas Chat - widget */
.adlas-chat, .adlas-chat * { box-sizing: border-box; }
.adlas-chat {
  --ac-color: #1f6feb;
  position: fixed;
  bottom: 20px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #1c2330;
}
.adlas-chat.ac-right { right: 20px; }
.adlas-chat.ac-left { left: 20px; }

.ac-launcher {
  height: 58px; min-width: 58px; padding: 0 20px 0 14px; border-radius: 29px;
  background: var(--ac-color); color: #fff; border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  font: inherit; font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
  position: relative;
  transition: transform .15s ease;
}
.ac-launcher.ac-icon-only { padding: 0; width: 58px; justify-content: center; }
.ac-launcher:hover { transform: scale(1.05); }
.ac-launcher-icon { display: flex; }
.ac-launcher svg { width: 28px; height: 28px; fill: currentColor; }
.ac-launcher-text { white-space: nowrap; }
.ac-launcher.ac-pulse { animation: ac-pulse 2s ease-out infinite; }
.ac-launcher.ac-pulse .ac-launcher-icon { animation: ac-wiggle 4s ease-in-out infinite; transform-origin: 50% 60%; }
@keyframes ac-pulse {
  0%   { box-shadow: 0 6px 20px rgba(0,0,0,.22), 0 0 0 0 var(--ac-pulse); }
  70%  { box-shadow: 0 6px 20px rgba(0,0,0,.22), 0 0 0 18px rgba(0,0,0,0); }
  100% { box-shadow: 0 6px 20px rgba(0,0,0,.22), 0 0 0 0 rgba(0,0,0,0); }
}
@keyframes ac-wiggle {
  0%, 82%, 100% { transform: rotate(0); }
  86% { transform: rotate(-14deg); }
  90% { transform: rotate(12deg); }
  94% { transform: rotate(-8deg); }
  98% { transform: rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ac-launcher.ac-pulse, .ac-launcher.ac-pulse .ac-launcher-icon { animation: none; }
}
.ac-badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: #e5484d; color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.ac-badge[hidden] { display: none; }

.ac-panel {
  position: absolute; bottom: 72px; width: 360px; max-width: calc(100vw - 24px);
  height: 540px; max-height: calc(100vh - 110px);
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  display: none; flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.45; color: #1c2330;
}
.ac-panel, .ac-panel * { box-sizing: border-box; }
.adlas-chat.ac-hide-launcher .ac-launcher { display: none; }

/* Chat embutido na página (shortcode layout="embutido") */
.ac-panel.ac-embedded {
  position: static; display: flex; width: 100%; max-width: 100%;
  height: var(--acp-height, 560px); max-height: none; bottom: auto;
  border: 1px solid #e3e8ef; box-shadow: 0 8px 30px rgba(0,0,0,.10);
}
.ac-panel.ac-embedded .ac-minimize { display: none; }
.acp-embutido { max-width: 760px; margin: 24px auto; }

/* Layout de página (shortcode) */
.adlas-chat-page {
  --ac-color: #1f6feb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1c2330; box-sizing: border-box;
}
.adlas-chat-page *, .adlas-chat-page *::before, .adlas-chat-page *::after { box-sizing: border-box; }
.acp-cartao { display: flex; justify-content: center; padding: 24px 12px; }
.acp-card {
  width: 100%; max-width: 560px; background: #fff; border: 1px solid #e3e8ef; border-radius: 20px;
  padding: 36px 32px 28px; text-align: center; position: relative; overflow: hidden;
  box-shadow: 0 12px 40px rgba(20, 30, 60, .10);
}
.acp-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--ac-color);
}
.acp-badge {
  width: 64px; height: 64px; border-radius: 50%; margin: 4px auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ac-color); color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.acp-badge svg { width: 30px; height: 30px; }
.acp-status {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #6b7686;
  background: #f5f7fa; border-radius: 14px; padding: 4px 12px; margin-bottom: 12px;
}
.acp-dot { width: 9px; height: 9px; border-radius: 50%; background: #b8c0cc; flex: none; }
.acp-status.on { color: #1a7f37; background: #eaf7ee; }
.acp-status.on .acp-dot { background: #2ea44f; animation: acp-blink 1.8s ease-in-out infinite; }
@keyframes acp-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.acp-title { margin: 0 0 8px; font-size: 26px; line-height: 1.2; font-weight: 700; color: #1c2330; }
.acp-text { margin: 0 auto 20px; max-width: 420px; font-size: 16px; line-height: 1.5; color: #4a5568; }
.acp-topics { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 22px; }
.acp-chip {
  background: #fff; color: var(--ac-color); border: 1.5px solid var(--ac-color); border-radius: 20px;
  padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; transition: background .12s, color .12s;
}
.acp-chip:hover { background: var(--ac-color); color: #fff; }
.acp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--ac-color); color: #fff; border: 0; border-radius: 30px; padding: 15px 30px;
  font: inherit; font-size: 17px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.20); transition: transform .12s ease, box-shadow .12s ease;
}
.acp-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0,0,0,.24); }
.acp-btn:focus-visible, .acp-chip:focus-visible { outline: 3px solid rgba(31,111,235,.45); outline-offset: 2px; }
.acp-botao { display: flex; justify-content: center; padding: 8px 0; }
.acp-note { margin: 14px 0 0; font-size: 12px; color: #8a94a3; }
@media (max-width: 480px) {
  .acp-card { padding: 30px 20px 22px; }
  .acp-title { font-size: 22px; }
  .acp-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .acp-status.on .acp-dot, .acp-btn { animation: none; transition: none; }
}
.ac-right .ac-panel { right: 0; }
.ac-left .ac-panel { left: 0; }
.adlas-chat.ac-open .ac-panel { display: flex; }

.ac-head {
  background: var(--ac-color); color: #fff; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.ac-head-text { flex: 1; min-width: 0; }
.ac-title { font-weight: 600; font-size: 16px; }
.ac-sub { font-size: 12px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-icon-btn {
  background: transparent; border: 0; color: #fff; cursor: pointer; opacity: .85;
  width: 30px; height: 30px; border-radius: 6px; font-size: 18px; line-height: 1; padding: 0;
}
.ac-icon-btn:hover { opacity: 1; background: rgba(255,255,255,.15); }

.ac-end-btn {
  background: rgba(255,255,255,.18); color: #fff; border: 1.5px solid rgba(255,255,255,.85);
  border-radius: 16px; padding: 5px 11px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700;
  white-space: nowrap; flex: none; line-height: 1.2;
}
.ac-end-btn:hover { background: #fff; color: #c62828; border-color: #fff; }

.ac-lightbox {
  position: fixed; inset: 0; z-index: 100000; background: rgba(10,14,22,.88);
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.ac-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: default; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.ac-lightbox-close {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff; border: 0; font-size: 22px; cursor: pointer; line-height: 1;
}
.ac-lightbox-close:hover { background: rgba(255,255,255,.3); }
.ac-lightbox-open {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: #fff; background: rgba(255,255,255,.16); padding: 8px 16px; border-radius: 18px; text-decoration: none; font-size: 13px;
}
.ac-lightbox-open:hover { background: rgba(255,255,255,.3); }

.ac-messages {
  flex: 1; overflow-y: auto; padding: 14px; background: #f5f7fa;
  display: flex; flex-direction: column; gap: 8px;
}
.ac-msg { max-width: 85%; display: flex; flex-direction: column; }
.ac-msg .ac-bubble {
  padding: 9px 12px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.ac-msg.bot .ac-bubble { white-space: normal; }
.ac-msg .ac-meta { font-size: 11px; color: #6b7686; margin: 2px 4px 0; }
.ac-msg.bot, .ac-msg.agent { align-self: flex-start; }
.ac-msg.bot .ac-bubble, .ac-msg.agent .ac-bubble { background: #fff; border: 1px solid #e3e8ef; border-bottom-left-radius: 4px; }
.ac-msg.visitor { align-self: flex-end; }
.ac-msg.visitor .ac-bubble { background: var(--ac-color); color: #fff; border-bottom-right-radius: 4px; }
.ac-msg.visitor .ac-meta { text-align: right; }
.ac-msg.system { align-self: center; max-width: 92%; }
.ac-msg.system .ac-bubble { background: transparent; color: #6b7686; font-size: 12px; text-align: center; padding: 4px 8px; }
.ac-bubble a { color: inherit; text-decoration: underline; }
.ac-msg.bot .ac-bubble a, .ac-msg.agent .ac-bubble a { color: var(--ac-color); }

.ac-options { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.ac-hint { font-size: 12px; color: #6b7686; margin: 6px 2px 0; }
.ac-opt {
  text-align: left; background: #fff; color: var(--ac-color);
  border: 1.5px solid var(--ac-color); border-radius: 20px; padding: 8px 14px;
  font: inherit; cursor: pointer; transition: background .12s, color .12s;
}
.ac-opt:hover { background: var(--ac-color); color: #fff; }
.ac-opt.ac-ghost { border-color: #c9d1dc; color: #4a5568; }
.ac-opt.ac-ghost:hover { background: #4a5568; border-color: #4a5568; color: #fff; }
.ac-opt.ac-human { border-style: dashed; }

.ac-foot { border-top: 1px solid #e3e8ef; background: #fff; padding: 10px; }
.ac-foot[hidden] { display: none; }
.ac-compose { display: flex; gap: 8px; align-items: flex-end; }
.ac-compose textarea {
  flex: 1; resize: none; border: 1px solid #cfd6e0; border-radius: 10px; padding: 9px 10px;
  font: inherit; max-height: 90px; min-height: 38px; outline: none; color: inherit;
}
.ac-compose textarea:focus, .ac-form input:focus, .ac-form textarea:focus { border-color: var(--ac-color); }
.ac-send {
  background: var(--ac-color); color: #fff; border: 0; border-radius: 10px; height: 38px; padding: 0 14px;
  cursor: pointer; font: inherit; font-weight: 600;
}
.ac-send:disabled { opacity: .5; cursor: default; }

.ac-form { display: flex; flex-direction: column; gap: 8px; }
.ac-form label { font-size: 12px; color: #4a5568; display: flex; flex-direction: column; gap: 3px; }
.ac-form input, .ac-form textarea {
  border: 1px solid #cfd6e0; border-radius: 8px; padding: 8px 10px; font: inherit; outline: none; color: inherit; width: 100%;
}
.ac-form textarea { resize: none; height: 60px; }
.ac-form-actions { display: flex; gap: 8px; }
.ac-form-actions .ac-send { flex: 1; }
.ac-form-actions .ac-cancel {
  background: #eef1f6; color: #4a5568; border: 0; border-radius: 10px; padding: 0 14px; cursor: pointer; font: inherit;
}
.ac-error { color: #c62828; font-size: 12px; min-height: 0; }
.ac-error:empty { display: none; }

.ac-ended { text-align: center; color: #4a5568; }
.ac-ended p { margin: 0 0 8px; }

.ac-name { font-size: 12px; font-weight: 600; color: #4a5568; margin: 0 4px 2px; }
.ac-bubble.ac-has-img { padding: 4px; }
.ac-bubble.ac-has-img .ac-cap { padding: 6px 8px 4px; white-space: pre-wrap; }
.ac-img-link { display: block; line-height: 0; }
.ac-img-link img { max-width: 100%; max-height: 240px; border-radius: 10px; display: block; cursor: zoom-in; }

.ac-attach {
  background: #eef1f6; border: 0; border-radius: 10px; width: 38px; height: 38px; flex: none;
  cursor: pointer; font-size: 17px; padding: 0; line-height: 1;
}
.ac-attach:hover { background: #e2e7ef; }
.ac-attach:disabled { opacity: .5; cursor: default; }
.ac-preview {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px;
  background: #f5f7fa; border: 1px solid #e3e8ef; border-radius: 10px;
}
.ac-preview[hidden] { display: none; }
.ac-preview img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; }
.ac-preview-info { flex: 1; font-size: 12px; color: #4a5568; }
.ac-preview-rm {
  background: transparent; border: 0; cursor: pointer; font-size: 20px; color: #6b7686;
  width: 28px; height: 28px; border-radius: 6px; padding: 0; line-height: 1;
}
.ac-preview-rm:hover { background: #e3e8ef; }

@media (max-width: 480px) {
  .adlas-chat.ac-open { inset: 0; bottom: 0; right: 0; left: 0; }
  .adlas-chat.ac-open .ac-launcher { display: none; }
  .adlas-chat.ac-open .ac-panel {
    position: fixed; inset: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0;
  }
}
.ac-bubble a.ac-link { color: inherit; text-decoration: underline; word-break: break-all; }
.ac-offline-note { background: #fff7e6; border: 1px solid #ffd591; color: #7a4b00; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }
.ac-bubble img.ac-bot-img { display: block; max-width: 100%; height: auto; border-radius: 8px; margin: 6px 0; cursor: zoom-in; }

/* Transições suaves */
@keyframes ac-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ac-in-right { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes ac-opt-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ac-msg.ac-enter { animation: ac-in .38s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left bottom; }
.ac-msg.visitor.ac-enter { animation-name: ac-in-right; }
.ac-msg.system.ac-enter { animation-duration: .25s; }
.ac-opt.ac-enter-opt, .ac-hint.ac-enter-opt { animation: ac-opt-in .34s cubic-bezier(.2, .8, .2, 1) both; }
.ac-opt { transition: background .15s ease, color .15s ease, transform .12s ease, box-shadow .15s ease; }
.ac-opt:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 0, 0, .10); }
.ac-opt:active { transform: scale(.98); }
.ac-messages { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) {
  .ac-msg.ac-enter, .ac-opt.ac-enter-opt, .ac-hint.ac-enter-opt { animation: none; }
  .ac-opt { transition: none; }
}

/* Hierarquia: botão pai → resposta → sub-opções */
.ac-msg.visitor.ac-choice { align-self: stretch; max-width: none; margin-left: calc(var(--d, 0) * 16px); }
.ac-msg.ac-choice .ac-meta { display: none; }
.ac-msg.ac-choice .ac-bubble {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-radius: 20px; font-weight: 600; padding: 8px 14px;
}
.ac-msg.ac-choice .ac-bubble::after { content: "▾"; font-size: 12px; opacity: .85; flex: none; }
.ac-msg.visitor.ac-choice.ac-enter { animation-name: ac-in; }
.ac-msg.bot.ac-answer, .ac-options.ac-nested {
  margin-left: calc(var(--d, 0) * 16px + 12px);
  padding-left: 10px;
  border-left: 2px solid #c9d1dc;
  border-left-color: color-mix(in srgb, var(--ac-color) 45%, #fff);
}
.ac-msg.bot.ac-answer { max-width: calc(100% - var(--d, 0) * 16px - 12px); }
.ac-options.ac-nested .ac-opt { font-size: 13px; padding: 7px 12px; }
.ac-messages { position: relative; overflow-anchor: none; }

/* Integração: campo de texto e "digitando…" */
.ac-ask .ac-compose input { flex: 1; border: 1px solid #cfd6e0; border-radius: 10px; padding: 9px 10px; font: inherit; outline: none; color: inherit; min-width: 0; }
.ac-ask .ac-compose input:focus { border-color: var(--ac-color); }
.ac-ask-back {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 10px; padding: 11px 14px; cursor: pointer;
  background: var(--ac-color); color: #fff; border: 0; border-radius: 22px;
  font: inherit; font-size: 15px; font-weight: 700; text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}
.ac-ask-back:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .22); }
.ac-ask-back:active { transform: scale(.98); }
.ac-ask-back:focus-visible { outline: 3px solid rgba(0, 0, 0, .25); outline-offset: 2px; }
.ac-typing .ac-bubble { display: inline-flex; gap: 4px; padding: 12px 14px; }
.ac-dot { width: 7px; height: 7px; border-radius: 50%; background: #9aa5b5; animation: ac-blink 1.2s infinite ease-in-out; }
.ac-dot:nth-child(2) { animation-delay: .18s; }
.ac-dot:nth-child(3) { animation-delay: .36s; }
@keyframes ac-blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ac-dot { animation: none; opacity: .6; } }
.ac-msg.system .ac-bubble { white-space: normal; }

.ac-preview-pdf { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-size: 26px; background: #eef2f7; border-radius: 6px; }
.ac-bubble.ac-has-file { padding: 6px; }
.ac-bubble.ac-has-file .ac-cap { padding: 6px 8px 4px; white-space: pre-wrap; }
.ac-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.06); color: inherit; text-decoration: none; }
.ac-file:hover { background: rgba(0,0,0,.1); }
.ac-file-ico { font-size: 26px; line-height: 1; }
.ac-file-txt { display: flex; flex-direction: column; min-width: 0; }
.ac-file-txt strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-file-txt small { font-size: 11px; opacity: .75; }
.ac-ident-intro { font-size: 13px; font-weight: 600; color: #1a202c; }
.ac-ident-known { font-size: 12.5px; color: #4a5568; background: #f1f5f9; border-radius: 8px; padding: 7px 10px; }
.ac-ident-known strong { color: #1a202c; }
