:root {
    --assistant-primary: #2d629a;
    --assistant-primary-dark: #2d629a;
    --assistant-panel-bg: #ffffff;
    --assistant-page-bg: #f5f6fa;
    --assistant-text: #1e2230;
    --assistant-muted: #72788a;
    --assistant-border: #e5e7ef;
    --assistant-user-bg: #2d629a;
    --assistant-user-text: #ffffff;
    --assistant-bot-bg: #f0f2f7;
    --assistant-shadow: 0 24px 70px rgba(24, 20, 48, 0.22);
}
.assistant-widget,
.assistant-widget * {
    box-sizing: border-box;
}

.assistant-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

/* Floating button */

.assistant-fab {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        var(--assistant-primary),
        var(--assistant-primary-dark)
    );
    box-shadow: 0 14px 34px rgba(79, 39, 216, 0.32);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}

.assistant-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(79, 39, 216, 0.4);
}

.assistant-fab:focus-visible,
.assistant-panel button:focus-visible,
.assistant-panel textarea:focus-visible {
    outline: 3px solid rgba(108, 60, 255, 0.25);
    outline-offset: 2px;
}

.assistant-fab__icon {
    font-size: 22px;
	max-width: 34px;
}

/* Panel */

.assistant-panel {
    position: absolute;
    right: 0;
    bottom: 72px;

    width: min(400px, calc(100vw - 32px));
    height: min(650px, calc(80vh - 120px));
    min-height: 420px;

    display: flex;
    flex-direction: column;

    overflow: hidden;
    border: 1px solid rgba(229, 231, 239, 0.9);
    border-radius: 22px;
    background: var(--assistant-panel-bg);
    box-shadow: var(--assistant-shadow);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(16px) scale(0.98);
    transform-origin: bottom right;

    transition:
        opacity 180ms ease,
        transform 180ms ease,
        visibility 180ms ease;
}

.assistant-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Header */

.assistant-panel__header {
    flex: 0 0 auto;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        var(--assistant-primary),
        var(--assistant-primary-dark)
    );
}

.assistant-panel__identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.assistant-panel__avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    font-size: 24px;
}

.assistant-panel__header h3 {
    margin: 0 0 4px;
    color: inherit;
    font-size: 17px;
    line-height: 1.2;
}

.assistant-panel__header p {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
}

.assistant-panel__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #61e6a7;
    box-shadow: 0 0 0 3px rgba(97, 230, 167, 0.18);
}

.assistant-panel__actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.assistant-panel__actions button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    background: transparent;
    cursor: pointer;
    font-size: 23px;
    line-height: 1;
}

.assistant-panel__actions button:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Flex parents need min-height: 0 for scrolling to work */

.assistant-panel__body {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    background: var(--assistant-page-bg);
}

/* Scrollable area */

.assistant-panel__messages {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
    padding: 20px 16px 12px;
}

.assistant-panel__messages::-webkit-scrollbar {
    width: 8px;
}

.assistant-panel__messages::-webkit-scrollbar-track {
    background: transparent;
}

.assistant-panel__messages::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(92, 98, 116, 0.32);
    background-clip: padding-box;
}

/* Messages */

.assistant-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 14px;
}

.assistant-message--user {
    justify-content: flex-end;
}

.assistant-message__avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #e5e0ff;
    font-size: 16px;
}

