.paart-assistant {
    --pa-size: 56px;
    position: fixed;
    z-index: 999999;
    bottom: var(--pa-db);
    direction: rtl;
    font-family: Tahoma, Arial, sans-serif;
}

.paart-assistant [hidden] {
    display: none !important;
}

.paart-assistant.is-right { right: var(--pa-ds); }
.paart-assistant.is-left { left: var(--pa-ds); }

.pa-launcher {
    min-width: var(--pa-size);
    height: var(--pa-size);
    border: 0;
    border-radius: 999px;
    background: var(--pa-launcher-bg);
    color: var(--pa-launcher-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
    cursor: pointer;
    font: inherit;
    transition: transform .18s ease, box-shadow .18s ease;
}

.pa-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
}

.pa-launcher.is-icon-only {
    width: var(--pa-size);
    padding: 0;
}

.pa-icon {
    width: calc(var(--pa-size) * .5);
    height: calc(var(--pa-size) * .5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.pa-icon svg,
.pa-icon img {
    width: 100%;
    height: 100%;
    fill: var(--pa-launcher-text);
    object-fit: cover;
    border-radius: 50%;
}

.pa-window {
    position: absolute;
    bottom: calc(var(--pa-size) + 14px);
    width: min(380px, calc(100vw - 24px));
    height: 540px;
    max-height: min(72vh, 620px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--pa-window-bg);
    border: 1px solid color-mix(in srgb, var(--pa-header-start) 16%, transparent);
    border-radius: 20px;
    box-shadow: 0 22px 65px rgba(0, 0, 0, .3);
    animation: pa-chat-in .18s ease-out;
}

.is-right .pa-window { right: 0; }
.is-left .pa-window { left: 0; }

.pa-window header {
    min-height: 66px;
    box-sizing: border-box;
    padding: 13px 16px;
    background: linear-gradient(135deg, var(--pa-header-start), var(--pa-header-end));
    color: var(--pa-launcher-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
}

.pa-window header strong {
    display: block;
    font-size: 15px;
}

.pa-window header small {
    display: block;
    margin-top: 4px;
    opacity: .86;
    font-size: 11px;
}

.pa-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: var(--pa-launcher-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.pa-identity {
    padding: 18px;
    display: grid;
    gap: 11px;
    overflow: auto;
}

.pa-identity input,
.pa-window textarea {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid var(--pa-input-border);
    border-radius: 12px;
    background: var(--pa-input-bg);
    color: var(--pa-input-text);
    padding: 11px 12px;
    font: inherit;
    outline: none;
}

.pa-identity input:focus,
.pa-window textarea:focus {
    border-color: #9a5944;
    box-shadow: 0 0 0 3px rgba(154, 89, 68, .1);
}

.pa-identity button,
.pa-window form button {
    border: 0;
    border-radius: 12px;
    background: var(--pa-launcher-bg);
    color: var(--pa-launcher-text);
    padding: 11px 16px;
    font: inherit;
    cursor: pointer;
}

.pa-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 14px;
    background: var(--pa-messages-bg);
}

.pa-message {
    max-width: 82%;
    width: fit-content;
    box-sizing: border-box;
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 14px 14px 4px 14px;
    background: var(--pa-admin-bubble);
    color: var(--pa-admin-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    line-height: 1.7;
    word-break: break-word;
}

.pa-message.is-customer {
    margin-right: auto;
    border-radius: 14px 14px 14px 4px;
    background: var(--pa-customer-bubble);
    color: var(--pa-customer-text);
}

.pa-message time {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    opacity: .55;
}

.pa-window form {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee8e5;
    background: #fff;
}

.pa-window form textarea {
    flex: 1;
    min-height: 44px;
    max-height: 110px;
    resize: vertical;
}

.pa-window form button {
    min-height: 44px;
}

.pa-notice {
    flex: 0 0 auto;
    padding: 0 12px 9px;
    background: #fff;
    color: #b32d2e;
    font-size: 12px;
}

@keyframes pa-chat-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
    html.pa-chat-open,
    html.pa-chat-open body {
        overflow: hidden !important;
    }

    .paart-assistant {
        bottom: var(--pa-mb);
    }

    .paart-assistant.is-right { right: var(--pa-ms); }
    .paart-assistant.is-left { left: var(--pa-ms); }

    .pa-window {
        position: fixed;
        inset: 0 !important;
        width: 100vw;
        height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .pa-window header {
        min-height: 64px;
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .pa-close {
        width: 42px;
        height: 42px;
        font-size: 32px;
    }

    .pa-identity {
        padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    }

    .pa-window form {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .paart-assistant.is-open .pa-launcher {
        visibility: hidden;
        pointer-events: none;
    }
}
.pa-status{display:flex!important;align-items:center;gap:6px}.pa-status:before{content:"";width:8px;height:8px;border-radius:50%;background:#b9b9b9;box-shadow:0 0 0 3px rgba(255,255,255,.12)}.pa-status.is-online:before{background:var(--pa-online)}.pa-status.is-offline:before{background:var(--pa-offline)}.pa-availability-note{padding:8px 14px;font-size:11px;line-height:1.7;border-bottom:1px solid #eee8e5;background:#f8fbf9;color:#476557}.pa-availability-note.is-offline{background:#fff8ed;color:#845c20}

.pa-message-image{max-width:220px;max-height:220px;border-radius:12px;display:block;margin-top:8px}.pa-message-file{display:inline-block;margin-top:8px;padding:8px 10px;background:#f3f4f6;border-radius:8px;text-decoration:none}.pa-file-button{cursor:pointer;font-size:20px;padding:6px}.pa-thread-body{display:grid;grid-template-columns:minmax(0,1fr) 260px;min-height:0;flex:1}.pa-profile{padding:16px;border-right:1px solid #e5e7eb;overflow:auto;background:#fafafa}.pa-profile h3,.pa-profile h4{margin-top:0}.pa-order-link{display:block;padding:7px 0;border-bottom:1px solid #eee;text-decoration:none}.pa-admin-file{align-self:center}@media(max-width:900px){.pa-thread-body{display:block}.pa-profile{display:none}}

.pa-typing {
    width: fit-content;
    max-width: 82%;
    margin: 8px 0;
    padding: 10px 13px;
    border-radius: 14px 14px 4px 14px;
    background: var(--pa-admin-bubble);
    color: var(--pa-admin-text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.pa-typing-name { font-size: 12px; opacity: .78; }
.pa-typing-dots { display: inline-flex; align-items: center; gap: 3px; direction: ltr; }
.pa-typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .35;
    animation: pa-typing-bounce 1s infinite ease-in-out;
}
.pa-typing-dots i:nth-child(2) { animation-delay: .14s; }
.pa-typing-dots i:nth-child(3) { animation-delay: .28s; }
@keyframes pa-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .3; }
    30% { transform: translateY(-4px); opacity: .9; }
}

/* Product resolver cards: URLs are kept in href attributes and never shown raw. */
.pa-product-card{display:flex;gap:10px;margin-top:9px;padding:10px;border:1px solid rgba(0,0,0,.08);border-radius:14px;background:#fff;max-width:100%;box-sizing:border-box;overflow:hidden}.pa-product-card img{width:72px;height:72px;object-fit:cover;border-radius:10px;flex:0 0 72px}.pa-product-card-content{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1}.pa-product-card-content strong{font-size:13px;line-height:1.7;overflow-wrap:anywhere}.pa-product-price{font-weight:700}.pa-product-card .is-in-stock{color:#168447;font-size:12px}.pa-product-card .is-out-stock{color:#b42318;font-size:12px}.pa-product-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:3px}.pa-product-actions a{display:inline-flex;align-items:center;justify-content:center;text-decoration:none!important;padding:6px 9px;border-radius:8px;font-size:12px;line-height:1.3;max-width:100%;word-break:normal!important}.pa-product-actions>a:first-child{background:var(--pa-send-bg,#7257d5);color:#fff}.pa-product-cart{background:#eef0f5;color:#333}.pa-message-body,.pa-message-text{max-width:100%;overflow-wrap:anywhere;word-break:break-word}

.pa-product-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.pa-product-actions a{display:inline-flex;padding:8px 11px;border-radius:10px;text-decoration:none;font-weight:700;font-size:12px}.pa-product-view{background:var(--pa-send-bg,#333);color:var(--pa-send-text,#fff)!important}.pa-product-cart{border:1px solid var(--pa-send-bg,#333);color:var(--pa-send-bg,#333)!important;background:#fff}.pa-message a{overflow-wrap:anywhere;word-break:break-word;max-width:100%}
.pa-inline-link{margin-top:8px}.pa-inline-link a{display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;border-radius:10px;text-decoration:none;background:var(--pa-send-bg,#6d4aff);color:var(--pa-send-text,#fff);max-width:100%;overflow-wrap:anywhere}
