/* LogicxOne Chat public styles are intentionally scoped to the widget wrapper. */
.lxone-chat-widget,
.lxone-chat-widget * {
    box-sizing: border-box;
}

.lxone-chat-widget {
    --lxone-primary: #1a3a5c;
    --lxone-accent: #0f6e56;
    --lxone-header: #1a3a5c;
    --lxone-bot-bubble: #ffffff;
    --lxone-user-bubble: #1a3a5c;
    --lxone-radius: 24px;
    --lxone-window-width: 390px;
    --lxone-window-height: 620px;
    --lxone-surface: #ffffff;
    --lxone-text: #172033;
    --lxone-muted: #667085;
    --lxone-border: #e6eaf0;
    --lxone-soft: #f4f7fb;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--lxone-text);
}

.lxone-chat-widget--bottom_left {
    right: auto;
    left: 24px;
}

.lxone-chat-widget__launcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 64px;
    height: 64px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--lxone-header), var(--lxone-accent));
    color: #ffffff;
    box-shadow: 0 18px 46px rgba(26, 58, 92, 0.28);
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.lxone-chat-widget__launcher:hover,
.lxone-chat-widget__launcher:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 22px 54px rgba(26, 58, 92, 0.34);
    outline: none;
}

.lxone-chat-widget__launcher-icon {
    display: inline-flex;
    font-size: 23px;
    line-height: 1;
}

.lxone-chat-widget__launcher-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.lxone-chat-widget__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.lxone-chat-widget__panel {
    position: absolute;
    right: 0;
    bottom: 82px;
    display: flex;
    flex-direction: column;
    width: min(var(--lxone-window-width), calc(100vw - 32px));
    height: min(var(--lxone-window-height), calc(100vh - 118px));
    min-height: 430px;
    overflow: hidden;
    border: 1px solid rgba(230, 234, 240, 0.92);
    border-radius: var(--lxone-radius);
    background: var(--lxone-surface);
    box-shadow: 0 28px 80px rgba(23, 32, 51, 0.24);
    transform-origin: bottom right;
    animation: lxone-chat-pop 180ms ease both;
}

.lxone-chat-widget--bottom_left .lxone-chat-widget__panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.lxone-chat-widget__panel[hidden] {
    display: none;
}

.lxone-chat-widget__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    background: linear-gradient(135deg, var(--lxone-header), var(--lxone-accent));
    color: #ffffff;
}

.lxone-chat-widget__brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.lxone-chat-widget__avatar,
.lxone-chat-widget__message-avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.lxone-chat-widget__message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 11px;
    background: var(--lxone-primary);
    font-size: 13px;
}

.lxone-chat-widget__headline {
    min-width: 0;
}

.lxone-chat-widget__headline strong,
.lxone-chat-widget__headline span {
    display: block;
}

.lxone-chat-widget__headline strong {
    font-size: 16px;
    line-height: 1.25;
}

.lxone-chat-widget__headline span {
    margin-top: 4px;
    overflow: hidden;
    opacity: 0.86;
    font-size: 13px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lxone-chat-widget__close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.lxone-chat-widget__close:hover,
.lxone-chat-widget__close:focus-visible {
    background: rgba(255, 255, 255, 0.24);
    outline: none;
}

.lxone-chat-widget__messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.lxone-chat-widget__message {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.lxone-chat-widget__message--user {
    justify-content: flex-end;
}

.lxone-chat-widget__bubble {
    max-width: 82%;
    padding: 12px 14px;
    border: 1px solid var(--lxone-border);
    border-radius: 18px 18px 18px 6px;
    background: var(--lxone-bot-bubble);
    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.06);
}

.lxone-chat-widget__message--user .lxone-chat-widget__bubble {
    border-color: transparent;
    border-radius: 18px 18px 6px 18px;
    background: var(--lxone-user-bubble);
    color: #ffffff;
}

.lxone-chat-widget__sender {
    display: block;
    margin-bottom: 4px;
    color: var(--lxone-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.lxone-chat-widget__bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.lxone-chat-widget__typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 2px 0 12px 40px;
    padding: 10px 12px;
    border: 1px solid var(--lxone-border);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.05);
}

.lxone-chat-widget__typing[hidden] {
    display: none;
}

.lxone-chat-widget__typing span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--lxone-accent);
    animation: lxone-chat-typing 900ms ease-in-out infinite;
}

