#p2d-chat-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0073aa; /* Overridden by JS */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

#p2d-chat-launcher:hover { transform: scale(1.05); }

#p2d-chat-launcher svg { width: 30px; height: 30px; fill: white; }

#p2d-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
}

#p2d-chat-header {
    padding: 15px;
    background: #0073aa; /* Overridden */
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

#p2d-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
}

.p2d-msg { margin-bottom: 10px; max-width: 80%; padding: 8px 12px; border-radius: 15px; font-size: 14px; line-height: 1.4; }
.p2d-msg.user { background: #0073aa; color: white; margin-left: auto; border-bottom-right-radius: 2px; }
.p2d-msg.bot { background: #e0e0e0; color: #333; margin-right: auto; border-bottom-left-radius: 2px; }

#p2d-chat-input-area {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
}

#p2d-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
}

@media (max-width: 480px) {
    #p2d-chat-window { width: 90%; right: 5%; bottom: 80px; height: 70vh; }
}