.sgce-ai {
    --sgce-ai-black: #181818;
    --sgce-ai-red: #a91f36;
    position: fixed;
    right: 20px;
    bottom: 86px;
    z-index: 2147483000;
    font-family: inherit;
}

.sgce-ai [hidden] {
    display: none !important;
}

.sgce-ai--fallback {
    right: auto;
    left: 20px;
}

.sgce-ai__launcher-shell {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
    pointer-events: auto !important;
}

.sgce-ai__launcher-shell button,
.sgce-ai__panel-minimize {
    box-sizing: border-box;
    margin: 0 !important;
    min-height: 0;
    text-transform: none;
}

.sgce-ai__launcher-shell--floating {
    position: relative;
    z-index: 2147483646;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--sgce-ai-black);
}

.sgce-ai__launcher-shell--floating .sgce-ai__launcher-copy,
.sgce-ai__launcher-shell--floating .sgce-ai__launcher-actions {
    display: none;
}

.sgce-ai__launcher-shell--hero {
    position: fixed;
    z-index: 2147483646;
    top: var(--sgce-ai-hero-top, 50%);
    left: var(--sgce-ai-hero-left, 50%);
    width: var(--sgce-ai-hero-width, 480px);
    height: 42px;
    min-height: 42px;
    padding: 2px 3px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, .95);
    border-radius: 24px;
    background: rgba(20, 20, 20, var(--sgce-ai-launcher-opacity, .72));
    backdrop-filter: blur(6px);
    visibility: hidden;
    opacity: 0;
    transition: opacity .18s ease;
}

.sgce-ai__launcher-shell--hero.is-hero-visible {
    visibility: visible;
    opacity: 1;
}

