#wpstore-lcd-widget {
    --wpstore-lcd-primary: #2563eb;
    --wpstore-lcd-widget-text: #ffffff;
    --wpstore-lcd-agent-message-bg: #ffffff;
    --wpstore-lcd-agent-message-text: #0f172a;
    --wpstore-lcd-customer-message-bg: #2563eb;
    --wpstore-lcd-customer-message-text: #ffffff;
    --wpstore-lcd-pulse-color: #22c55e;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#wpstore-lcd-widget * {
    box-sizing: border-box;
}

.wpstore-lcd-launcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    color: var(--wpstore-lcd-widget-text);
    background: var(--wpstore-lcd-primary);
    box-shadow: 0 12px 34px rgba(15, 23, 42, .22);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
}


.wpstore-lcd-launcher:not(.is-custom-image)::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    box-shadow: 0 0 0 0 var(--wpstore-lcd-pulse-color);
    pointer-events: none;
    animation: wpstore-lcd-default-pulse 2.8s ease-out infinite;
}

@keyframes wpstore-lcd-default-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--wpstore-lcd-pulse-color);
    }
    70% {
        box-shadow: 0 0 0 12px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

.wpstore-lcd-launcher-icon {
    font-size: 20px;
    line-height: 1;
}

.wpstore-lcd-unread {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.wpstore-lcd-panel {
    width: 360px;
    max-width: calc(100vw - 24px);
    height: 560px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 54px rgba(15, 23, 42, .24);
    display: flex;
    flex-direction: column;
}

.wpstore-lcd-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 18px;
    background: var(--wpstore-lcd-primary);
    color: var(--wpstore-lcd-widget-text);
}

.wpstore-lcd-header strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.wpstore-lcd-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: .92;
}

.wpstore-lcd-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
}

.wpstore-lcd-status i.is-online {
    background: var(--wpstore-lcd-pulse-color);
}

.wpstore-lcd-status i.is-offline {
    background: #f97316;
}

.wpstore-lcd-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: var(--wpstore-lcd-widget-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.wpstore-lcd-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.wpstore-lcd-welcome {
    margin: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff;
    color: #334155;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.wpstore-lcd-start-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px 16px;
}

.wpstore-lcd-start-form input,
.wpstore-lcd-message-form textarea {
    width: 100%;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    padding: 11px 12px;
    color: #0f172a;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.wpstore-lcd-start-form input:focus,
.wpstore-lcd-message-form textarea:focus {
    border-color: var(--wpstore-lcd-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.wpstore-lcd-start-form button,
.wpstore-lcd-message-form button {
    border: 0;
    border-radius: 12px;
    padding: 11px 14px;
    color: var(--wpstore-lcd-widget-text);
    background: var(--wpstore-lcd-primary);
    font-weight: 700;
    cursor: pointer;
}

.wpstore-lcd-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
}

.wpstore-lcd-system-message {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #e2e8f0;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.wpstore-lcd-message {
    display: flex;
    margin: 8px 0;
}

.wpstore-lcd-message-agent {
    justify-content: flex-start;
}

.wpstore-lcd-message-visitor {
    justify-content: flex-end;
}

.wpstore-lcd-message-bubble {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.wpstore-lcd-message-agent .wpstore-lcd-message-bubble {
    color: var(--wpstore-lcd-agent-message-text);
    background: var(--wpstore-lcd-agent-message-bg);
    border-bottom-left-radius: 4px;
}

.wpstore-lcd-message-visitor .wpstore-lcd-message-bubble {
    color: var(--wpstore-lcd-customer-message-text);
    background: var(--wpstore-lcd-customer-message-bg);
    border-bottom-right-radius: 4px;
}

.wpstore-lcd-message-form {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.wpstore-lcd-message-form textarea {
    min-height: 44px;
    max-height: 96px;
    resize: vertical;
}

.wpstore-lcd-message-form button {
    min-width: 76px;
}

@media (max-width: 480px) {
    #wpstore-lcd-widget {
        right: 12px;
        bottom: 12px;
    }

    .wpstore-lcd-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 24px);
        border-radius: 18px;
    }

    .wpstore-lcd-launcher-text {
        display: none;
    }

    .wpstore-lcd-launcher {
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
    }
}

.wpstore-lcd-session-actions {
    padding: 8px 12px 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    text-align: right;
}

.wpstore-lcd-end-chat {
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 0;
}

.wpstore-lcd-end-chat:hover {
    color: #ef4444;
}

.wpstore-lcd-start-form button:disabled,
.wpstore-lcd-message-form button:disabled,
.wpstore-lcd-end-chat:disabled {
    opacity: .6;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .wpstore-lcd-panel {
        max-height: calc(100dvh - 24px);
    }

    .wpstore-lcd-header {
        padding: 16px;
    }

    .wpstore-lcd-message-form {
        align-items: flex-end;
    }

    .wpstore-lcd-message-form textarea {
        font-size: 16px;
    }
}


/* v1.7.1 customer widget input alignment */
.wpstore-lcd-message-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    align-items: stretch;
}

.wpstore-lcd-message-form textarea {
    min-height: 52px;
    height: 52px;
    max-height: 96px;
    overflow-y: auto;
    resize: none;
    line-height: 1.45;
}

.wpstore-lcd-message-form button {
    min-height: 52px;
    height: 52px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 52px;
}

@media (max-width: 480px) {
    .wpstore-lcd-message-form {
        grid-template-columns: minmax(0, 1fr) 76px;
        align-items: stretch;
    }
}

/* v2.3.0 custom widget launcher */
#wpstore-lcd-widget.has-custom-launcher .wpstore-lcd-launcher.is-custom-image {
    position: relative;
    width: var(--wpstore-lcd-launcher-width, 96px);
    height: var(--wpstore-lcd-launcher-height, auto);
    min-height: 0;
    padding: 0;
    border-radius: var(--wpstore-lcd-launcher-radius, 999px);
    background: transparent;
    color: inherit;
    box-shadow: none;
    overflow: visible;
    justify-content: center;
}

