.site-assistant,
.site-assistant * {
    box-sizing: border-box;
}

.site-assistant {
    --assistant-orange: #ff7a00;
    --assistant-orange-dark: #e96500;
    --assistant-ink: #1e252f;
    --assistant-muted: #68717d;
    --assistant-line: #e9edf2;
    --assistant-surface: #f7f8fa;
    position: fixed;
    right: 24px;
    bottom: 26px;
    z-index: 9999;
    font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--assistant-ink);
}

.site-assistant button,
.site-assistant textarea {
    font: inherit;
}

.site-assistant button {
    border: 0;
}

.site-assistant-launcher {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 154px;
    min-height: 58px;
    padding: 7px 16px 7px 8px;
    color: #fff;
    background: #222831;
    border-radius: 18px;
    box-shadow: 0 14px 38px rgba(21, 27, 36, .25), 0 2px 8px rgba(21, 27, 36, .12);
    cursor: pointer;
    text-align: left;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.site-assistant-launcher:hover,
.site-assistant-launcher:focus-visible {
    transform: translateY(-2px);
    background: #171c23;
    box-shadow: 0 18px 44px rgba(21, 27, 36, .3), 0 3px 10px rgba(21, 27, 36, .15);
    outline: none;
}

.site-assistant-launcher-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    color: #fff;
    background: var(--assistant-orange);
    border-radius: 14px;
}

.site-assistant-launcher-mark svg,
.site-assistant-welcome-mark svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-assistant-launcher-mark svg circle,
.site-assistant-welcome-mark svg circle {
    fill: currentColor;
    stroke: none;
}

.site-assistant-launcher-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.site-assistant-launcher-copy strong {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: .02em;
}

.site-assistant-launcher-copy small {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, .68);
    font-size: 11px;
    line-height: 1.2;
}

.site-assistant-launcher-copy i {
    width: 6px;
    height: 6px;
    background: #55d88a;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(85, 216, 138, .13);
}

.site-assistant-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(398px, calc(100vw - 32px));
    height: min(680px, calc(100vh - 84px));
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(30, 37, 47, .08);
    border-radius: 22px;
    box-shadow: 0 26px 80px rgba(24, 31, 41, .24), 0 4px 18px rgba(24, 31, 41, .1);
    transform-origin: right bottom;
    animation: site-assistant-open .22s cubic-bezier(.22, .8, .28, 1) both;
}

.site-assistant-panel[hidden],
.site-assistant-contact[hidden] {
    display: none;
}

.site-assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 13px 14px 13px 16px;
    color: #fff;
    background: #222831;
}

.site-assistant-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-assistant-brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #fff;
    background: var(--assistant-orange);
    border-radius: 13px;
    font-size: 18px;
    font-weight: 700;
}

.site-assistant-brand strong {
    display: block;
    font-size: 16px;
    line-height: 1.25;
}

.site-assistant-brand p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, .64);
    font-size: 11px;
    line-height: 1.2;
}

.site-assistant-header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.site-assistant-human-button,
.site-assistant-close {
    color: rgba(255, 255, 255, .78);
    background: transparent;
    cursor: pointer;
}

.site-assistant-human-button {
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, .14) !important;
    border-radius: 10px;
    font-size: 12px;
}

.site-assistant-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}

.site-assistant-human-button:hover,
.site-assistant-human-button:focus-visible,
.site-assistant-close:hover,
.site-assistant-close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .08);
    outline: none;
}

.site-assistant-messages {
    flex: 1;
    min-height: 0;
    padding: 22px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: linear-gradient(180deg, #fff 0, #fbfcfd 100%);
}

.site-assistant-welcome-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 17px;
    color: var(--assistant-orange);
    background: #fff3e8;
    border-radius: 17px;
}

.site-assistant-welcome h2 {
    margin: 0;
    color: var(--assistant-ink);
    font-size: 22px;
    font-weight: 650;
    line-height: 1.3;
}

