#printhub-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    box-sizing: border-box;
}


.printhub-ai-message a {
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
}

.printhub-ai-message a:hover {
    text-decoration: underline;
}

#printhub-chat-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,123,255,0.4);
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

#printhub-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0,123,255,0.6);
}

#printhub-chat-window {
    width: 475px;  /* ZWIĘKSZONE O 25% z 380px */
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
    position: absolute;
    bottom: 70px;
    right: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

#printhub-chat-window.open {
    display: flex;
    transform: scale(1);
    opacity: 1;
}

#printhub-chat-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

#printhub-chat-title {
    font-weight: 600;
    font-size: 16px;
}

#printhub-chat-close {
    all: unset;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: auto;
    box-shadow: none;
}

#printhub-chat-close:hover {
    background: rgba(255,255,255,0.2);
}

#printhub-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.printhub-message {
    margin-bottom: 16px;
    animation: slideIn 0.3s ease;
}

.printhub-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 90%;  /* Zwiększone dla lepszego wykorzystania szerokości */
    word-wrap: break-word;
    line-height: 1.3;
    position: relative;
    white-space: pre-line;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.printhub-user-message .printhub-message-content {
    background: #007bff;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;  /* Normal font dla użytkownika */
}

.printhub-ai-message .printhub-message-content {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    margin-right: auto;
    border-bottom-left-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 13px;  /* Lekko mniejsza czcionka */
}

.printhub-typing {
    opacity: 0.7;
    font-style: italic;
}

/* ✅ POPRAWIONE formatowanie dla danych */
.printhub-message-content strong {
    color: #0056b3;
    font-weight: 600;
}

/* ✅ NOWE: Kliklne linki */
.printhub-message-content a {
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
}

.printhub-message-content a:hover {
    color: #0056b3;
    text-decoration: none;
}

/* ✅ NOWE: Specjalne słowa kluczowe na niebiesko */
.printhub-message-content .highlight-key {
    color: #0056b3;
    font-weight: 600;
}


/* Ukryj złożone elementy formatowania */
.printhub-message-content table,
.printhub-message-content h1,
.printhub-message-content h2,
.printhub-message-content h3,
.printhub-message-content h4,
.printhub-message-content blockquote,
.printhub-message-content pre,
.printhub-message-content code {
    display: none;
}

/* Input i kontrolki */
#printhub-chat-topic-bar {
    display: none;
    padding: 6px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    justify-content: center;
}

#printhub-change-topic {
    background: none;
    border: 1px solid #007bff;
    color: #007bff;
    border-radius: 14px;
    padding: 4px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#printhub-change-topic:hover {
    background: #007bff;
    color: white;
}

#printhub-chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
}

#printhub-chat-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    padding: 12px 16px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

#printhub-chat-input:focus {
    border-color: #007bff;
}

#printhub-chat-send {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 16px;
}

#printhub-chat-send:hover {
    background: #0056b3;
}

#printhub-chat-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Responsywność dla większego okna */
@media (max-width: 600px) {
    #printhub-chat-window {
        width: calc(100vw - 20px);
        max-width: 475px;
        height: calc(100vh - 100px);
        right: -15px;
        bottom: 70px;
    }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}