#pr-chat-root { font-family: 'Inter', 'Segoe UI', sans-serif; }
#pr-chat-root, #pr-chat-root *:not(script):not(style) { box-sizing: border-box; }

#pr-launcher {
    position: fixed; right: 24px; bottom: 24px;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--pr-color); border: none; cursor: pointer; color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    display: flex; align-items: center; justify-content: center;
    z-index: 99999; transition: transform .2s, box-shadow .2s;
}
#pr-launcher:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,.3); }

#pr-window {
    position: fixed; right: 24px; bottom: 88px;
    width: 370px; height: 560px; background: #fff;
    border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.18);
    border: 1px solid #e5e7eb; display: none; flex-direction: column;
    overflow: hidden; z-index: 99999;
    animation: pr-slide-in .2s ease;
    transition: width .2s ease, height .2s ease, right .2s ease, bottom .2s ease;
}
#pr-window.open { display: flex; }
#pr-window.expanded {
    width: min(720px, calc(100vw - 32px)) !important;
    height: min(80vh, 800px) !important;
}
@keyframes pr-slide-in { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

#pr-header {
    background: var(--pr-color); color: #fff; padding: 14px 16px;
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
#pr-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,1); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px;
}
#pr-avatar img { opacity: 1; }
#pr-header-info .pr-name   { font-weight: 600; font-size: 15px; }
#pr-header-info .pr-status { font-size: 12px; opacity: 1; color: #fff; }
#pr-header-info .pr-status-dot { color: #A9FB60; }
#pr-resize-btn {
    margin-left: auto; background: none; border: none; color: #fff;
    cursor: pointer; opacity: 1; padding: 4px; display: flex; align-items: center;
}
#pr-close-btn {
    background: none; border: none; color: #fff;
    cursor: pointer; opacity: 1; padding: 4px; display: flex; align-items: center;
}

#pr-messages {
    flex: 1; overflow-y: auto; padding: 16px 12px;
    display: flex; flex-direction: column; gap: 2px;
    scroll-behavior: smooth;
}
.pr-row { display: flex; margin-bottom: 10px; }
.pr-row.user { justify-content: flex-end; }
.pr-row.bot  { align-items: flex-start; }
.pr-bot-icon {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--pr-color); color: #fff; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; margin-right: 8px; margin-top: 2px;
}
.pr-bubble {
    max-width: 78%; padding: 10px 14px; font-size: 14px;
    line-height: 1.55; word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,.07);
}
.pr-bubble.user { background: var(--pr-color); color: #fff; border-radius: 18px 18px 4px 18px; }
.pr-bubble.bot  { background: #f3f4f6; color: #111827; border-radius: 18px 18px 18px 4px; }

#pr-starters {
    padding: 6px 12px 8px; display: flex; flex-wrap: wrap; gap: 6px;
    border-top: 1px solid #f3f4f6; flex-shrink: 0;
}
.pr-starter {
    font-size: 12px; padding: 5px 11px; border-radius: 20px;
    border: 1px solid var(--pr-color); background: #fff; color: var(--pr-color);
    cursor: pointer; font-family: inherit; transition: all .15s;
}
.pr-starter:hover { background: var(--pr-color); color: #fff; }

#pr-input-area {
    padding: 10px 12px; border-top: 1px solid #e5e7eb;
    display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0;
}
#pr-textarea {
    flex: 1; border: 1px solid #d1d5db; border-radius: 10px;
    padding: 9px 12px; font-size: 14px; resize: none;
    font-family: inherit; line-height: 1.4; outline: none;
    max-height: 96px; overflow-y: auto; transition: border-color .15s;
}
#pr-textarea:focus { border-color: var(--pr-color); }
#pr-send-btn {
    width: 38px; height: 38px; border-radius: 50%; border: none;
    background: #e5e7eb; color: #9ca3af; cursor: default;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background .15s, color .15s;
}
#pr-send-btn.ready { background: var(--pr-color); color: #fff; cursor: pointer; }

.pr-typing { display: flex; gap: 4px; align-items: center; padding: 10px 14px; }
.pr-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #9ca3af;
    animation: pr-bounce 1.2s infinite;
}
.pr-dot:nth-child(2) { animation-delay: .2s; }
.pr-dot:nth-child(3) { animation-delay: .4s; }
@keyframes pr-bounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-6px)} }

@media (max-width: 420px) {
    #pr-window   { width: calc(100vw - 16px); right: 8px; bottom: 76px; }
    #pr-launcher { right: 16px; bottom: 16px; }
    #pr-resize-btn { display: none; }
}
