/* Aegon AI: widget de chat. Classes com prefixo aai-; tokens em .aai-root (escuro) e em html[data-aai="light"] (claro). */
@property --aai-a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.aai-root { --aai-ink: #f3f6ff; --aai-mute: #9fabc2; --aai-line: rgba(170, 200, 255, .16); --aai-blue: #3d6dff; --aai-sky: #72a8ff; --aai-glow: #6fa2ff; --aai-ease: cubic-bezier(.22, 1, .36, 1);
  --aai-bg: rgba(8, 14, 30, .76); --aai-panel: linear-gradient(180deg, rgba(14, 24, 50, .86), rgba(6, 11, 24, .92)); --aai-soft: rgba(255, 255, 255, .04); --aai-hover: rgba(255, 255, 255, .06); --aai-shadow: 0 40px 120px -30px rgba(0, 0, 0, .8); --aai-btn: #f3f6ff; --aai-btn-ink: #0b1430; --aai-focus: #9cc5ff;
  font-family: var(--f, "Manrope", system-ui, sans-serif); color: var(--aai-ink); }
html[data-aai="light"] .aai-root { --aai-ink: #0a1530; --aai-mute: #5b6782; --aai-line: rgba(18, 52, 130, .12); --aai-sky: #2459e8; --aai-glow: #4b7dff;
  --aai-bg: rgba(255, 255, 255, .88); --aai-panel: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(243, 246, 255, .97)); --aai-soft: #f3f6fd; --aai-hover: rgba(10, 30, 80, .05); --aai-shadow: 0 30px 80px -30px rgba(10, 30, 80, .35); --aai-btn: #0a1530; --aai-btn-ink: #fff; --aai-focus: #2459e8; }
.aai-root [hidden] { display: none !important; }
:where(.aai-root) :where(button, textarea) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.aai-root :focus-visible { outline: 2px solid var(--aai-focus); outline-offset: 2px; }
.aai-input textarea:focus-visible { outline: none; }
@keyframes aai-spin { to { --aai-a: 360deg; } }
@keyframes aai-halo { 0% { box-shadow: 0 0 0 0 rgba(111, 162, 255, .45); } 70%, 100% { box-shadow: 0 0 0 14px rgba(111, 162, 255, 0); } }
@keyframes aai-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes aai-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: 1; } }

