.pio-wa {
    --pio-wa-green: #25d366;
    --pio-wa-green-lo: #1ebe5a;
    --pio-wa-teal: #008069;
    --pio-wa-size: 52px;
    --pio-wa-icon: 26px;
    --pio-wa-gap: 12px;
    --pio-wa-lift: 0px;
    --pio-wa-panel-bg: #ffffff;
    --pio-wa-wall: #efeae2;
    --pio-wa-wall-dot: rgba(17, 27, 33, .05);
    --pio-wa-bubble: #ffffff;
    --pio-wa-ink: #111b21;
    --pio-wa-muted: #667781;
    --pio-wa-from: #128c7e;
    --pio-wa-bar: #f0f2f5;
    --pio-wa-field: #ffffff;
    --pio-wa-field-ink: #111b21;
    --pio-wa-line: rgba(17, 27, 33, .08);
    --pio-wa-day-bg: rgba(255, 255, 255, .94);
    --pio-wa-bubble-shadow: 0 1px .5px rgba(11, 20, 26, .13);
    --pio-wa-shadow: 0 30px 70px -20px rgba(7, 30, 40, .42), 0 12px 24px -12px rgba(7, 30, 40, .24);
}

body[data-bs-theme="dark"] .pio-wa {
    --pio-wa-panel-bg: #111b21;
    --pio-wa-wall: #0b141a;
    --pio-wa-wall-dot: rgba(233, 237, 239, .05);
    --pio-wa-bubble: #202c33;
    --pio-wa-ink: #e9edef;
    --pio-wa-muted: #8696a0;
    --pio-wa-from: #3fd18a;
    --pio-wa-bar: #1a252c;
    --pio-wa-field: #2a3942;
    --pio-wa-field-ink: #e9edef;
    --pio-wa-line: rgba(233, 237, 239, .08);
    --pio-wa-day-bg: rgba(32, 44, 51, .96);
    --pio-wa-bubble-shadow: 0 1px .5px rgba(0, 0, 0, .3);
    --pio-wa-shadow: 0 30px 70px -20px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .07);
}

body:has(.sticky-cta.is-visible) .pio-wa:not(.is-placed) {
    --pio-wa-lift: 78px;
}

@media (max-width: 991.98px) {
    body:has(.pio-demo .demo-rail-track) .pio-wa:not(.is-placed) {
        --pio-wa-lift: 64px;
    }
}

@media (max-width: 767.98px) {
    body[dir="ltr"]:has(.pio-fab-filter-fab) .pio-wa[data-side="right"]:not(.is-placed),
    body[dir="rtl"]:has(.pio-fab-filter-fab) .pio-wa[data-side="left"]:not(.is-placed) {
        --pio-wa-lift: 72px;
    }
}

.pio-wa-launcher {
    position: fixed;
    z-index: 999;
    bottom: calc(var(--pio-wa-y) + var(--pio-wa-lift));
    display: grid;
    place-items: center;
    width: var(--pio-wa-size);
    height: var(--pio-wa-size);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--pio-wa-green);
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform .2s ease, background-color .2s ease, bottom .35s cubic-bezier(.22, .61, .36, 1);
}

.pio-wa[data-side="right"] .pio-wa-launcher {
    right: var(--pio-wa-x);
}

.pio-wa[data-side="left"] .pio-wa-launcher {
    left: var(--pio-wa-x);
}

.pio-wa.is-placed .pio-wa-launcher {
    transition: transform .2s ease, background-color .2s ease;
}

@media (hover: hover) {
    .pio-wa-launcher:hover {
        background: var(--pio-wa-green-lo);
    }
}

.pio-wa-launcher:focus {
    outline: none;
}

.pio-wa-launcher:focus-visible {
    outline: 3px solid rgba(37, 211, 102, .5);
    outline-offset: 3px;
}

.pio-wa.is-dragging .pio-wa-launcher {
    cursor: grabbing;
    transform: scale(1.08);
    transition: transform .15s ease, background-color .2s ease;
}

.pio-wa-launcher-icon {
    position: relative;
    display: block;
    width: var(--pio-wa-icon);
    height: var(--pio-wa-icon);
}

