.desktop-assistant-btn {
    position: relative;
    z-index: 99;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 16px 0 14px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(120deg, #6e2cff 0%, #4a51ff 34%, #2c86ff 70%, #7d35ff 100%);
    background-size: 180% 180%;
    color: #ffffff;
    font-family: var(--main-font);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    animation: headerAssistantShift 6s ease-in-out infinite;
    overflow: hidden;
}

.desktop-assistant-btn--icon {
    min-width: 42px;
    width: 42px;
    padding: 0;
    justify-content: center;
    gap: 0;
}

.desktop-assistant-btn::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
    pointer-events: none;
}

.desktop-assistant-btn:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.desktop-assistant-icon,
.desktop-assistant-divider,
.desktop-assistant-label {
    position: relative;
    z-index: 1;
}

.desktop-assistant-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.desktop-assistant-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.36);
}

.desktop-assistant-label {
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.assistant-cta-banner {
    position: fixed;
    left: var(--assistant-cta-left, 16px);
    top: var(--assistant-cta-top, 80px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 240px;
    max-width: 280px;
    padding: 12px 14px;
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}

.assistant-cta-banner[hidden] {
    display: none !important;
}

.assistant-cta-focus-target {
    position: relative;
    z-index: 99;
}

.assistant-cta-spotlight {
    position: fixed;
    inset: 0;
    background: rgba(9, 12, 18, 0.5);
    opacity: 0;
    transition: opacity 0.28s ease;
    z-index: 9998;
    pointer-events: none;
}

.assistant-cta-spotlight.is-visible {
    opacity: 1;
}

.assistant-cta-banner.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}

.assistant-cta-banner--mobile.is-visible {
    transform: translateX(-50%) translateY(0);
}

.assistant-cta-banner strong {
    font-size: 12px;
    line-height: 1.2;
}

.assistant-cta-banner span {
    color: #5f6b7c;
    font-size: 12px;
    line-height: 1.35;
}

.assistant-cta-banner::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-right: 1px solid rgba(17, 24, 39, 0.1);
    border-bottom: 1px solid rgba(17, 24, 39, 0.1);
    left: var(--assistant-cta-arrow-left, 56px);
    top: -9px;
    transform: rotate(225deg);
}

.assistant-cta-banner--desktop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
}

.assistant-cta-banner--desktop::after {
    right: auto;
}

.assistant-cta-banner--mobile {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    top: auto;
    transform: translateX(-50%) translateY(-8px);
    right: auto;
}

.assistant-cta-banner--mobile::after {
    left: 50%;
    top: auto;
    bottom: -9px;
    transform: translateX(-50%) rotate(45deg);
}

.assistant-cta-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111111;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.assistant-overlay {
    display: none !important;
}

html.is-assistant-open {
    padding-left: 0;
    box-sizing: border-box;
}

body.is-assistant-open {
    overflow-x: visible;
    width: auto;
    transition: none;
}

.assistant-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(500px, 100vw);
    height: var(--assistant-viewport-height);
    max-height: var(--assistant-viewport-height);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-left: 1px solid #e5e5e5;
    box-shadow: -16px 0 34px rgba(10, 10, 10, 0.12);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    z-index: 270;
    overflow: hidden;
}

.assistant-drawer.is-loading .assistant-drawer-body,
.assistant-drawer.is-loading .assistant-form {
    user-select: none;
}

.assistant-drawer.is-open {
    transform: translateX(0);
}

.assistant-drawer-head {
    min-height: 60px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ececec;
}

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

.assistant-drawer-head strong {
    font-size: 16px;
    font-weight: 700;
    color: #111111;
}

.assistant-drawer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6f3cff, #2b7cff);
    color: #ffffff;
    flex: 0 0 auto;
    box-shadow: 0 10px 24px rgba(73, 52, 180, 0.24);
}

.assistant-drawer-titlebox {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.assistant-drawer-titlebox span {
    font-size: 12px;
    color: var(--main-font-p-color);
}

.assistant-drawer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.assistant-drawer-clear {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #111111;
    font: 600 12px/1 var(--main-font);
    cursor: pointer;
}

.assistant-drawer-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    background: #f6f6f6;
    color: #111111;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.assistant-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 14px 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.assistant-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assistant-message {
    display: flex;
}

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