.lxone-chat-widget__typing span:nth-child(2) {
    animation-delay: 120ms;
}

.lxone-chat-widget__typing span:nth-child(3) {
    animation-delay: 240ms;
}

.lxone-chat-widget__typing em {
    margin-left: 3px;
    color: var(--lxone-muted);
    font-size: 12px;
    font-style: normal;
}

.lxone-chat-widget__handoff {
    flex: 0 0 auto;
    padding: 12px 16px 0;
    border-top: 1px solid var(--lxone-border);
    background: #ffffff;
}

.lxone-chat-widget__handoff-button {
    width: 100%;
    border: 1px solid rgba(15, 110, 86, 0.28);
    border-radius: 14px;
    background: rgba(15, 110, 86, 0.08);
    color: var(--lxone-accent);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    padding: 11px 12px;
}

.lxone-chat-widget__handoff-button:hover,
.lxone-chat-widget__handoff-button:focus-visible {
    background: rgba(15, 110, 86, 0.13);
    outline: none;
}

.lxone-chat-widget__composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex: 0 0 auto;
    padding: 12px 16px 16px;
    background: #ffffff;
}

.lxone-chat-widget__input {
    width: 100%;
    max-height: 108px;
    min-height: 46px;
    resize: none;
    border: 1px solid var(--lxone-border);
    border-radius: 15px;
    background: var(--lxone-soft);
    color: var(--lxone-text);
    font: inherit;
    font-size: 14px;
    line-height: 1.45;
    outline: none;
    padding: 12px 13px;
}

.lxone-chat-widget__input:focus {
    border-color: rgba(15, 110, 86, 0.45);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(15, 110, 86, 0.1);
}

.lxone-chat-widget__send {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 15px;
    background: var(--lxone-accent);
    color: #ffffff;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 10px 24px rgba(15, 110, 86, 0.22);
}

.lxone-chat-widget__send:hover,
.lxone-chat-widget__send:focus-visible {
    filter: brightness(0.96);
    outline: none;
}


.lxone-chat-widget--font-inter {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.lxone-chat-widget--font-serif {
    font-family: Georgia, "Times New Roman", serif;
}

.lxone-chat-widget--font-mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.lxone-chat-widget--rounded_square .lxone-chat-widget__launcher {
    width: 64px;
    min-width: 64px;
    padding: 0;
    border-radius: 20px;
}

.lxone-chat-widget--rounded_square .lxone-chat-widget__launcher-text {
    display: none;
}

.lxone-chat-widget--pill_button .lxone-chat-widget__launcher {
    min-width: 116px;
    border-radius: 18px;
}

.lxone-chat-widget--minimal_icon .lxone-chat-widget__launcher {
    width: 58px;
    min-width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 999px;
}

.lxone-chat-widget--minimal_icon .lxone-chat-widget__launcher-text {
    display: none;
}

@keyframes lxone-chat-pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@media (max-width: 600px) {
    .lxone-chat-widget {
        right: 16px;
        bottom: 16px;
        left: 16px;
    }

    .lxone-chat-widget__launcher {
        float: right;
        min-width: 62px;
        height: 62px;
        padding: 0 16px;
    }

    .lxone-chat-widget--bottom_left .lxone-chat-widget__launcher {
        float: left;
    }

    .lxone-chat-widget__panel,
    .lxone-chat-widget--bottom_left .lxone-chat-widget__panel {
        right: 0;
        left: 0;
        bottom: 78px;
        width: 100%;
        height: min(640px, calc(100vh - 110px));
        min-height: 390px;
        border-radius: 22px;
    }

    .lxone-chat-widget__headline span {
        white-space: normal;
    }
}

@media (max-width: 420px) {
    .lxone-chat-widget__launcher-text {
        display: none;
    }

    .lxone-chat-widget__launcher {
        width: 62px;
        padding: 0;
        border-radius: 50%;
    }

    .lxone-chat-widget__messages {
        padding: 15px;
    }

    .lxone-chat-widget__bubble {
        max-width: 86%;
    }
}
