#pchat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#pchat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a56db;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(26,86,219,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    margin-left: auto;
}
#pchat-toggle:hover { background: #1e429f; transform: scale(1.08); }
#pchat-toggle svg { width: 26px; height: 26px; fill: #fff; }

#pchat-box {
    display: none;
    flex-direction: column;
    width: 340px;
    height: 480px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    margin-bottom: 12px;
    overflow: hidden;
}
#pchat-box.open { display: flex; }

#pchat-header {
    background: #1a56db;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
#pchat-header .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
#pchat-header .info { flex: 1; }
#pchat-header .info strong { display: block; font-size: 14px; }
#pchat-header .info span { font-size: 11px; opacity: 0.85; }
#pchat-close {
    background: none; border: none; color: #fff;
    cursor: pointer; font-size: 20px; padding: 0 4px;
    opacity: 0.8; line-height: 1;
}
#pchat-close:hover { opacity: 1; }

#pchat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
}

.pchat-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}
.pchat-msg.bot {
    background: #fff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.pchat-msg.user {
    background: #1a56db;
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}
.pchat-msg.typing { color: #64748b; font-style: italic; }

#pchat-form {
    display: flex;
    padding: 10px 12px;
    gap: 8px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}
#pchat-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 22px;
    padding: 8px 14px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    max-height: 80px;
    font-family: inherit;
}
#pchat-input:focus { border-color: #1a56db; }
#pchat-send {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #1a56db;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    align-self: flex-end;
    transition: background 0.2s;
}
#pchat-send:hover { background: #1e429f; }
#pchat-send svg { width: 16px; height: 16px; fill: #fff; }
#pchat-send:disabled { background: #94a3b8; cursor: not-allowed; }