.pio-wa-launcher-icon svg {
    position: absolute;
    inset: 0;
    margin: auto;
    transition: transform .4s cubic-bezier(.2, .8, .2, 1), opacity .25s ease;
}

.pio-wa-glyph {
    width: 100%;
    height: 100%;
    fill: #fff;
}

.pio-wa-x {
    width: 72%;
    height: 72%;
    fill: none;
    stroke: #fff;
    stroke-width: 2.4;
    stroke-linecap: round;
    opacity: 0;
    transform: rotate(-90deg) scale(.5);
}

.pio-wa.is-open .pio-wa-glyph {
    opacity: 0;
    transform: rotate(90deg) scale(.5);
}

.pio-wa.is-open .pio-wa-x {
    opacity: 1;
    transform: none;
}

.pio-wa-panel {
    position: fixed;
    z-index: 999;
    bottom: calc(var(--pio-wa-y) + var(--pio-wa-lift) + var(--pio-wa-size) + var(--pio-wa-gap));
    display: flex;
    flex-direction: column;
    width: min(360px, calc(100vw - 24px));
    max-height: min(540px, calc(100vh - 140px));
    overflow: hidden;
    border-radius: 22px;
    background: var(--pio-wa-panel-bg);
    box-shadow: var(--pio-wa-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.94);
    transform-origin: right bottom;
    transition: opacity .2s ease, transform .3s cubic-bezier(.2, .9, .25, 1.05), visibility 0s linear .3s;
}

.pio-wa[data-side="right"] .pio-wa-panel {
    right: var(--pio-wa-x);
}

.pio-wa[data-side="left"] .pio-wa-panel {
    left: var(--pio-wa-x);
    transform-origin: left bottom;
}

.pio-wa-panel[data-dir="down"] {
    transform: translateY(-12px) scale(.94);
}

.pio-wa.is-open .pio-wa-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .22s ease, transform .4s cubic-bezier(.2, .9, .25, 1.05), visibility 0s;
}

.pio-wa-head {
    position: relative;
    isolation: isolate;
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 14px;
    padding-inline-start: 18px;
    overflow: hidden;
    color: #fff;
    background: var(--pio-wa-teal);
}

.pio-wa-avatar {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .2), 0 6px 14px -6px rgba(0, 0, 0, .4);
}

.pio-wa-emblem {
    display: block;
    width: 26px;
    height: 26px;
    overflow: hidden;
    direction: ltr;
}

    .pio-wa-emblem img {
        display: block;
        width: auto;
        max-width: none;
        height: 26px;
    }

.pio-wa-id {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pio-wa .pio-wa-name {
    overflow: hidden;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pio-wa .pio-wa-sub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, .84);
    font-size: 12.5px;
    line-height: 1.2;
}

    .pio-wa .pio-wa-sub svg {
        flex: none;
        width: 12px;
        height: 12px;
        fill: currentColor;
    }

.pio-wa-close {
    position: relative;
    z-index: 1;
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

    .pio-wa-close:hover {
        background: rgba(255, 255, 255, .26);
    }

    .pio-wa-close:focus {
        outline: none;
    }

    .pio-wa-close:focus-visible {
        outline: 2px solid rgba(255, 255, 255, .8);
        outline-offset: 2px;
    }

    .pio-wa-close svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.4;
        stroke-linecap: round;
    }

.pio-wa-watermark {
    position: absolute;
    z-index: -1;
    inset-inline-end: -16px;
    bottom: -30px;
    width: 108px;
    height: 108px;
    fill: #fff;
    opacity: .08;
    transform: rotate(-12deg);
    pointer-events: none;
}

.pio-wa-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 16px 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: var(--pio-wa-wall);
    background-image: radial-gradient(var(--pio-wa-wall-dot) 1.2px, transparent 1.7px), radial-gradient(var(--pio-wa-wall-dot) 1.2px, transparent 1.7px);
    background-position: 0 0, 11px 11px;
    background-size: 22px 22px;
}

.pio-wa .pio-wa-day {
    align-self: center;
    padding: 5px 12px;
    border-radius: 8px;
    color: var(--pio-wa-muted);
    background: var(--pio-wa-day-bg);
    box-shadow: var(--pio-wa-bubble-shadow);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .02em;
}

.pio-wa-typing {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    border-start-start-radius: 4px;
    background: var(--pio-wa-bubble);
    box-shadow: var(--pio-wa-bubble-shadow);
}