.site-assistant-welcome > p {
    margin: 8px 0 20px;
    color: var(--assistant-muted);
    font-size: 13px;
    line-height: 1.7;
}

.site-assistant-suggestions {
    display: grid;
    gap: 8px;
}

.site-assistant-suggestions button {
    position: relative;
    width: 100%;
    min-height: 43px;
    padding: 10px 36px 10px 13px;
    color: #3d4652;
    background: var(--assistant-surface);
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.site-assistant-suggestions button::after {
    position: absolute;
    right: 13px;
    top: 50%;
    content: "→";
    color: #a0a8b2;
    transform: translateY(-50%);
}

.site-assistant-suggestions button:hover,
.site-assistant-suggestions button:focus-visible {
    color: var(--assistant-orange-dark);
    background: #fff8f1;
    border-color: #ffd5ad;
    outline: none;
}

.site-assistant-suggestions button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.site-assistant-contact-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 18px;
    padding: 13px 14px;
    color: var(--assistant-ink);
    background: #fff;
    border: 1px solid var(--assistant-line) !important;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
}

.site-assistant-contact-entry span,
.site-assistant-contact-entry strong,
.site-assistant-contact-entry small {
    display: block;
}

.site-assistant-contact-entry strong {
    font-size: 13px;
    font-weight: 600;
}

.site-assistant-contact-entry small {
    margin-top: 3px;
    color: var(--assistant-muted);
    font-size: 11px;
}

.site-assistant-contact-entry i {
    color: var(--assistant-orange);
    font-size: 18px;
    font-style: normal;
}

.site-assistant-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 16px;
}

.site-assistant-message.user {
    align-items: flex-end;
}

.site-assistant-bubble {
    max-width: 88%;
    padding: 11px 13px;
    color: #343d48;
    background: #f0f2f5;
    border-radius: 6px 15px 15px 15px;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.site-assistant-message.user .site-assistant-bubble {
    color: #fff;
    background: var(--assistant-orange);
    border-radius: 15px 6px 15px 15px;
}

.site-assistant-thinking::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 4px;
    margin-left: 5px;
    background: radial-gradient(circle, currentColor 1.5px, transparent 2px) 0 0 / 6px 4px repeat-x;
    animation: site-assistant-thinking .8s linear infinite;
    opacity: .55;
}

.site-assistant-sources {
    display: grid;
    gap: 5px;
    width: 88%;
    margin-top: 8px;
}

.site-assistant-sources a {
    color: #737d89;
    font-size: 11px;
    line-height: 1.45;
    text-decoration: none;
}

.site-assistant-sources a:hover {
    color: var(--assistant-orange-dark);
}

.site-assistant-retry {
    margin-top: 7px;
    padding: 5px 0;
    color: var(--assistant-orange-dark);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
}

.site-assistant-contact {
    position: absolute;
    inset: 72px 0 0;
    z-index: 3;
    padding: 24px 20px;
    overflow-y: auto;
    background: #fff;
    animation: site-assistant-contact-open .2s ease both;
}

.site-assistant-contact-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.site-assistant-contact-heading span {
    color: var(--assistant-orange-dark);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
}

.site-assistant-contact-heading h2 {
    margin: 5px 0 0;
    color: var(--assistant-ink);
    font-size: 22px;
    font-weight: 650;
}

.site-assistant-contact-heading button {
    width: 34px;
    height: 34px;
    color: #7b8490;
    background: var(--assistant-surface);
    border-radius: 10px;
    cursor: pointer;
    font-size: 22px;
}

.site-assistant-advisor {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
    padding: 16px 0;
    border-top: 1px solid var(--assistant-line);
    border-bottom: 1px solid var(--assistant-line);
}

.site-assistant-advisor-avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    color: #fff;
    background: #222831;
    border-radius: 15px;
    font-size: 17px;
    font-weight: 600;
}

.site-assistant-advisor strong {
    display: block;
    font-size: 15px;
}

