/* Banc Chatbot Widget */
#banc-chatbot-widget * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#banc-chatbot-toggle {
    position: fixed;
    bottom: 24px;
    z-index: 99999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#banc-chatbot-toggle:hover {
    transform: scale(1.08);
}
#banc-chatbot-toggle svg {
    width: 24px;
    height: 24px;
}

#banc-chatbot-window {
    position: fixed;
    bottom: 92px;
    z-index: 99999;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    display: none;
    flex-direction: column;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#banc-chatbot-window.open {
    display: flex;
}

/* Position */
.banc-chatbot-right #banc-chatbot-toggle,
.banc-chatbot-right #banc-chatbot-window {
    right: 24px;
}
.banc-chatbot-left #banc-chatbot-toggle,
.banc-chatbot-left #banc-chatbot-window {
    left: 24px;
}

#banc-chatbot-header {
    color: white;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#banc-chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    line-height: 1;
}

#banc-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#banc-chatbot-widget .banc-chatbot-msg {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}
#banc-chatbot-widget .banc-chatbot-msg.bot {
    background: #e8ebf0;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
#banc-chatbot-widget .banc-chatbot-msg.user {
    background: var(--banc-chatbot-color, #0066cc);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
/* Bot message markdown content — prefixed with #id to beat the * reset */
#banc-chatbot-widget .banc-chatbot-msg.bot p {
    margin: 8px 0;
    font-size: inherit;
    line-height: inherit;
}
#banc-chatbot-widget .banc-chatbot-msg.bot p:last-child {
    margin-bottom: 0;
}
#banc-chatbot-widget .banc-chatbot-msg.bot strong {
    font-weight: 600;
}
#banc-chatbot-widget .banc-chatbot-msg.bot em {
    font-style: italic;
}
#banc-chatbot-widget .banc-chatbot-msg.bot code {
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 13px;
}
#banc-chatbot-widget .banc-chatbot-msg.bot a {
    color: var(--banc-chatbot-color, #0066cc);
    text-decoration: none;
    font-size: inherit;
    font-weight: bold;
    line-height: inherit;
}
#banc-chatbot-widget .banc-chatbot-msg.bot a:hover {
    text-decoration: underline;
}
#banc-chatbot-widget .banc-chatbot-msg.bot ul {
    margin: 6px 0;
    padding-left: 18px;
    list-style: revert;
}
#banc-chatbot-widget .banc-chatbot-msg.bot li {
    margin-bottom: 1px;
    font-size: inherit;
    line-height: inherit;
}
/* ─── Structured item cards ─── */
#banc-chatbot-widget .banc-card {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
#banc-chatbot-widget .banc-card:last-child {
    border-bottom: none;
}
#banc-chatbot-widget .banc-card-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--banc-chatbot-color, #0066cc);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 22px;
    text-align: center;
}
#banc-chatbot-widget .banc-card-body {
    flex: 1;
    min-width: 0;
}
#banc-chatbot-widget .banc-card-name {
    font-weight: 600;
    font-size: inherit;
    line-height: 1.3;
    margin-bottom: 2px;
}
#banc-chatbot-widget .banc-card-meta {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
    margin-bottom: 4px;
}
#banc-chatbot-widget .banc-card-detail {
    font-size: 12px;
    color: #444;
    line-height: 1.4;
}

#banc-chatbot-widget .banc-chatbot-msg .banc-chatbot-sources {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}
#banc-chatbot-widget .banc-chatbot-msg .banc-chatbot-sources a {
    text-decoration: none;
}
#banc-chatbot-widget .banc-chatbot-msg .banc-chatbot-sources a:hover {
    text-decoration: underline;
}

#banc-chatbot-widget .banc-chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    align-self: flex-start;
    background: #e8ebf0;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}
#banc-chatbot-widget .banc-chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: banc-chatbot-bounce 1.2s infinite;
}
.banc-chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}
.banc-chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes banc-chatbot-bounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

#banc-chatbot-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    gap: 8px;
}
#banc-chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 13px;
    line-height: 1.4;
    outline: none;
    font-family: inherit;
}
#banc-chatbot-input::placeholder {
    color: #999;
}
#banc-chatbot-input:focus {
    border-color: var(--banc-chatbot-color, #0066cc);
}
#banc-chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
#banc-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#banc-chatbot-send svg {
    width: 18px;
    height: 18px;
}

#banc-chatbot-powered {
    text-align: center;
    padding: 6px;
    font-size: 11px;
    color: #aaa;
}
