.zl-chat-widget {
    --widget-panel: #ffffff;
    --widget-border: #d9dee5;
    --widget-text: #1f2933;
    --widget-muted: #667085;
    --widget-accent: #c9a227;
    --widget-accent-dark: #96730c;
    --zl-chat-keyboard-offset: 0px;
    bottom: 18px;
    color: var(--widget-text);
    font-family: inherit;
    position: fixed;
    right: 18px;
    z-index: 4100;
}
.zl-chat-widget * {
    box-sizing: border-box;
}
.zl-chat-widget-toggle {
    align-items: center;
    background: #20242b;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .25);
    color: #fff;
    cursor: pointer;
    display: flex;
    gap: 9px;
    min-height: 52px;
    padding: 0 16px;
}
.zl-chat-widget-toggle.is-pulsing {
    animation: zlChatPulse 1.2s ease-in-out infinite;
}
.zl-chat-widget-toggle-icon {
    align-items: center;
    background: var(--widget-accent);
    border-radius: 50%;
    color: #211900;
    display: flex;
    font-size: 20px;
    height: 34px;
    justify-content: center;
    width: 34px;
}
.zl-chat-widget-toggle-text {
    font-weight: 700;
}
.zl-chat-widget-badge {
    align-items: center;
    background: #ef4444;
    border-radius: 999px;
    color: #fff;
    display: none;
    font-size: 11px;
    font-weight: 700;
    justify-content: center;
    min-width: 22px;
    padding: 3px 7px;
}
.zl-chat-widget-badge:not(:empty) {
    display: inline-flex;
}
.zl-chat-widget-panel {
    background: var(--widget-panel);
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    bottom: 66px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .24);
    display: none;
    flex-direction: column;
    height: 560px;
    max-height: calc(100vh - 96px);
    min-height: 0;
    overflow: hidden;
    position: absolute;
    right: 0;
    width: 380px;
}
.zl-chat-widget.is-open .zl-chat-widget-panel {
    display: flex;
}
.zl-chat-widget-head {
    align-items: center;
    background: #20242b;
    color: #fff;
    display: flex;
    gap: 10px;
    min-height: 58px;
    padding: 11px 12px;
}
.zl-chat-widget-head-icon {
    align-items: center;
    background: var(--widget-accent);
    border-radius: 50%;
    color: #211900;
    display: flex;
    font-size: 17px;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    width: 36px;
}
.zl-chat-widget-title {
    font-size: 15px;
    font-weight: 700;
}
.zl-chat-widget-subtitle {
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
}
.zl-chat-widget-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}
.zl-chat-widget-icon-btn {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 16px;
    height: 34px;
    justify-content: center;
    width: 34px;
}
.zl-chat-widget-icon-btn.is-muted {
    opacity: .45;
}
.zl-chat-widget-dialogs {
    border-bottom: 1px solid var(--widget-border);
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    overflow: visible;
    padding: 8px;
}
.zl-chat-widget-dialog {
    align-items: center;
    background: #f3f5f7;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--widget-text);
    cursor: pointer;
    display: inline-flex;
    flex: 1 1 calc(33.333% - 5px);
    font-size: 12px;
    gap: 5px;
    justify-content: center;
    max-width: none;
    min-width: 0;
    overflow: hidden;
    padding: 6px 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.zl-chat-widget-dialog-icon {
    flex: 0 0 auto;
    font-size: 13px;
    line-height: 1;
}
.zl-chat-widget-dialog-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.zl-chat-widget-dialog.is-active {
    background: #fff8db;
    border-color: #ead17a;
    color: #211900;
    font-weight: 700;
}
.zl-chat-widget-dialog-more {
    background: #eef1f5;
    border: 1px solid var(--widget-border);
    border-radius: 999px;
    color: var(--widget-text);
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 11px;
}
.zl-chat-widget-more-menu {
    background: var(--widget-panel);
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .22);
    display: none;
    max-width: 260px;
    min-width: 190px;
    padding: 6px;
    position: absolute;
    right: 10px;
    top: 112px;
    z-index: 2;
}
.zl-chat-widget-more-menu.is-open {
    display: grid;
    gap: 4px;
}
.zl-chat-widget-more-item {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--widget-text);
    cursor: pointer;
    padding: 8px 9px;
    text-align: left;
}
.zl-chat-widget-more-item:hover,
.zl-chat-widget-more-item.is-active {
    background: #fff8db;
    color: #211900;
}
.zl-chat-widget-body {
    background: linear-gradient(180deg, #fafbfc 0%, #f1f3f5 100%);
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}
.zl-chat-widget-empty,
.zl-chat-widget-loading,
.zl-chat-widget-error {
    color: var(--widget-muted);
    padding: 24px 8px;
    text-align: center;
}
.zl-chat-widget-error {
    color: #b42318;
}
.zl-chat-widget-load-more {
    background: var(--widget-panel);
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    color: var(--widget-text);
    cursor: pointer;
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin: 0 auto 10px;
    padding: 7px 11px;
}
.zl-chat-widget-load-more:hover {
    background: #f3f5f7;
}
.zl-chat-widget-load-more:disabled {
    cursor: default;
    opacity: .6;
}
.zl-chat-widget-message {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.zl-chat-widget-message.is-mine {
    flex-direction: row-reverse;
}
.zl-chat-widget-avatar {
    align-items: center;
    background: #2f6f73;
    border-radius: 50%;
    color: #fff;
    display: flex;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    height: 30px;
    justify-content: center;
    width: 30px;
}
.zl-chat-widget-bubble {
    background: #fff;
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.35;
    max-width: 250px;
    overflow-wrap: anywhere;
    padding: 8px 9px;
}
.zl-chat-widget-message.is-mine .zl-chat-widget-bubble {
    background: #e8f3f2;
    border-color: #c7dedc;
}
.zl-chat-widget-meta {
    align-items: center;
    color: var(--widget-muted);
    display: flex;
    font-size: 12px;
    gap: 8px;
    margin-top: 6px;
}
.zl-chat-widget .zl-chat-widget-meta .zl-chat-widget-author,
.zl-chat-widget .zl-chat-widget-meta a.zl-chat-widget-author,
.zl-chat-widget .zl-chat-widget-meta a.zl-chat-widget-author:visited {
    color: var(--widget-accent) !important;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}
.zl-chat-widget .zl-chat-widget-meta a.zl-chat-widget-author:hover {
    color: #e3bd38 !important;
    text-decoration: underline;
}
.zl-chat-widget-delete {
    align-items: center;
    background: rgba(230, 126, 34, .12);
    border: 1px solid rgba(230, 126, 34, .28);
    border-radius: 6px;
    color: #e67e22;
    cursor: pointer;
    display: inline-flex;
    font-size: 16px;
    height: 24px;
    justify-content: center;
    line-height: 1;
    min-width: 24px;
    padding: 0 6px;
}
.zl-chat-widget-delete:hover {
    background: rgba(230, 126, 34, .2);
    color: #ff9f43;
}
.zl-chat-widget-reply {
    align-items: center;
    background: rgba(230, 126, 34, .12);
    border: 1px solid rgba(230, 126, 34, .28);
    border-radius: 6px;
    color: #e67e22;
    cursor: pointer;
    display: inline-flex;
    font-size: 15px;
    height: 24px;
    justify-content: center;
    line-height: 1;
    min-width: 24px;
    padding: 0 6px;
}
.zl-chat-widget-reply:hover {
    background: rgba(230, 126, 34, .2);
    color: #ff9f43;
}
.zl-chat-widget-composer {
    background: var(--widget-panel);
    border-top: 1px solid var(--widget-border);
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 42px;
    gap: 7px;
    padding: 9px;
    position: relative;
    z-index: 4;
}
.zl-chat-widget-input-wrap {
    flex: 1;
    min-width: 0;
}
.zl-chat-widget-reply-chip {
    align-items: center;
    background: #fff8db;
    border: 1px solid #ead17a;
    border-radius: 8px;
    color: #211900;
    display: none;
    font-size: 12px;
    gap: 6px;
    margin-bottom: 6px;
    padding: 6px 8px;
}
.zl-chat-widget-reply-chip.is-active {
    display: flex;
}
.zl-chat-widget-reply-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.zl-chat-widget-reply-chip button {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-weight: 700;
    margin-left: auto;
    padding: 0;
}
.zl-chat-widget-input {
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    height: 38px;
    line-height: 18px;
    min-height: 38px;
    overflow-y: auto;
    padding: 9px;
    resize: none;
    width: 100%;
}
.zl-chat-widget-send {
    background: var(--widget-accent);
    border: 1px solid var(--widget-accent);
    border-radius: 8px;
    color: #211900;
    cursor: pointer;
    font-weight: 700;
    height: 38px;
    min-width: 42px;
}
.zl-chat-widget-attach {
    background: #fff;
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    cursor: pointer;
    height: 38px;
    min-width: 38px;
}
.zl-chat-widget-chip {
    background: #f3f5f7;
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    gap: 4px;
    margin-top: 5px;
    padding: 3px 7px;
}
.zl-chat-widget-chip button {
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
}
.zl-chat-widget-emoji-strip {
    display: flex;
    gap: 3px;
    grid-column: 1 / -1;
    min-width: 0;
    overflow: hidden;
}
.zl-chat-widget-emoji {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    font-size: 18px;
    height: 28px;
    justify-content: center;
    width: 28px;
}
.zl-chat-widget-emoji:hover {
    background: #f3f5f7;
}
.zl-chat-widget .chat-image {
    border-radius: 8px;
    cursor: zoom-in;
    max-height: 160px;
    max-width: 100%;
}
@keyframes zlChatPulse {
    0%, 100% { transform: translateY(0); box-shadow: 0 14px 34px rgba(15, 23, 42, .25); }
    50% { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(201, 162, 39, .45); }
}
@media (prefers-color-scheme: dark) {
    .zl-chat-widget {
        --widget-panel: #20242b;
        --widget-border: #343b45;
        --widget-text: #edf1f5;
        --widget-muted: #a8b0ba;
    }
    .zl-chat-widget-dialog,
    .zl-chat-widget-attach,
    .zl-chat-widget-bubble {
        background: #252b33;
    }
    .zl-chat-widget-dialog.is-active,
    .zl-chat-widget-more-item:hover,
    .zl-chat-widget-more-item.is-active {
        background: #e3bd38;
        border-color: #e3bd38;
        color: #211900;
    }
    .zl-chat-widget-dialog-more,
    .zl-chat-widget-emoji:hover,
    .zl-chat-widget-load-more:hover {
        background: #2b313a;
    }
    .zl-chat-widget-body {
        background: linear-gradient(180deg, #171a1f 0%, #1c2026 100%);
    }
    .zl-chat-widget-message.is-mine .zl-chat-widget-bubble {
        background: #213c3e;
        border-color: #31575a;
    }
}
@media (max-width: 520px) {
    .zl-chat-widget {
        bottom: 68px;
        left: auto;
        right: 10px;
    }
    .zl-chat-widget-toggle {
        gap: 6px;
        margin-left: auto;
        min-height: 42px;
        padding: 0 11px;
    }
    .zl-chat-widget-toggle-icon {
        font-size: 17px;
        height: 28px;
        width: 28px;
    }
    .zl-chat-widget-toggle-text {
        font-size: 13px;
    }
    .zl-chat-widget-badge {
        font-size: 10px;
        min-width: 18px;
        padding: 2px 5px;
    }
    .zl-chat-widget-panel {
        bottom: 50px;
        max-height: calc(100vh - 128px);
        right: -2px;
        width: min(380px, calc(100vw - 20px));
    }
    .zl-chat-widget-dialog {
        flex-basis: calc(50% - 5px);
    }
    .zl-chat-widget.is-keyboard-open {
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9000;
    }
    .zl-chat-widget.is-keyboard-open .zl-chat-widget-toggle {
        display: none;
    }
    .zl-chat-widget.is-keyboard-open .zl-chat-widget-panel {
        border-radius: 8px 8px 0 0;
        bottom: calc(var(--zl-chat-keyboard-offset, 0px) + 4px);
        height: auto;
        left: 8px;
        max-height: none;
        position: fixed;
        right: 8px;
        top: 6px;
        width: auto;
    }
    .zl-chat-widget.is-composing .zl-chat-widget-dialogs,
    .zl-chat-widget.is-composing .zl-chat-widget-more-menu {
        display: none;
    }
    .zl-chat-widget.is-composing .zl-chat-widget-head {
        min-height: 46px;
        padding: 7px 9px;
    }
    .zl-chat-widget.is-composing .zl-chat-widget-head-icon,
    .zl-chat-widget.is-composing .zl-chat-widget-subtitle {
        display: none;
    }
    .zl-chat-widget.is-keyboard-open .zl-chat-widget-body {
        min-height: 0;
        padding-bottom: 8px;
    }
    .zl-chat-widget.is-keyboard-open .zl-chat-widget-composer {
        box-shadow: 0 -10px 24px rgba(15, 23, 42, .16);
        flex-shrink: 0;
        grid-template-columns: 36px minmax(0, 1fr) 40px;
        padding: 8px;
        z-index: 20;
    }
    .zl-chat-widget.is-keyboard-open .zl-chat-widget-input,
    .zl-chat-widget.is-keyboard-open .zl-chat-widget-send,
    .zl-chat-widget.is-keyboard-open .zl-chat-widget-attach {
        height: 36px;
        min-height: 36px;
    }
}