.assistant-message.is-admin {
    justify-content: flex-start;
}

.assistant-message-bubble {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 16px;
    background: #f4f5f7;
    color: #101114;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.assistant-message-bubble.is-rich {
    white-space: normal;
}

.assistant-message-bubble.is-rich p {
    margin: 0;
}

.assistant-message-bubble.is-rich p + p,
.assistant-message-bubble.is-rich p + ul,
.assistant-message-bubble.is-rich p + ol,
.assistant-message-bubble.is-rich ul + p,
.assistant-message-bubble.is-rich ol + p,
.assistant-message-bubble.is-rich ul + ul,
.assistant-message-bubble.is-rich ol + ol,
.assistant-message-bubble.is-rich ul + ol,
.assistant-message-bubble.is-rich ol + ul {
    margin-top: 8px;
}

.assistant-message-bubble.is-rich ul,
.assistant-message-bubble.is-rich ol {
    width: auto;
    margin: 0;
    padding-left: 18px;
    display: block;
}

.assistant-message-bubble.is-rich li {
    list-style: initial;
    padding: 0;
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 400;
}

.assistant-message-bubble.is-rich ol li {
    list-style: decimal;
}

.assistant-message-bubble.is-rich strong {
    font-weight: 700;
}

.assistant-message-bubble.is-rich em {
    font-style: italic;
}

.assistant-message-bubble.is-rich code {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(17, 17, 17, 0.08);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.4;
}

.assistant-message.is-user .assistant-message-bubble.is-rich code,
.assistant-message.is-admin .assistant-message-bubble.is-rich code {
    background: rgba(255, 255, 255, 0.18);
}

.assistant-message.has-products .assistant-message-bubble {
    max-width: 100%;
}

.assistant-message.is-user .assistant-message-bubble {
    background: linear-gradient(135deg, rgba(110, 44, 255, 0.92), rgba(44, 134, 255, 0.92));
    color: #ffffff;
}

.assistant-message.is-admin .assistant-message-bubble {
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    color: #ffffff;
}

.assistant-message.is-loading .assistant-message-bubble {
    color: var(--main-font-p-color);
    min-width: 62px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.assistant-message-audio {
    display: block;
    width: min(280px, 100%);
    margin-top: 10px;
}

.assistant-message-image-link {
    display: block;
    margin-top: 10px;
}

.assistant-message-image {
    display: block;
    width: min(280px, 100%);
    max-height: 340px;
    object-fit: cover;
    border-radius: 14px;
    background: #f3f4f6;
}

.assistant-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.5);
    animation: assistantTypingPulse 1s ease-in-out infinite;
}

.assistant-typing-dot:nth-child(2) {
    animation-delay: 0.14s;
}

.assistant-typing-dot:nth-child(3) {
    animation-delay: 0.28s;
}

@keyframes assistantTypingPulse {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    40% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

.assistant-product-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.assistant-product-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.assistant-product-card-link {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.assistant-product-card-media {
    display: block;
    width: 58px;
    height: 72px;
    border-radius: 10px;
    background: #f3f3f5 center/cover no-repeat;
}

.assistant-product-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.assistant-product-card-title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    color: #111111;
}

.assistant-product-card-brand,
.assistant-product-card-details {
    font-size: 12px;
    line-height: 1.35;
    color: var(--main-font-p-color);
}

.assistant-product-card-action {
    align-self: center;
    min-height: 38px;
    padding: 0 14px 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    background: linear-gradient(180deg, #4da3ff 0%, #1f7bf2 100%);
    color: #ffffff;
    font-size: 12px;
    font-family: var(--main-font);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.assistant-product-card-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.3);
    filter: saturate(1.05);
}

.assistant-product-card-action-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
}

.assistant-product-card-action-icon svg {
    width: 14px;
    height: 14px;
}

.assistant-product-card-action-label {
    line-height: 1;
}

