.genasstai-asst-widget {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2147483000;
    font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #f7f9ff;
    --asst-primary: #8B5CF6;
    --asst-accent: #69B7FF;
}

.genasstai-asst-widget,
.genasstai-asst-widget * {
    box-sizing: border-box;
}

.genasstai-asst-widget[data-position="left"] {
    right: auto;
    left: 18px;
}

.asst-launcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.72rem;
    min-height: 58px;
    padding: 0.62rem 0.9rem 0.62rem 0.62rem;
    border: 1px solid rgba(139, 164, 255, 0.28);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(7, 12, 26, 0.98), rgba(24, 32, 64, 0.96));
    color: inherit;
    box-shadow: 0 18px 54px rgba(2, 6, 18, 0.42), inset 0 1px 0 rgba(255,255,255,0.08);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.asst-launcher:hover {
    transform: translateY(-2px);
    border-color: rgba(105, 183, 255, 0.48);
    box-shadow: 0 22px 60px rgba(2, 6, 18, 0.5), 0 0 0 5px rgba(105, 183, 255, 0.08);
}

.asst-launcher-icon,
.asst-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,0.92), transparent 0 18%, transparent 19%),
        linear-gradient(135deg, var(--asst-accent), var(--asst-primary));
    color: #071024;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.32), 0 10px 24px rgba(105, 183, 255, 0.2);
}

.asst-launcher-copy {
    display: grid;
    gap: 0.02rem;
    text-align: left;
}

.asst-launcher-copy strong {
    font-size: 0.94rem;
    line-height: 1.1;
}

.asst-launcher-copy span {
    color: rgba(222, 230, 255, 0.72);
    font-size: 0.75rem;
    line-height: 1.2;
}

.asst-notification-dot {
    position: absolute;
    top: 5px;
    right: 7px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #38f8a5;
    box-shadow: 0 0 0 5px rgba(56, 248, 165, 0.14);
}

.genasstai-asst-widget[data-animations="1"] .asst-notification-dot {
    animation: asstPulse 1.8s ease-in-out infinite;
}

.asst-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 14px);
    display: flex;
    flex-direction: column;
    width: min(390px, calc(100vw - 28px));
    height: min(690px, calc(100vh - 112px));
    overflow: hidden;
    border: 1px solid rgba(139, 164, 255, 0.24);
    border-radius: 24px;
    background: rgba(8, 12, 26, 0.96);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255,255,255,0.06);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.genasstai-asst-widget[data-position="left"] .asst-panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.genasstai-asst-widget.is-open .asst-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.genasstai-asst-widget[data-admin-operator="1"] .asst-panel {
    border-color: rgba(105, 183, 255, 0.34);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.54),
        0 0 0 1px rgba(139, 92, 246, 0.1),
        0 0 34px rgba(105, 183, 255, 0.12),
        inset 0 1px 0 rgba(255,255,255,0.07);
}

.asst-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(139, 164, 255, 0.16);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(105, 183, 255, 0.08));
}

.asst-head-main {
    display: flex;
    align-items: center;
    gap: 0.78rem;
    min-width: 0;
}

.asst-head-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.asst-head-copy strong {
    font-size: 1rem;
    line-height: 1.15;
}

.asst-head-copy span {
    color: rgba(221, 230, 255, 0.72);
    font-size: 0.78rem;
    line-height: 1.25;
}

.asst-online {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
}

.asst-online::before {
    content: "";
    width: 0.44rem;
    height: 0.44rem;
    border-radius: 50%;
    background: #38f8a5;
}

.asst-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(139, 164, 255, 0.18);
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: #f7f9ff;
    cursor: pointer;
}

.asst-operator-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.68rem 1rem;
    border-bottom: 1px solid rgba(139, 164, 255, 0.14);
    background:
        linear-gradient(90deg, rgba(105, 183, 255, 0.09), rgba(139, 92, 246, 0.08)),
        rgba(5, 8, 18, 0.5);
}

.asst-operator-chip,
.asst-operator-mode {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    border-radius: 999px;
    white-space: nowrap;
}

.asst-operator-chip {
    padding: 0.34rem 0.52rem;
    border: 1px solid rgba(105, 183, 255, 0.22);
    background: rgba(105, 183, 255, 0.1);
    color: rgba(221, 242, 255, 0.96);
    font-size: 0.7rem;
    font-weight: 700;
}

.asst-operator-mode {
    flex: 1 1 auto;
    justify-content: flex-end;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(221, 230, 255, 0.68);
    font-size: 0.72rem;
}

