#wcp-root,
#wcp-root * {
    box-sizing: border-box;
}

#wcp-root {
    position: fixed;
    z-index: 999999;
    bottom: 22px;
    width: 56px;
    height: 56px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    pointer-events: none;
}

#wcp-root.wcp-position-right {
    right: 22px;
}

#wcp-root.wcp-position-left {
    left: 22px;
}

.wcp-launcher,
.wcp-panel {
    pointer-events: auto;
}

.wcp-launcher {
    position: absolute;
    inset: 0;
    width: 56px;
    height: 56px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .20);
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.wcp-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 13px 32px rgba(0, 0, 0, .24);
}

.wcp-launcher:focus-visible,
.wcp-close:focus-visible,
.wcp-send:focus-visible,
.wcp-textarea:focus-visible {
    outline: 3px solid rgba(37, 211, 102, .28);
    outline-offset: 2px;
}

.wcp-launcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .18s ease, transform .18s ease;
}

.wcp-icon-chat svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

.wcp-icon-close {
    position: absolute;
    inset: 0;
    font-size: 32px;
    line-height: 56px;
    opacity: 0;
    transform: rotate(-90deg) scale(.7);
}

#wcp-root.wcp-open .wcp-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(.7);
}

#wcp-root.wcp-open .wcp-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.wcp-panel {
    position: absolute;
    bottom: 76px;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .20);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.985);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.wcp-position-right .wcp-panel {
    right: 0;
    transform-origin: bottom right;
}

.wcp-position-left .wcp-panel {
    left: 0;
    transform-origin: bottom left;
}

#wcp-root.wcp-open .wcp-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.wcp-header {
    min-height: 76px;
    padding: 14px 14px 14px 16px;
    display: flex;
    align-items: center;
    gap: 11px;
    background: #0b5d51;
    color: #fff;
}

.wcp-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    background: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.wcp-avatar svg {
    width: 23px;
    height: 23px;
    fill: #fff;
}

.wcp-heading {
    min-width: 0;
    flex: 1;
}

.wcp-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.wcp-title {
    margin: 0;
    color: #fff;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -.01em;
}

.wcp-online-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, .16);
}

.wcp-subtitle {
    margin-top: 3px;
    color: rgba(255, 255, 255, .78);
    font-size: 11.5px;
    line-height: 1.35;
}

.wcp-close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, .86);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    transition: background-color .18s ease, color .18s ease;
}

.wcp-close span {
    font-size: 26px;
    line-height: 1;
    transform: translateY(-1px);
}

.wcp-close:hover {
    background: rgba(255, 255, 255, .10);
    color: #fff;
}

.wcp-content {
    padding: 14px;
    background: #f4f6f5;
}

.wcp-message-row {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.wcp-message-bubble {
    position: relative;
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 4px 12px 12px 12px;
    background: #fff;
    color: #263238;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.wcp-message-bubble::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 0 solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 7px solid #fff;
}

.wcp-composer {
    margin: 0;
    padding: 10px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .05);
}

.wcp-textarea {
    display: block;
    width: 100%;
    min-width: 0;
    height: 74px;
    min-height: 74px;
    max-height: 150px;
    margin: 0;
    padding: 10px 11px;
    resize: vertical;
    border: 1px solid #e2e7e5;
    border-radius: 9px;
    background: #fafbfb;
    color: #1f2937;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: none;
    outline: none;
}

.wcp-textarea::placeholder {
    color: #8a9590;
    opacity: 1;
}

.wcp-textarea:focus {
    border-color: #25d366;
    background: #fff;
}

.wcp-error {
    display: none;
    margin: 7px 2px 0;
    color: #b42318;
    font-size: 11.5px;
    line-height: 1.35;
}

.wcp-error.is-visible {
    display: block;
}

.wcp-send {
    width: 100%;
    min-height: 44px;
    margin: 9px 0 0;
    padding: 10px 14px;
    border: 0;
    border-radius: 9px;
    background: #25d366;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 700;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
    transition: background-color .18s ease, transform .18s ease;
}

.wcp-send:hover {
    background: #20c45d;
}

.wcp-send:active {
    transform: translateY(1px);
}

.wcp-send-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcp-send-icon svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

@media (max-width: 767px) {
    #wcp-root {
        right: auto;
        left: auto;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }

    #wcp-root.wcp-position-right {
        right: 14px;
    }

    #wcp-root.wcp-position-left {
        left: 14px;
    }

    .wcp-panel {
        width: min(340px, calc(100vw - 28px));
        max-height: calc(100dvh - 105px);
        overflow-y: auto;
        bottom: 72px;
        border-radius: 15px;
    }

    .wcp-header {
        min-height: 72px;
        padding: 12px 12px 12px 14px;
    }

    .wcp-content {
        padding: 12px;
    }

    .wcp-textarea {
        height: 70px;
        min-height: 70px;
    }

    .wcp-hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .wcp-hide-desktop {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wcp-launcher,
    .wcp-launcher-icon,
    .wcp-panel,
    .wcp-send {
        transition: none !important;
    }
}
