.pdf-chatbot-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    max-width: 680px;
    margin: 20px auto;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.pcb-header {
    background: linear-gradient(135deg, #1d9e75, #0f6e56);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pcb-icon { font-size: 20px; }

.pcb-title {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.pcb-status {
    font-size: 10px;
    opacity: 0.7;
    color: #a8ffd8;
}
.pcb-status.online { color: #a8ffd8; opacity: 1; }
.pcb-status.busy { color: #ffd8a8; opacity: 1; animation: blink 1s infinite; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.pcb-messages {
    height: 380px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

.pcb-msg { display: flex; gap: 8px; }
.pcb-bot { justify-content: flex-start; }
.pcb-user { justify-content: flex-end; }

.pcb-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.pcb-bot .pcb-bubble {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-bottom-left-radius: 4px;
    color: #333;
}

.pcb-user .pcb-bubble {
    background: #1d9e75;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.pcb-source {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    margin-top: 7px;
    font-weight: 500;
}

.pcb-source.pdf { background: #e6f1fb; color: #185fa5; }
.pcb-source.web { background: #fff3cd; color: #856404; }
.pcb-source.general { background: #f0f0f0; color: #555; }

.pcb-refs {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.pcb-refs a {
    display: block;
    font-size: 12px;
    color: #1d9e75;
    text-decoration: none;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pcb-refs a:hover { text-decoration: underline; }

.pcb-loading .pcb-bubble {
    color: #999;
    font-style: italic;
}

.pcb-dots span {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #999;
    margin: 0 2px;
    animation: dot-bounce 1.2s infinite ease-in-out;
}
.pcb-dots span:nth-child(2) { animation-delay: 0.2s; }
.pcb-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.pcb-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid #eee;
    align-items: flex-end;
}

.pcb-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 40px;
    max-height: 100px;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.pcb-input:focus { border-color: #1d9e75; }

.pcb-send {
    background: #1d9e75;
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.pcb-send:hover { background: #0f6e56; }
.pcb-send:active { transform: scale(0.95); }
.pcb-send:disabled { background: #ccc; cursor: not-allowed; }

@media (max-width: 480px) {
    .pcb-messages { height: 300px; }
    .pcb-bubble { max-width: 90%; }
}
