/* APAS — Atendente virtual (perguntas prontas, sem IA) */
.at-fab {
  position: fixed; bottom: 94px; right: 24px; z-index: 901;
  height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 999px;
  background: var(--g); color: #fff; font: inherit; font-size: 14.5px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  box-shadow: 0 12px 28px -8px rgba(0,140,60,.55);
  transition: transform var(--transition), background var(--transition);
}
.at-fab { padding: 0 20px 0 6px; }
.at-pm { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.18); display: block; animation: atAceno 5s ease-in-out infinite; transform-origin: 50% 90%; }
.at-pm svg, .at-av svg { width: 100%; height: 100%; display: block; }
@keyframes atLuz { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.at-pm .at-luz, .at-av .at-luz { animation: atLuz 1.6s ease-in-out infinite; }
@keyframes atAceno { 0%,82%,100% { transform: none; } 86% { transform: rotate(-9deg); } 90% { transform: rotate(7deg); } 94% { transform: rotate(-4deg); } }
.at-fab:hover { transform: translateY(-2px); background: var(--g-dark); }
.at-fab:focus-visible { outline: 3px solid color-mix(in srgb, var(--g) 40%, transparent); outline-offset: 3px; }
.at-aberto .at-fab { opacity: 0; pointer-events: none; }
.back-top { bottom: 160px; }

.at-box {
  position: fixed; right: 22px; bottom: 24px; z-index: 950;
  width: 380px; max-width: calc(100vw - 32px); height: min(600px, calc(100vh - 48px));
  background: var(--surface); color: var(--txt); border: 1px solid var(--border); border-radius: 24px;
  box-shadow: 0 30px 70px -20px rgba(3,49,27,.45);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none; visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.at-aberto .at-box { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .22s ease, transform .22s ease; }

.at-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; background: linear-gradient(135deg, var(--g-dark), var(--g)); color: #fff; }
.at-av { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; display: block; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.at-head-txt { flex: 1; min-width: 0; line-height: 1.3; }
.at-head-txt strong { display: block; font-size: 15px; }
.at-head-txt small { font-size: 12px; opacity: .85; }
.at-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.at-x:hover { background: rgba(255,255,255,.26); }

.at-msgs { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); overscroll-behavior: contain; }
.at-m { max-width: 88%; padding: 11px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.at-m.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.at-m.eu  { align-self: flex-end; background: var(--g); color: #fff; border-bottom-right-radius: 6px; }
.at-m ul { margin: 6px 0 0; padding-left: 18px; white-space: normal; }
.at-m li { margin: 2px 0; }
.at-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; white-space: normal; }
.at-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: color-mix(in srgb, var(--g) 10%, transparent); color: var(--g); font-size: 13px; font-weight: 700; text-decoration: none; }
.at-link:hover { background: var(--g); color: #fff; }
.at-dig { align-self: flex-start; display: flex; gap: 4px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.at-dig span { width: 6px; height: 6px; border-radius: 50%; background: var(--txt3); animation: atDig 1s infinite; }
.at-dig span:nth-child(2) { animation-delay: .15s; } .at-dig span:nth-child(3) { animation-delay: .3s; }
@keyframes atDig { 0%,60%,100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.at-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 6px; }
.at-chip { border: 1px solid var(--border); background: var(--surface); color: var(--txt); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.at-chip i { color: var(--g); font-size: 12px; }
.at-chip:hover { border-color: var(--g); color: var(--g); }

.at-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.at-in { flex: 1; min-width: 0; border: 1.5px solid var(--border); border-radius: 999px; padding: 11px 16px; font: inherit; font-size: 14px; background: var(--surface2, var(--surface)); color: var(--txt); outline: none; }
.at-in:focus { border-color: var(--g); }
.at-env { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--g); color: #fff; font-size: 16px; cursor: pointer; flex-shrink: 0; }
.at-env:hover { background: var(--g-dark); }
.at-aviso { padding: 0 14px 10px; font-size: 11.5px; color: var(--txt3); background: var(--surface); text-align: center; }

@media (max-width: 768px) {
  .at-fab { bottom: 80px; right: 14px; height: 50px; padding: 0 16px 0 5px; font-size: 14px; }
  .at-pm { width: 40px; height: 40px; }
  .back-top { bottom: 140px; }
  .at-box { right: 0; left: 0; bottom: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) { .at-box, .at-fab { transition: none; } .at-pm, .at-luz { animation: none !important; } .at-dig span { animation: none; } }
@media print { .at-fab, .at-box { display: none !important; } }