.assistant-product-card-action:disabled {
    opacity: 0.65;
    cursor: default;
    transform: none;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

@media (max-width: 640px) {
    .assistant-product-card {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .assistant-product-card-action {
        margin-top: 2px;
    }
}

.assistant-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.assistant-suggestion-chip {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #ececf1;
    border-radius: 999px;
    background: #ffffff;
    color: #111111;
    font-size: 12px;
    font-family: var(--main-font);
    font-weight: 600;
    cursor: pointer;
}

.assistant-message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.assistant-message-action {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #111111;
    font-size: 12px;
    font-family: var(--main-font);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.assistant-message-action:hover {
    transform: translateY(-1px);
    border-color: rgba(17, 17, 17, 0.14);
    box-shadow: 0 8px 18px rgba(17, 17, 17, 0.08);
}

.assistant-message.is-user .assistant-message-action,
.assistant-message.is-admin .assistant-message-action {
    background: rgba(255, 255, 255, 0.16);
    color: inherit;
    border-color: rgba(255, 255, 255, 0.24);
}

.assistant-form {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 14px;
    border-top: 1px solid #ececf1;
    background: #ffffff;
}

.assistant-attach {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border: 1px solid #dfe2e8;
    border-radius: 14px;
    background: #ffffff;
    color: #111111;
    font: 600 22px/1 var(--main-font);
    cursor: pointer;
}

.assistant-attach.is-disabled,
.assistant-attach:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.assistant-loading-overlay {
    position: absolute;
    inset: 60px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(4px);
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.assistant-loading-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.assistant-loading-panel {
    width: min(320px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 18px 16px;
    border: 1px solid #ececf1;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 32px rgba(17, 24, 39, 0.12);
}

.assistant-loading-panel strong {
    font-size: 16px;
    line-height: 1.25;
    color: #101114;
}

.assistant-loading-panel span {
    font-size: 12px;
    line-height: 1.45;
    color: var(--main-font-p-color);
}

.assistant-loading-animation {
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.assistant-loading-animation:empty::before {
    content: "";
    width: 92px;
    height: 92px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(110, 44, 255, 0.16), rgba(44, 134, 255, 0.16));
    box-shadow: inset 0 0 0 1px rgba(110, 44, 255, 0.12);
    animation: assistantLoadingFallbackPulse 1.2s ease-in-out infinite;
}

@keyframes assistantLoadingFallbackPulse {
    0%,
    100% {
        transform: scale(0.94);
        opacity: 0.55;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}

.assistant-form-field {
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.assistant-input {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 11px 14px;
    border: 1px solid #dfe2e8;
    border-radius: 14px;
    box-sizing: border-box;
    resize: none;
    font: 14px/1.4 var(--main-font);
    color: #111111;
    overflow: hidden;
}

.assistant-input:focus {
    outline: 0;
    border-color: #1d6fe8;
    box-shadow: 0 0 0 1px #1d6fe8;
}

.assistant-send {
    min-width: 88px;
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 14px;
    box-sizing: border-box;
    background: #111111;
    color: #ffffff;
    font: 600 13px/1 var(--main-font);
    cursor: pointer;
    align-self: center;
}

.assistant-send:disabled {
    opacity: 0.55;
    cursor: wait;
}

.assistant-status {
    position: fixed;
    right: 18px;
    bottom: 18px;
    max-width: 280px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(17, 17, 17, 0.92);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.35;
    z-index: 280;
}

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

@keyframes headerAssistantShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@media (max-width: 980px) {
    .assistant-cta-banner--desktop {
        display: none;
    }

    html.is-assistant-open {
        padding-left: 0;
    }

    body.is-assistant-open {
        width: auto;
    }

    .assistant-drawer {
        width: min(100vw, 500px);
        height: var(--assistant-viewport-height);
        max-height: var(--assistant-viewport-height);
    }

    .assistant-drawer-head {
        padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
        align-items: flex-start;
    }

    .assistant-drawer-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .assistant-form {
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .assistant-loading-overlay {
        inset: calc(60px + env(safe-area-inset-top)) 0 0;
        padding: 16px;
    }

    .assistant-loading-panel {
        width: min(290px, 100%);
        border-radius: 16px;
    }

    .assistant-loading-animation {
        width: 136px;
        height: 136px;
    }
}