/* Orbe CSS (avatares e fallback sem WebGL): bolha de vidro escura com anel azul fino */
.aai-orb { position: relative; display: block; flex: none; width: var(--s, 50px); height: var(--s, 50px); border-radius: 50%; background: radial-gradient(circle at 50% 38%, #0d1d45, #02050d 72%); box-shadow: 0 0 18px rgba(47, 107, 255, .5), inset 0 0 8px rgba(114, 168, 255, .15); }
.aai-orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 1.5px; background: conic-gradient(from var(--aai-a, 0deg), #2f6bff, #72a8ff, #cfe6ff, #2f6bff); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: aai-spin 6s linear infinite; }

/* Lançador */
.aai-launch { position: fixed; z-index: 120; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 12px; padding: 7px 22px 7px 7px; border-radius: 999px; background: var(--aai-bg); border: 1px solid var(--aai-line); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 0, 0, .25), inset 0 1px rgba(255, 255, 255, .08); transition: transform .4s var(--aai-ease), border-color .4s; }
.aai-launch:hover { transform: translateY(-2px); border-color: rgba(170, 200, 255, .34); }
.aai-launch::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: .55; background: conic-gradient(from var(--aai-a, 0deg), transparent 0 55%, #72a8ff, #cfe6ff 80%, transparent); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: aai-spin 6s linear infinite; }
.aai-launch::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; animation: aai-halo 2.8s infinite; }
.aai-launch.aai-seen::after { animation: none; box-shadow: none; }
.aai-launch canvas { width: 50px; height: 50px; border-radius: 50%; }
.aai-lt { display: flex; flex-direction: column; text-align: left; line-height: 1.3; }
.aai-lt b { font-size: 14px; font-weight: 500; }
.aai-lt small { font-size: 11.5px; color: var(--aai-mute); }

/* Teaser */
.aai-teaser { position: fixed; z-index: 120; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(94px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; max-width: 260px; padding: 4px 4px 4px 14px; border-radius: 18px; background: var(--aai-bg); border: 1px solid var(--aai-line); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .6); opacity: 0; transform: translateY(8px); visibility: hidden; transition: opacity .5s var(--aai-ease), transform .5s var(--aai-ease), visibility .5s; }
.aai-teaser.aai-show { opacity: 1; transform: none; visibility: visible; }
.aai-tt { flex: 1; padding: 8px 6px; text-align: left; font-size: 13.5px; line-height: 1.45; }
.aai-tx { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--aai-mute); font-size: 16px; line-height: 1; }
.aai-tx:hover { background: var(--aai-hover); color: var(--aai-ink); }

/* Painel */
.aai-panel { position: fixed; z-index: 120; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); width: 410px; height: min(660px, calc(100vh - 130px)); height: min(660px, calc(100dvh - 130px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 28px; background: var(--aai-panel); border: 1px solid var(--aai-line); -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%); box-shadow: var(--aai-shadow); opacity: 0; transform: translateY(18px) scale(.94); transform-origin: bottom right; visibility: hidden; pointer-events: none; transition: opacity .5s var(--aai-ease), transform .5s var(--aai-ease), visibility .5s; }
.aai-panel.aai-open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; }
.aai-panel::before { content: ""; position: absolute; top: -120px; right: -80px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(rgba(70, 130, 255, .35), transparent 65%); pointer-events: none; }
.aai-panel > * { position: relative; }
.aai-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--aai-line); }
.aai-hc { display: block; flex: none; width: 38px; height: 38px; border-radius: 50%; }
.aai-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.aai-title b { font-size: 15px; font-weight: 500; }
.aai-title small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--aai-mute); }
.aai-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--aai-sky); box-shadow: 0 0 8px var(--aai-glow); }
.aai-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--aai-mute); transition: background .2s, color .2s; }
.aai-icon:hover { background: var(--aai-hover); color: var(--aai-ink); }
.aai-icon svg, .aai-send svg { width: 18px; height: 18px; }