.assistant-message__bubble {
    max-width: 84%;
    padding: 11px 13px;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(30, 34, 48, 0.06);
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.assistant-message--assistant .assistant-message__bubble {
    color: var(--assistant-text);
    border-bottom-left-radius: 5px;
}

.assistant-message--user .assistant-message__bubble {
    color: var(--assistant-user-text);
    background: var(--assistant-user-bg);
    border-bottom-right-radius: 5px;
}

.assistant-message__content > :first-child {
    margin-top: 0;
}

.assistant-message__content > :last-child {
    margin-bottom: 0;
}

.assistant-message__content p {
    margin: 0 0 10px;
}

.assistant-message__content ul,
.assistant-message__content ol {
    margin: 8px 0 10px;
    padding-left: 21px;
}

.assistant-message__content li + li {
    margin-top: 5px;
}

.assistant-message__content h1,
.assistant-message__content h2,
.assistant-message__content h3,
.assistant-message__content h4 {
    margin: 14px 0 7px;
    color: inherit;
    line-height: 1.3;
}

.assistant-message__content h1 {
    font-size: 18px;
}

.assistant-message__content h2 {
    font-size: 16px;
}

.assistant-message__content h3,
.assistant-message__content h4 {
    font-size: 15px;
}

.assistant-message__content strong {
    font-weight: 750;
}

.assistant-message__content a {
    color: var(--assistant-primary-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.assistant-message__content blockquote {
    margin: 10px 0;
    padding: 8px 11px;
    border-left: 3px solid var(--assistant-primary);
    border-radius: 0 8px 8px 0;
    background: rgba(108, 60, 255, 0.07);
}

.assistant-message__content code {
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(30, 34, 48, 0.09);
    font-family: Consolas, Monaco, monospace;
    font-size: 0.9em;
}

.assistant-message__content pre {
    max-width: 100%;
    overflow-x: auto;
    margin: 10px 0;
    padding: 11px;
    border-radius: 10px;
    color: #f4f4f8;
    background: #242633;
}

.assistant-message__content pre code {
    padding: 0;
    background: transparent;
}

.assistant-message__time {
    display: block;
    margin-top: 6px;
    font-size: 10px;
    opacity: 0.62;
}

/* Typing indicator */

.assistant-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 20px;
}

.assistant-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--assistant-muted);
    animation: assistantTyping 1.15s infinite ease-in-out;
}

.assistant-typing span:nth-child(2) {
    animation-delay: 150ms;
}

.assistant-typing span:nth-child(3) {
    animation-delay: 300ms;
}

@keyframes assistantTyping {
    0%,
    60%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Composer */

.assistant-panel__composer {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 9px;
    padding: 12px 14px 8px;
    border-top: 1px solid var(--assistant-border);
    background: #ffffff;
}

.assistant-panel__input {
    width: 100%;
    height: 42px;
    
    resize: none;
    overflow-y: auto;
    padding: 11px 13px;
    border: 1px solid var(--assistant-border);
    border-radius: 14px;
    color: var(--assistant-text);
    background: #fafbfc;
    font: inherit;
    font-size: 14px;
    line-height: 1.45;
	margin-bottom:0;
}

.assistant-panel__input:focus {
    border-color: var(--assistant-primary);
    background: #ffffff;
}

.assistant-panel__send {
    min-width: 91px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border: 0;
    border-radius: 14px;
    color: #ffffff;
    background: var(--assistant-primary);
    cursor: pointer;
    font-weight: 700;
}

.assistant-panel__send:hover:not(:disabled) {
    background: var(--assistant-primary-dark);
}

.assistant-panel__send:disabled,
.assistant-panel__input:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.assistant-panel__send-icon {
    font-size: 13px;
}

.assistant-panel__hint {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 16px 10px;
    color: var(--assistant-muted);
    background: #ffffff;
    text-align: center;
    font-size: 10px;
}

/* Mobile */

@media (max-width: 520px) {
    .assistant-widget {

    z-index: 9999 !important;
        inset: 10px;

        min-height: 0;
        border-radius: 18px;
        transform-origin: center;
    	width:auto;
		height:calc(100vh);
		height: 100vh;   /* fallback for old browsers */
		height: 100dvh;  /* overridden if supported */
		bottom: 84px;
		
	}
	.assistant-panel{
	height:calc(100vh - 145px);
		height: calc(100dvh - 145px);;  /* overridden if supported */
		bottom: 94px;
	}

    .assistant-panel__header {
        min-height: 76px;
    }

    .assistant-fab__label {
        display: none;
    }

    .assistant-fab {
        width: 58px;
        min-width: 58px;
		   position: fixed;
    right: 15px !important;
    bottom: 15px !important;
    z-index: 9999 !important;
        padding: 0;
    }

    .assistant-message__bubble {
        max-width: 88%;
    }

    .assistant-panel__send {
        min-width: 46px;
        width: 46px;
        padding: 0;
    }

    .assistant-panel__send-label {
        display: none;
    }

	.assistant-fab__label {
		display: none;
	}
}
@media (prefers-reduced-motion: reduce) {
    .assistant-panel,
    .assistant-fab,
    .assistant-panel__messages {
        scroll-behavior: auto;
        transition: none;
    }

    .assistant-typing span {
        animation: none;
    }
}