/* The AI assistant chat window (assistant.js), on topadvisory.com and topadvisory.com/de/; a copy of the jsandp.com one */
.as-launch {
    position: fixed; right: 20px; bottom: 20px; z-index: 900;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 18px 12px 14px; border: none; border-radius: 999px;
    background: var(--navy, #14213D); color: #FFFFFF; font: 600 15px/1 var(--sans);
    box-shadow: 0 8px 24px rgba(20, 33, 61, 0.28); cursor: pointer;
}
.as-launch:hover { background: var(--navy-soft, #24345A); }
.as-launch:focus-visible { outline: 3px solid var(--gold, #C9A227); outline-offset: 2px; }
.as-launch svg { width: 22px; height: 22px; flex: none; }
.as-launch .as-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold, #C9A227); }
.as-open .as-launch { display: none; }

.as-panel {
    position: fixed; right: 20px; bottom: 20px; z-index: 901;
    width: 400px; height: min(620px, calc(100vh - 40px));
    display: none; flex-direction: column; overflow: hidden;
    background: #FFFFFF; color: var(--ink, #14213D); border-radius: 16px;
    box-shadow: 0 20px 60px rgba(20, 33, 61, 0.30); font-family: var(--sans);
}
.as-open .as-panel { display: flex; }

.as-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 18px; background: var(--navy, #14213D); color: #FFFFFF; }
.as-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold, #C9A227); display: grid; place-items: center; flex: none; }
.as-avatar svg { width: 20px; height: 20px; }
.as-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.as-sub { font-size: 12px; color: rgba(255, 255, 255, 0.7); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.as-sub::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold, #C9A227); }
.as-head-btns { margin-left: auto; display: flex; gap: 4px; }
.as-icon-btn { background: transparent; border: none; color: rgba(255, 255, 255, 0.8); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.as-icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }
.as-icon-btn svg { width: 18px; height: 18px; }

.as-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: var(--bg-soft, #FAF8F3); display: flex; flex-direction: column; gap: 10px; }
.as-msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.as-msg p { margin: 0 0 8px; }
.as-msg p:last-child, .as-msg ul:last-child { margin-bottom: 0; }
.as-msg ul { margin: 0 0 8px; padding-left: 20px; }
.as-msg a { color: var(--green, #0C8A63); font-weight: 600; }
.as-bot { align-self: flex-start; background: #FFFFFF; border: 1px solid var(--line, #E3DFD5); border-bottom-left-radius: 4px; }
.as-user { align-self: flex-end; background: var(--green, #0C8A63); color: #FFFFFF; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.as-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.as-typing i { width: 7px; height: 7px; border-radius: 50%; background: #A3A8B8; animation: as-blink 1.2s infinite ease-in-out; }
.as-typing i:nth-child(2) { animation-delay: 0.15s; }
.as-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes as-blink { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.as-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 6px; }
.as-chip { border: 1px solid #CBD0DA; background: #FFFFFF; color: var(--ink, #14213D); border-radius: 999px; padding: 7px 12px; font: 500 13px/1.3 inherit; font-family: inherit; cursor: pointer; text-align: left; }
.as-chip-contact { border-color: var(--gold, #C9A227); }
.as-chip:hover { border-color: var(--green, #0C8A63); color: var(--green, #0C8A63); }

.as-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line, #E3DFD5); background: #FFFFFF; }
.as-form textarea {
    flex: 1; resize: none; max-height: 120px; min-height: 42px; padding: 10px 12px;
    border: 1px solid #CBD0DA; border-radius: 10px; font: 14.5px/1.4 inherit; font-family: inherit; color: inherit;
}
.as-form textarea:focus { outline: 2px solid var(--green, #0C8A63); outline-offset: 0; border-color: transparent; }
.as-send { width: 42px; height: 42px; flex: none; border: none; border-radius: 10px; background: var(--green, #0C8A63); color: #FFFFFF; cursor: pointer; display: grid; place-items: center; }
.as-send:hover { background: #0A7353; }
.as-send:disabled { background: #A3A8B8; cursor: default; }
.as-send svg { width: 18px; height: 18px; }
.as-note { padding: 0 12px 10px; font-size: 11.5px; color: var(--muted, #586078); background: #FFFFFF; }
.as-note a { color: inherit; }

@media (max-width: 520px) {
    .as-launch { right: 16px; bottom: 16px; }
    .as-panel { right: 0; bottom: 0; width: 100%; height: 100%; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .as-typing i { animation: none; opacity: 0.6; } }
