.header-photo,
.neon-sidebar-profile,
.kb-header,
#logo,
.kn-assistant-anchor,
.sf-brand-anchor,
.kb-assistant-anchor,
.kn-brand-block,
.navbar-brand-wrap,
.sf-navbar-inner {
    position: relative;
}

.header-photo:has(> .site-assistant),
.kb-brand-photo-wrap:has(> .site-assistant),
#logo:has(> .site-assistant),
.kn-assistant-anchor:has(> .site-assistant),
.sf-brand-anchor:has(> .site-assistant),
.kb-assistant-anchor:has(> .site-assistant),
.neon-sidebar-profile:has(> .site-assistant) {
    overflow: visible;
}

.site-assistant {
    position: absolute;
    top: 0.35rem;
    right: -0.15rem;
    z-index: 10051;
}

.header-photo > .site-assistant {
    top: 0.15rem;
    right: auto;
    left: calc(100% + 0.4rem);
    z-index: 10051;
}

#logo > .site-assistant {
    z-index: 10051;
}

.astro-brand-anchor.header-photo > .site-assistant {
    top: 0.05rem;
    left: calc(100% + 0.15rem);
}

.neon-sidebar-profile > .site-assistant {
    top: 0.15rem;
    right: 0.2rem;
    left: auto;
}

.kb-header > .site-assistant {
    top: 0.45rem;
    left: 2.6rem;
    right: auto;
}

.kn-assistant-anchor > .site-assistant {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    display: inline-flex;
    z-index: 10051;
}

.sf-brand-anchor > .site-assistant {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    display: inline-flex;
    order: -1;
    flex: 0 0 auto;
    margin: 0 0.35rem 0 0;
    z-index: 10051;
}

.kb-assistant-anchor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    min-height: 26px;
    flex: 0 0 auto;
}

.kn-assistant-anchor:not(:has(> .site-assistant)) {
    min-width: 32px;
    min-height: 32px;
}

.kb-assistant-anchor > .site-assistant {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    display: inline-flex;
    z-index: 10051;
}

.site-assistant.is-inline {
    position: static;
    display: inline-flex;
    top: auto;
    right: auto;
    left: auto;
    z-index: 2;
    flex: 0 0 auto;
    margin: 0 0.35rem 0 0;
}

.site-assistant.is-floating {
    position: fixed;
    top: 4.75rem;
    right: 0.75rem;
    left: auto;
    bottom: auto;
    z-index: 10050;
}

.site-assistant__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #6d4aff;
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    cursor: pointer;
}

.site-assistant__name {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-assistant__panel[hidden] {
    display: none !important;
}

.site-assistant__panel {
    position: fixed;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    width: min(22rem, calc(100vw - 1.5rem));
    max-height: min(28rem, 70dvh);
    overflow: hidden;
    color: #f5f5f8;
    background: #171722;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.site-assistant__head {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.75rem 0.45rem 0.9rem;
}

.site-assistant__head strong {
    display: block;
    font-size: 0.95rem;
}

.site-assistant__head p,
.site-assistant__note {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: rgba(245, 245, 248, 0.72);
}

.site-assistant__close,
.site-assistant__send {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.site-assistant__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
}

.site-assistant__close:hover,
.site-assistant__close:focus {
    color: inherit;
    background: rgba(255, 255, 255, 0.08);
    border: 0;
    box-shadow: none;
}

.site-assistant__log {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 8rem;
    padding: 0.2rem 0.9rem 0.7rem;
    overflow: auto;
}

.site-assistant__note--user {
    align-self: flex-end;
    max-width: 85%;
    padding: 0.45rem 0.65rem;
    color: #fff;
    background: #6d4aff;
    border-radius: 0.8rem 0.8rem 0.2rem 0.8rem;
}

.site-assistant__note--reply,
.site-assistant__note--intro {
    align-self: flex-start;
    max-width: 90%;
    padding: 0.45rem 0.65rem;
    color: #f5f5f8;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.8rem 0.8rem 0.8rem 0.2rem;
}

.site-assistant__form {
    display: flex;
    gap: 0.4rem;
    padding: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-assistant__input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    color: #f5f5f8;
    background: rgba(255, 255, 255, 0.06);
    border: 0;
    border-radius: 999px;
}

.site-assistant__send {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    background: #fff;
    color: #171722;
    border-radius: 999px;
}

@media (max-width: 767px) {
    .site-assistant.is-floating {
        top: auto;
        right: 0.75rem;
        bottom: 4.25rem;
    }
}