#wpstore-lcd-widget.has-custom-launcher .wpstore-lcd-launcher-image-wrap {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    filter: drop-shadow(0 12px 26px rgba(15, 23, 42, .22));
}

#wpstore-lcd-widget.has-custom-launcher .wpstore-lcd-launcher-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 0;
}

#wpstore-lcd-widget.has-custom-launcher .wpstore-lcd-launcher.is-animated .wpstore-lcd-launcher-image-wrap {
    animation: wpstore-lcd-launcher-pulse 2.4s ease-in-out infinite;
    box-shadow: 0 0 0 0 var(--wpstore-lcd-pulse-color);
}

#wpstore-lcd-widget.has-custom-launcher .wpstore-lcd-unread {
    position: absolute;
    top: -7px;
    right: -7px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, .35);
}

#wpstore-lcd-widget .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@keyframes wpstore-lcd-launcher-pulse {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.035);
    }
}

@media (max-width: 480px) {
    #wpstore-lcd-widget.has-custom-launcher .wpstore-lcd-launcher.is-custom-image {
        width: var(--wpstore-lcd-launcher-mobile-width, 72px);
        height: var(--wpstore-lcd-launcher-mobile-height, auto);
    }
}

/* v2.3.1 customer widget close button fix */
.wpstore-lcd-close {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 52px !important;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .16) !important;
    color: #fff !important;
    box-shadow: none !important;
    text-decoration: none !important;
    cursor: pointer !important;
    line-height: 1 !important;
    font-size: 0 !important;
    transform: none !important;
}

.wpstore-lcd-close::before {
    content: "×";
    display: block;
    color: #fff;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-1px);
}

.wpstore-lcd-close:hover,
.wpstore-lcd-close:focus {
    background: rgba(255, 255, 255, .24) !important;
    outline: none !important;
}

.wpstore-lcd-header {
    align-items: center;
}

@media (max-width: 480px) {
    .wpstore-lcd-close {
        flex-basis: 48px !important;
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        max-width: 48px !important;
        max-height: 48px !important;
    }
}