.asst-messages {
    display: grid;
    align-content: start;
    gap: 0.82rem;
    min-height: 0;
    flex: 1 1 auto;
    padding: 1rem;
    overflow: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 164, 255, 0.34) transparent;
}

.asst-messages::-webkit-scrollbar,
.asst-input::-webkit-scrollbar {
    width: 8px;
}

.asst-messages::-webkit-scrollbar-thumb,
.asst-input::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(139, 164, 255, 0.32);
}

.asst-messages::-webkit-scrollbar-track,
.asst-input::-webkit-scrollbar-track {
    background: transparent;
}

.asst-message {
    display: grid;
    gap: 0.32rem;
    max-width: 86%;
}

.asst-message.is-user {
    justify-self: end;
}

.asst-message.is-assistant {
    justify-self: start;
}

.asst-bubble {
    position: relative;
    padding: 0.76rem 0.86rem;
    border-radius: 18px;
    border: 1px solid rgba(139, 164, 255, 0.14);
    background: rgba(255,255,255,0.06);
    color: rgba(247, 249, 255, 0.96);
    font-size: 0.91rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.asst-message.is-user .asst-bubble {
    border-color: rgba(105, 183, 255, 0.22);
    background: linear-gradient(135deg, rgba(105, 183, 255, 0.24), rgba(139, 92, 246, 0.2));
}

.asst-bubble a {
    color: #9ee4ff;
    text-decoration: none;
}

.asst-bubble a:hover {
    text-decoration: underline;
}

.asst-bubble pre {
    max-width: 100%;
    overflow: auto;
    margin: 0.7rem 0;
    padding: 0.72rem;
    border: 1px solid rgba(139, 164, 255, 0.16);
    border-radius: 12px;
    background: rgba(0,0,0,0.28);
}

.asst-bubble code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.84em;
}

.asst-copy {
    justify-self: start;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: rgba(247,249,255,0.72);
    cursor: pointer;
}

.asst-message.is-user .asst-copy {
    display: none;
}

.asst-typing {
    display: inline-flex;
    gap: 0.28rem;
    align-items: center;
    min-width: 42px;
}

.asst-typing span {
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: rgba(247,249,255,0.68);
    animation: asstTyping 1s infinite ease-in-out;
}

.asst-typing span:nth-child(2) {
    animation-delay: 0.12s;
}

.asst-typing span:nth-child(3) {
    animation-delay: 0.24s;
}

.asst-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem 0.82rem;
}

.asst-suggestion {
    max-width: 100%;
    padding: 0.5rem 0.62rem;
    border: 1px solid rgba(139, 164, 255, 0.18);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: rgba(247,249,255,0.86);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.asst-suggestion:hover {
    transform: translateY(-1px);
    border-color: rgba(105, 183, 255, 0.36);
    background: rgba(105, 183, 255, 0.08);
}

.asst-form {
    display: grid;
    gap: 0.72rem;
    padding: 0.88rem;
    border-top: 1px solid rgba(139, 164, 255, 0.16);
    background: rgba(5, 8, 18, 0.72);
}

.asst-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 0.58rem;
    align-items: end;
}

.asst-input {
    width: 100%;
    max-height: 132px;
    min-height: 42px;
    resize: none;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 164, 255, 0.34) transparent;
    border: 1px solid rgba(139, 164, 255, 0.2);
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
    color: #f7f9ff;
    padding: 0.72rem 0.82rem;
    font: inherit;
    font-size: 0.91rem;
    outline: none;
}

.asst-input:focus {
    border-color: rgba(105, 183, 255, 0.64);
    box-shadow: 0 0 0 4px rgba(105, 183, 255, 0.1);
}

.asst-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(105, 183, 255, 0.28);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--asst-accent), var(--asst-primary));
    color: #071024;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.asst-send:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(105, 183, 255, 0.2);
}

.asst-send:disabled,
.asst-input:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.asst-footnote {
    color: rgba(221, 230, 255, 0.52);
    font-size: 0.72rem;
}

@keyframes asstPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.72; }
}

@keyframes asstTyping {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 640px) {
    .genasstai-asst-widget,
    .genasstai-asst-widget[data-position="left"] {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .asst-launcher {
        display: flex;
        width: 56px;
        height: 56px;
        min-height: 56px;
        justify-content: center;
        padding: 0;
        margin-left: auto;
    }

    .asst-launcher-copy {
        display: none;
    }

    .asst-panel,
    .genasstai-asst-widget[data-position="left"] .asst-panel {
        left: 0;
        right: 0;
        width: 100%;
        height: min(720px, calc(100vh - 86px));
        border-radius: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .genasstai-asst-widget *,
    .genasstai-asst-widget *::before,
    .genasstai-asst-widget *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