.site-assistant-advisor p {
    margin: 4px 0 0;
    color: var(--assistant-muted);
    font-size: 12px;
}

.site-assistant-contact-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 16px;
}

.site-assistant-contact-actions a {
    flex: 1;
    min-width: 0;
    padding: 13px 14px;
    color: var(--assistant-ink);
    background: var(--assistant-surface);
    border-radius: 12px;
    text-decoration: none;
}

.site-assistant-contact-actions a small,
.site-assistant-contact-actions a strong {
    display: block;
}

.site-assistant-contact-actions a small {
    color: var(--assistant-muted);
    font-size: 10px;
}

.site-assistant-contact-actions a strong {
    margin-top: 3px;
    font-size: 15px;
}

.site-assistant-contact-actions button {
    min-height: 61px;
    padding: 0 14px;
    color: #fff;
    background: var(--assistant-orange);
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
}

.site-assistant-company-phone {
    margin-top: 9px;
}

.site-assistant-qr {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--assistant-line);
    text-align: center;
}

.site-assistant-qr img {
    width: 118px;
    height: 118px;
    padding: 5px;
    background: #fff;
    border: 1px solid var(--assistant-line);
    border-radius: 12px;
}

.site-assistant-qr p {
    margin: 8px 0 0;
    color: var(--assistant-muted);
    font-size: 11px;
}

.site-assistant-composer {
    padding: 11px 13px 12px;
    background: #fff;
    border-top: 1px solid var(--assistant-line);
}

.site-assistant-input-shell {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-height: 48px;
    padding: 7px 7px 7px 12px;
    background: var(--assistant-surface);
    border: 1px solid transparent;
    border-radius: 14px;
    transition: border-color .16s ease, background .16s ease;
}

.site-assistant-input-shell:focus-within {
    background: #fff;
    border-color: #ffc58f;
}

.site-assistant-input-shell textarea {
    flex: 1;
    max-height: 92px;
    min-height: 32px;
    padding: 6px 0;
    resize: none;
    overflow-y: auto;
    color: var(--assistant-ink);
    background: transparent;
    border: 0;
    outline: none;
    font-size: 13px;
    line-height: 1.5;
}

.site-assistant-input-shell textarea::placeholder {
    color: #9aa2ac;
}

.site-assistant-send {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    color: #fff;
    background: var(--assistant-orange);
    border-radius: 10px;
    cursor: pointer;
}

.site-assistant-send:disabled {
    color: #b4bac2;
    background: #e6e9ed;
    cursor: not-allowed;
}

.site-assistant-send svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-assistant-stop {
    height: 34px;
    padding: 0 10px;
    color: #505967;
    background: #e6e9ed;
    border-radius: 10px;
    cursor: pointer;
    font-size: 11px;
}

.site-assistant-composer > p {
    margin: 7px 2px 0;
    color: #9aa1aa;
    font-size: 9px;
    line-height: 1.45;
}

@keyframes site-assistant-open {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes site-assistant-contact-open {
    from { opacity: 0; transform: translateX(14px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes site-assistant-thinking {
    from { transform: translateX(0); }
    to { transform: translateX(6px); }
}

@media (max-width: 600px) {
    .site-assistant {
        right: 14px;
        bottom: 16px;
    }

    .site-assistant-launcher {
        min-width: 0;
        min-height: 52px;
        padding: 5px;
        border-radius: 17px;
    }

    .site-assistant-launcher-mark {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .site-assistant-launcher-copy {
        display: none;
    }

    .site-assistant-panel {
        position: fixed;
        right: 8px;
        bottom: 8px;
        width: calc(100vw - 16px);
        height: min(720px, calc(100dvh - 16px));
        border-radius: 20px;
    }

    .site-assistant-messages {
        padding: 20px 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-assistant-panel,
    .site-assistant-contact {
        animation: none;
    }

    .site-assistant-launcher {
        transition: none;
    }
}