/* Mensagens */
.aai-msgs { flex: 1; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding: 20px 18px; scrollbar-width: thin; scrollbar-color: rgba(170, 200, 255, .2) transparent; }
.aai-msgs::-webkit-scrollbar { width: 6px; }
.aai-msgs::-webkit-scrollbar-thumb { background: rgba(170, 200, 255, .2); border-radius: 6px; }
.aai-empty { margin: auto 0; }
.aai-hero { display: block; width: 112px; height: 112px; margin: 0 0 14px; }
.aai-empty h2 { margin: 0 0 8px; font-size: 26px; font-weight: 400; letter-spacing: -.03em; line-height: 1.2; }
.aai-empty h2 span { background: linear-gradient(90deg, var(--aai-sky), #fff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.aai-empty p { margin: 0 0 18px; font-size: 13.5px; color: var(--aai-mute); }
.aai-chips { display: flex; flex-direction: column; gap: 8px; }
.aai-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-radius: 999px; text-align: left; font-size: 13px; background: var(--aai-soft); border: 1px solid var(--aai-line); transition: border-color .2s; }
.aai-chip:hover { border-color: var(--aai-sky); }
.aai-chip span { color: var(--aai-sky); }
.aai-panel.aai-open .aai-chip { animation: aai-in .5s var(--aai-ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.aai-row { animation: aai-in .4s var(--aai-ease) both; }
.aai-me { display: flex; justify-content: flex-end; }
.aai-u { max-width: 82%; padding: 11px 15px; border-radius: 18px 18px 6px 18px; background: linear-gradient(135deg, #3d6dff, #5b8cff); color: #fff; font-size: 14px; line-height: 1.5; white-space: pre-wrap; box-shadow: 0 10px 30px -12px rgba(61, 109, 255, .7); }
.aai-bot { display: flex; align-items: flex-start; gap: 10px; }
.aai-bot > .aai-orb { margin-top: 2px; }
.aai-txt { min-width: 0; max-width: 92%; font-size: 14.5px; line-height: 1.65; }
.aai-txt ul { margin: 6px 0 0; padding: 0; list-style: none; }
.aai-txt li { position: relative; margin: 2px 0; padding-left: 14px; }
.aai-txt li::before { content: ""; position: absolute; left: 1px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--aai-sky); }
.aai-wa { display: inline-flex; align-items: center; margin-top: 10px; height: 38px; padding: 0 16px; border-radius: 999px; background: var(--aai-btn); color: var(--aai-btn-ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.aai-think { display: inline-flex; align-items: center; gap: 4px; height: 22px; font-size: 12px; color: var(--aai-mute); }
.aai-think i { width: 6px; height: 6px; border-radius: 50%; background: var(--aai-sky); animation: aai-bounce 1.2s infinite ease-in-out; }
.aai-think i:nth-child(2) { animation-delay: .15s; }
.aai-think i:nth-child(3) { animation-delay: .3s; }
.aai-think span { margin-left: 6px; }

/* Rodapé */
.aai-foot { padding: 12px 14px 14px; }
.aai-input { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 20px; background: var(--aai-soft); border: 1px solid var(--aai-line); transition: border-color .2s, box-shadow .2s; }
.aai-input:focus-within { border-color: var(--aai-sky); box-shadow: 0 0 0 4px rgba(111, 162, 255, .12); }
.aai-input textarea { flex: 1; min-width: 0; max-height: 88px; padding: 8px 0; resize: none; background: transparent; font-size: 14.5px; line-height: 1.5; }
.aai-input textarea::placeholder { color: var(--aai-mute); }
.aai-send { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--aai-btn); color: var(--aai-btn-ink); transition: opacity .2s; }
.aai-send:disabled { opacity: .35; cursor: default; }
.aai-disc { margin: 10px 0 0; text-align: center; font-size: 10.5px; color: var(--aai-mute); }

/* Tema claro (Corporate) */
html[data-aai="light"] .aai-launch { box-shadow: 0 20px 50px -18px rgba(10, 30, 80, .35), 0 0 0 1px rgba(18, 52, 130, .06), inset 0 1px rgba(255, 255, 255, .9); }
html[data-aai="light"] .aai-launch:hover { border-color: rgba(36, 89, 232, .35); }
html[data-aai="light"] .aai-teaser { box-shadow: 0 16px 40px -16px rgba(10, 30, 80, .3); }
html[data-aai="light"] .aai-empty h2 span { background: linear-gradient(90deg, #2459e8, #0a1530); -webkit-background-clip: text; background-clip: text; }
html[data-aai="light"] .aai-panel::before { background: radial-gradient(rgba(70, 130, 255, .16), transparent 65%); }
html[data-aai="light"] .aai-msgs { scrollbar-color: rgba(18, 52, 130, .2) transparent; }
html[data-aai="light"] .aai-msgs::-webkit-scrollbar-thumb { background: rgba(18, 52, 130, .2); }

/* Responsivo */
@media (max-width: 760px) {
  .aai-launch { box-sizing: border-box; width: 58px; height: 58px; padding: 0; justify-content: center; }
  .aai-launch canvas, .aai-launch .aai-orb { width: 56px; height: 56px; }
  .aai-lt, .aai-teaser { display: none; }
}
@media (max-width: 600px) {
  .aai-launch[aria-expanded="true"] { display: none; }
  .aai-panel { inset: 0; width: auto; height: auto; border-radius: 0; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  .aai-hero { width: 96px; height: 96px; }
  .aai-input textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .aai-root *, .aai-root *::before, .aai-root *::after { animation: none !important; transition: none !important; }
}
