.viya-assistant {
    --viya-cyan: #22d3ee;
    --viya-emerald: #34d399;
    position: fixed;
    right: 22px;
    bottom: 20px;
    z-index: 75;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    font-family: "Inter", sans-serif;
}

.viya-assistant.is-contextual {
    right: auto;
    bottom: auto;
    transition: left .42s cubic-bezier(.22, 1, .36, 1), top .42s cubic-bezier(.22, 1, .36, 1);
}

.viya-avatar-wrap {
    position: relative;
    width: 260px;
    height: 260px;
    flex: 0 0 auto;
    cursor: pointer;
    filter: drop-shadow(0 18px 22px rgba(2, 8, 23, .7));
    transition: width .25s ease, height .25s ease, transform .25s ease, filter .25s ease;
}

.viya-assistant.is-open .viya-avatar-wrap { width: 180px; height: 180px; }

.viya-avatar-wrap:hover,
.viya-avatar-wrap:focus-visible {
    transform: translateY(-4px);
    filter: drop-shadow(0 22px 30px rgba(34, 211, 238, .22));
    outline: none;
}

.viya-avatar {
    width: 100%;
    height: 100%;
    background-image: url("../images/mascots/viya-real-directions.webp?v=1");
    background-repeat: no-repeat;
    background-size: 300% 300%;
    background-position: 50% 50%;
    transition: transform .18s ease;
}

.viya-avatar.is-reacting { animation: viya-boop .55s ease; }

.viya-online {
    display: none;
}

.viya-invite {
    position: absolute;
    right: 114px;
    bottom: 158px;
    width: max-content;
    max-width: 220px;
    padding: 10px 13px;
    border: 1px solid rgba(103, 232, 249, .3);
    border-radius: 14px 14px 3px 14px;
    background: rgba(7, 17, 31, .94);
    color: #e6faff;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    backdrop-filter: blur(16px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.viya-assistant.is-open .viya-invite { opacity: 0; transform: translateY(5px); }
.viya-assistant.has-seen-invite .viya-invite { opacity: 0; transform: translateY(5px); }
.viya-assistant.is-contextual .viya-invite {
    right: auto;
    left: 50%;
    bottom: calc(100% - 42px);
    width: 230px;
    opacity: 1;
    transform: translateX(-50%);
    border-radius: 14px 14px 14px 3px;
}
.viya-assistant.is-contextual.context-right .viya-invite {
    left: auto;
    right: 12px;
    transform: none;
}

body:has(.viya-assistant) :is(#goToTopBtn, #back-to-top-btn) { right: 182px; }

.viya-panel {
    width: min(360px, calc(100vw - 188px));
    max-height: min(610px, calc(100vh - 42px));
    overflow: hidden auto;
    border: 1px solid rgba(103, 232, 249, .22);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(7, 17, 31, .98), rgba(15, 23, 42, .97));
    color: #e5e7eb;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .52), 0 0 0 1px rgba(255, 255, 255, .035) inset;
    backdrop-filter: blur(22px);
    transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.viya-assistant:not(.is-open) .viya-panel {
    position: absolute;
    right: 122px;
    bottom: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(.97);
    pointer-events: none;
}

.viya-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 18px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.viya-name { margin: 0; color: white; font-size: 16px; font-weight: 800; }
.viya-status { margin: 4px 0 0; color: #a5f3fc; font-size: 11px; font-weight: 600; }
.viya-close {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 9px;
    background: rgba(255, 255, 255, .04);
    color: #cbd5e1;
    cursor: pointer;
}
.viya-close:hover { color: white; background: rgba(255, 255, 255, .09); }

.viya-panel-body { padding: 17px 18px 18px; }
.viya-message {
    margin: 0 0 14px;
    padding: 13px 14px;
    border-radius: 4px 15px 15px 15px;
    background: rgba(34, 211, 238, .09);
    color: #dbeafe;
    font-size: 13px;
    line-height: 1.55;
}
.viya-disclosure { display: block; margin-top: 7px; color: #94a3b8; font-size: 10px; }
.viya-question-label { margin: 0 0 9px; color: #94a3b8; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.viya-questions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.viya-question {
    min-height: 48px;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
    color: #e2e8f0;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.viya-question:hover,
.viya-question:focus-visible { border-color: rgba(34, 211, 238, .55); background: rgba(34, 211, 238, .09); transform: translateY(-1px); outline: none; }
.viya-answer { display: none; }
.viya-answer.is-visible { display: block; animation: viya-answer-in .22s ease; }
.viya-answer-text { margin: 0 0 12px; color: #dbeafe; font-size: 13px; line-height: 1.58; }
.viya-answer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.viya-action,
.viya-back {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}
.viya-action { border: 1px solid rgba(52, 211, 153, .38); background: rgba(52, 211, 153, .12); color: #a7f3d0; }
.viya-back { border: 1px solid rgba(148, 163, 184, .18); background: rgba(255, 255, 255, .035); color: #cbd5e1; cursor: pointer; }

@keyframes viya-boop { 45% { transform: scale(.96) translateY(5px); } 70% { transform: scale(1.03) translateY(-3px); } }
@keyframes viya-answer-in { from { opacity: 0; transform: translateY(5px); } }

@media (max-width: 767px) {
    .viya-assistant { right: 5px; bottom: 70px; gap: 4px; }
    .viya-avatar-wrap { width: 190px; height: 190px; }
    .viya-assistant.is-open .viya-avatar-wrap { width: 118px; height: 118px; }
    .viya-online { right: 11px; top: 15px; width: 10px; height: 10px; }
    .viya-invite { display: none; }
    .viya-panel { width: calc(100vw - 128px); max-height: calc(100vh - 92px); border-radius: 17px; }
    .viya-assistant:not(.is-open) .viya-panel { right: 86px; }
    .viya-panel-header { padding: 13px 13px 11px; }
    .viya-panel-body { padding: 13px; }
    .viya-message, .viya-answer-text { font-size: 11px; }
    .viya-questions { grid-template-columns: 1fr; }
    .viya-question { min-height: 39px; }
    body:has(.viya-assistant) :is(#goToTopBtn, #back-to-top-btn) { right: 126px; }
}

@media (prefers-reduced-motion: reduce) {
    .viya-assistant, .viya-avatar-wrap, .viya-avatar, .viya-panel, .viya-invite, .viya-question { transition: none; }
    .viya-avatar.is-reacting, .viya-answer.is-visible { animation: none; }
}
