.pub-chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.pub-chatbot-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.5), 0 8px 10px -6px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pub-chatbot-fab:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(16, 185, 129, 0.6);
}

.pub-chatbot-fab.active {
    transform: rotate(90deg) scale(0.95);
    background: #0f172a;
}

.pub-chatbot-window {
    position: absolute;
    bottom: 74px;
    right: 0;
    width: 440px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 100px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
    animation: pubChatPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pubChatPop {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pub-chatbot-header {
    background: linear-gradient(135deg, #064e3b, #047857);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pub-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pub-bot-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.pub-bot-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.pub-bot-sub {
    font-size: 11px;
    opacity: 0.85;
}

.pub-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pub-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pub-chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.pub-msg-row {
    display: flex;
    gap: 8px;
    max-width: 90%;
}

.pub-msg-row.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.pub-msg-row.bot {
    align-self: flex-start;
}

.pub-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}

.pub-msg-row.user .pub-msg-bubble {
    background: #059669;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.pub-msg-row.bot .pub-msg-bubble {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pub-msg-bubble.denied {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.pub-table-wrap {
    margin-top: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow-x: auto;
    max-height: 200px;
    overscroll-behavior: contain;
}

.pub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

.pub-table th {
    background: #064e3b;
    color: #ffffff;
    padding: 6px 10px;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.pub-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.pub-table tr:nth-child(even) {
    background: #f8fafc;
}

.pub-chatbot-suggestions {
    padding: 8px 16px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
}

.pub-chatbot-suggestions::-webkit-scrollbar {
    display: none;
}

.pub-chip {
    padding: 6px 12px;
    border-radius: 20px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.pub-chip:hover {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
}

.pub-chatbot-input {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}

.pub-chatbot-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
}

.pub-chatbot-input input:focus {
    border-color: #059669;
}

.pub-send-btn {
    background: #059669;
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pub-send-btn:hover:not(:disabled) {
    background: #047857;
}

.pub-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pub-typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
}

.pub-typing-dots span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: pubBlink 1.4s infinite;
}

.pub-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.pub-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pubBlink {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