.sgce-ai__launcher {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.sgce-ai__launcher-icon {
    display: inline-flex;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    font-size: 12px;
}

.sgce-ai__launcher-icon img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.sgce-ai__launcher-copy {
    overflow: hidden;
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sgce-ai__launcher-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 2px;
}

.sgce-ai__launcher-minimize {
    position: relative;
    display: inline-flex;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
}

.sgce-ai__launcher-minimize::before,
.sgce-ai__panel-minimize::before {
    display: block;
    width: 11px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: "";
}

.sgce-ai__launcher-shell.is-minimized {
    position: fixed;
    top: auto;
    right: 18px;
    bottom: 220px;
    left: auto;
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    transform: none;
    border: 2px solid #fff;
    border-radius: 50%;
    visibility: visible;
    opacity: 1;
    background: rgba(20, 20, 20, var(--sgce-ai-launcher-opacity, .72));
    touch-action: none;
    user-select: none;
}

.sgce-ai__launcher-shell.is-minimized .sgce-ai__launcher {
    width: 34px;
    height: 34px;
    justify-content: center;
}

.sgce-ai__launcher-shell.is-minimized .sgce-ai__launcher-copy,
.sgce-ai__launcher-shell.is-minimized .sgce-ai__launcher-actions {
    display: none;
}

.sgce-ai__launcher-shell.is-minimized .sgce-ai__launcher-icon {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    border: 0;
    font-size: 10px;
}

.sgce-ai__launcher-shell.is-minimized .sgce-ai__launcher-icon img {
    width: 24px;
    height: 24px;
}

.sgce-ai__launcher-tooltip {
    display: none;
}

.sgce-ai__launcher-shell.is-minimized .sgce-ai__launcher-tooltip {
    position: absolute;
    top: 50%;
    right: 48px;
    display: block;
    width: max-content;
    max-width: min(320px, calc(100vw - 80px));
    padding: 7px 10px;
    transform: translateY(-50%);
    border-radius: 6px;
    background: rgba(24, 24, 24, .94);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
    transition: opacity .15s ease, visibility .15s ease;
}

.sgce-ai__launcher-shell.is-minimized:hover .sgce-ai__launcher-tooltip,
.sgce-ai__launcher-shell.is-minimized:focus-within .sgce-ai__launcher-tooltip {
    opacity: 1;
    visibility: visible;
}

.sgce-ai__panel {
    position: fixed;
    display: flex;
    flex-direction: column;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(720px, calc(100vw - 40px));
    height: min(560px, calc(100vh - 40px));
    min-width: 340px;
    min-height: 420px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    transform: translate(-50%, -50%);
    border: 1px solid #e4e4e4;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 54px rgba(0, 0, 0, .2);
    pointer-events: auto;
}

.sgce-ai__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 10px 14px;
    background: var(--sgce-ai-header-bg, var(--sgce-ai-black));
    color: var(--sgce-ai-header-text, #fff);
    cursor: move;
    touch-action: none;
    user-select: none;
}

.sgce-ai__header-icon {
    display: inline-flex;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    margin-right: 10px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}

.sgce-ai__header-icon img {
    display: block;
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.sgce-ai__header-copy {
    flex: 1;
    min-width: 0;
}

.sgce-ai__header strong {
    display: block;
}

.sgce-ai__languages {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-top: 2px;
    color: #ccc;
    font-size: 11px;
}

.sgce-ai__languages button {
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    color: #aaa;
    font: inherit;
    cursor: pointer;
    user-select: auto;
}

.sgce-ai__languages button:hover,
.sgce-ai__languages button.is-active {
    border-bottom-color: #fff;
    color: #fff;
}

.sgce-ai__window-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.sgce-ai__panel-minimize {
    display: inline-flex;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin: 0 !important;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
}

.sgce-ai__messages {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding: 14px;
    overflow-y: auto;
    background: var(--sgce-ai-area-bg, #f7f7f7);
}

.sgce-ai__message {
    width: fit-content;
    max-width: 88%;
    margin-bottom: 10px;
    padding: 9px 11px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.sgce-ai__message--assistant,
.sgce-ai__message--loading {
    border: 1px solid #e4e4e4;
    background: var(--sgce-ai-assistant-bg, #fff);
    color: var(--sgce-ai-assistant-text, #222);
}

.sgce-ai__message--customer {
    margin-left: auto;
    background: var(--sgce-ai-customer-bg, var(--sgce-ai-black));
    color: var(--sgce-ai-customer-text, #fff);
}

.sgce-ai__products {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.sgce-ai__product {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.sgce-ai__product img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.sgce-ai__product span,
.sgce-ai__product strong,
.sgce-ai__product small {
    display: block;
}

.sgce-ai__product strong {
    font-size: 12px;
    line-height: 1.35;
}

.sgce-ai__product small {
    margin-top: 3px;
    color: var(--sgce-ai-accent, var(--sgce-ai-red));
    font-weight: 700;
}

.sgce-ai__form {
    position: relative;
    display: flex;
    align-items: flex-end;
    flex: 0 0 auto;
    min-height: 68px;
    padding: 10px 12px;
    border-top: 1px solid #e4e4e4;
    background: #fff;
}

.sgce-ai__form textarea {
    display: block;
    width: 100%;
    min-height: 46px;
    max-height: 132px;
    margin: 0;
    padding: 12px 56px 12px 16px;
    resize: none;
    overflow-y: auto;
    border: 1px solid #d9d9d9;
    border-radius: 24px;
    background: #f4f4f4;
    box-shadow: none;
    font: inherit;
    font-size: 14px;
    line-height: 20px;
}

.sgce-ai__form textarea:focus {
    border-color: #c8c8c8;
    outline: 0;
    box-shadow: none;
}

.sgce-ai__form button {
    position: absolute;
    top: 50%;
    right: 20px;
    bottom: auto;
    display: inline-flex;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    border-radius: 50%;
    background: var(--sgce-ai-accent, var(--sgce-ai-red));
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity .18s ease, transform .18s ease;
}

.sgce-ai__form button:hover:not(:disabled) {
    transform: translateY(-50%) scale(1.05);
}

.sgce-ai__form button:disabled {
    opacity: .32;
    cursor: default;
}

.sgce-ai__form button svg {
    display: block;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sgce-ai__notice {
    flex: 0 0 32px;
    height: 32px;
    padding: 6px 10px;
    background: #fff;
    color: #777;
    font-size: 9px;
    text-align: center;
}

.sgce-ai__resize-handle {
    position: absolute;
    z-index: 4;
    display: block;
    touch-action: none;
}

.sgce-ai__resize-handle--n,
.sgce-ai__resize-handle--s {
    right: 12px;
    left: 12px;
    height: 9px;
    cursor: ns-resize;
}

.sgce-ai__resize-handle--n {
    top: 0;
}

.sgce-ai__resize-handle--s {
    bottom: 0;
}

.sgce-ai__resize-handle--e,
.sgce-ai__resize-handle--w {
    top: 12px;
    bottom: 12px;
    width: 9px;
    cursor: ew-resize;
}

.sgce-ai__resize-handle--e {
    right: 0;
}

.sgce-ai__resize-handle--w {
    left: 0;
}

.sgce-ai__resize-handle--ne,
.sgce-ai__resize-handle--se,
.sgce-ai__resize-handle--sw,
.sgce-ai__resize-handle--nw {
    width: 16px;
    height: 16px;
}

.sgce-ai__resize-handle--ne {
    top: 0;
    right: 0;
    cursor: nesw-resize;
}

.sgce-ai__resize-handle--se {
    right: 0;
    bottom: 0;
    cursor: nwse-resize;
}

.sgce-ai__resize-handle--sw {
    bottom: 0;
    left: 0;
    cursor: nesw-resize;
}

.sgce-ai__resize-handle--nw {
    top: 0;
    left: 0;
    cursor: nwse-resize;
}

body.sgce-ai-is-interacting {
    cursor: default;
    user-select: none;
}

@media (max-width: 549px) {
    .sgce-ai {
        right: 12px;
        bottom: 74px;
    }

    .sgce-ai__panel {
        position: fixed;
        top: 12px !important;
        right: 8px;
        bottom: 12px;
        left: 8px;
        width: auto;
        height: auto;
        min-width: 0;
        min-height: 360px;
        max-width: none;
        max-height: calc(100vh - 24px);
        transform: none !important;
    }

    .sgce-ai__launcher-shell--hero {
        width: min(360px, calc(100% - 24px));
        height: 42px;
        min-height: 42px;
    }

    .sgce-ai__launcher-shell.is-minimized {
        right: 12px;
        bottom: 218px;
    }

    .sgce-ai__resize-handle {
        display: none;
    }

    .sgce-ai__header {
        cursor: default;
    }

}

/* SGCE_AI_SUPPORT_STACK_061_START */
/* Align the compact AI launcher with Support Hub and keep it above Zalo. */
.sgce-ai {
    right: 18px;
    bottom: 220px;
}

.sgce-ai__launcher-shell--floating {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border: 2px solid #fff;
    background: rgba(20, 20, 20, var(--sgce-ai-launcher-opacity, .72));
}

.sgce-ai__launcher-shell--floating .sgce-ai__launcher {
    width: 34px;
    height: 34px;
    justify-content: center;
}

.sgce-ai__launcher-shell--floating .sgce-ai__launcher-icon {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    border: 0;
    font-size: 10px;
}

.sgce-ai__launcher-shell--floating .sgce-ai__launcher-icon img {
    width: 24px;
    height: 24px;
}
/* SGCE_AI_SUPPORT_STACK_061_END */
