#wpstore-lcd-widget {
    --wpstore-lcd-primary: #2563eb;
    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 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    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-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: #fff;
}

.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: #22c55e;
}

.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: #fff;
    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: #fff;
    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: #0f172a;
    background: #fff;
    border-bottom-left-radius: 4px;
}

.wpstore-lcd-message-visitor .wpstore-lcd-message-bubble {
    color: #fff;
    background: var(--wpstore-lcd-primary);
    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;
    }
}