.pio-wa.is-typing .pio-wa-typing {
    display: inline-flex;
}

.pio-wa-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pio-wa-muted);
    animation: pio-wa-dot 1.1s ease-in-out infinite;
}

    .pio-wa-typing span:nth-child(2) {
        animation-delay: .15s;
    }

    .pio-wa-typing span:nth-child(3) {
        animation-delay: .3s;
    }

.pio-wa-bubble {
    position: relative;
    display: none;
    flex-direction: column;
    max-width: 88%;
    padding: 8px 12px 6px;
    border-radius: 12px;
    border-start-start-radius: 0;
    background: var(--pio-wa-bubble);
    box-shadow: var(--pio-wa-bubble-shadow);
}

    .pio-wa-bubble::before {
        content: "";
        position: absolute;
        top: 0;
        inset-inline-start: -8px;
        width: 8px;
        height: 13px;
        background: var(--pio-wa-bubble);
        clip-path: polygon(0 0, 100% 0, 100% 100%);
    }

[dir="rtl"] .pio-wa-bubble::before {
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.pio-wa.is-greeted .pio-wa-bubble {
    display: flex;
    animation: pio-wa-pop .36s cubic-bezier(.2, .9, .25, 1.1) both;
}

.pio-wa .pio-wa-from {
    margin-bottom: 2px;
    color: var(--pio-wa-from);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
}

.pio-wa .pio-wa-text {
    margin: 0;
    color: var(--pio-wa-ink);
    font-size: 14.5px;
    line-height: 1.55;
}

.pio-wa .pio-wa-time {
    align-self: flex-end;
    margin-top: 2px;
    color: var(--pio-wa-muted);
    font-size: 11px;
    line-height: 1.2;
}

.pio-wa-form {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    background: var(--pio-wa-bar);
    border-top: 1px solid var(--pio-wa-line);
}

.pio-wa .pio-wa-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    color: var(--pio-wa-field-ink);
    background: var(--pio-wa-field);
    box-shadow: inset 0 0 0 1px var(--pio-wa-line);
    font: inherit;
    font-size: 14.5px;
    outline: none;
    transition: box-shadow .2s ease;
}

    .pio-wa .pio-wa-input::placeholder {
        color: var(--pio-wa-muted);
        opacity: 1;
    }

    .pio-wa .pio-wa-input:focus {
        box-shadow: inset 0 0 0 2px rgba(37, 211, 102, .6);
    }

.pio-wa-send {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--pio-wa-green);
    cursor: pointer;
    transition: background-color .2s ease;
}

    .pio-wa-send:hover {
        background: var(--pio-wa-green-lo);
    }

    .pio-wa-send:focus {
        outline: none;
    }

    .pio-wa-send:focus-visible {
        outline: 3px solid rgba(37, 211, 102, .5);
        outline-offset: 2px;
    }

    .pio-wa-send svg {
        width: 20px;
        height: 20px;
        margin-inline-start: 2px;
        fill: currentColor;
    }

[dir="rtl"] .pio-wa-send svg {
    transform: scaleX(-1);
}

@keyframes pio-wa-dot {
    0%, 60%, 100% {
        opacity: .35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

@keyframes pio-wa-pop {
    from {
        opacity: 0;
        transform: translateY(6px) scale(.96);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 575.98px) {
    .pio-wa {
        --pio-wa-size: 48px;
        --pio-wa-icon: 24px;
    }

    .pio-wa-launcher {
        bottom: calc(min(var(--pio-wa-y), 16px) + var(--pio-wa-lift));
    }

    .pio-wa[data-side="right"] .pio-wa-launcher,
    .pio-wa[data-side="right"] .pio-wa-panel {
        right: min(var(--pio-wa-x), 16px);
    }

    .pio-wa[data-side="left"] .pio-wa-launcher,
    .pio-wa[data-side="left"] .pio-wa-panel {
        left: min(var(--pio-wa-x), 16px);
    }

    .pio-wa .pio-wa-input {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pio-wa *,
    .pio-wa *::before {
        transition-duration: .01ms !important;
        animation: none !important;
    }
}

@media print {
    .pio-wa {
        display: none !important;
    }
}
