.lx-chat-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1085;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.lx-chat-widget__button {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 55%, #7c3aed 100%);
    box-shadow: 0 18px 38px rgba(37, 99, 235, .34);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}
.lx-chat-widget__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(37, 99, 235, .42);
}
.lx-chat-widget__button svg {
    width: 27px;
    height: 27px;
}
.lx-chat-widget__button::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    right: 2px;
    top: 2px;
    border-radius: 999px;
    background: #22c55e;
    border: 3px solid #fff;
}
.lx-chat-widget__panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: min(390px, calc(100vw - 28px));
    height: min(620px, calc(100vh - 104px));
    background: #fff;
    border: 1px solid rgba(148, 163, 184, .34);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .26);
    overflow: hidden;
    transform: translateY(12px) scale(.98);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
}
.lx-chat-widget.is-open .lx-chat-widget__panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.lx-chat-widget__head {
    padding: 16px 18px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 14%, rgba(255,255,255,.28), transparent 20%),
        linear-gradient(135deg, #0f172a, #1d4ed8 60%, #7c3aed);
}
.lx-chat-widget__head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.lx-chat-widget__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}
.lx-chat-widget__subtitle {
    margin: 4px 0 0;
    font-size: .82rem;
    color: rgba(255,255,255,.78);
}
.lx-chat-widget__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: rgba(255,255,255,.14);
    cursor: pointer;
}
.lx-chat-widget__identity {
    padding: 12px 14px;
    border-bottom: 1px solid #e8eef6;
    background: #f8fbff;
    display: grid;
    gap: 8px;
}
.lx-chat-widget__identity input {
    width: 100%;
    border: 1px solid #d5dfed;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    outline: 0;
    background: #fff;
}
.lx-chat-widget__identity input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.lx-chat-widget__messages {
    min-height: 0;
    padding: 14px;
    overflow: auto;
    background: linear-gradient(180deg, #f8fbff, #ffffff);
}
.lx-chat-widget__empty {
    color: #64748b;
    font-size: .88rem;
    line-height: 1.45;
    padding: 12px;
    border-radius: 16px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
}
.lx-chat-widget__msg {
    display: flex;
    margin-bottom: 10px;
}
.lx-chat-widget__msg.is-operator {
    justify-content: flex-start;
}
.lx-chat-widget__msg.is-visitor {
    justify-content: flex-end;
}
.lx-chat-widget__bubble {
    max-width: 84%;
    padding: 10px 12px;
    border-radius: 16px;
    font-size: .9rem;
    line-height: 1.42;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0f172a;
}
.lx-chat-widget__msg.is-visitor .lx-chat-widget__bubble {
    border-color: transparent;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
}
.lx-chat-widget__composer {
    padding: 12px;
    border-top: 1px solid #e8eef6;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    background: #fff;
}
.lx-chat-widget__composer textarea {
    min-height: 44px;
    max-height: 120px;
    resize: vertical;
    border: 1px solid #d5dfed;
    border-radius: 14px;
    padding: 11px 12px;
    font: inherit;
    outline: 0;
}
.lx-chat-widget__composer textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.lx-chat-widget__send {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    background: #2563eb;
    cursor: pointer;
}
.lx-chat-widget__status {
    grid-column: 1 / -1;
    min-height: 18px;
    font-size: .78rem;
    color: #64748b;
}
@media (max-width: 520px) {
    .lx-chat-widget {
        right: 12px;
        bottom: 12px;
    }
    .lx-chat-widget__panel {
        right: -2px;
        bottom: 68px;
        height: min(610px, calc(100vh - 88px));
        border-radius: 20px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .lx-chat-widget__button,
    .lx-chat-widget__panel {
        transition: none;
    }
}
@media print {
    .lx-chat-widget { display: none !important; }
}
