/* MSA AI-chatbot — zwevende widget in MSA-huisstijl */
.msa-chat {
    --msa-navy: #183050;
    --msa-green: #187858;
    font-family: inherit;
}
/* Knop en paneel staan onafhankelijk in dezelfde hoek → nooit een dubbele cirkel. */
.msa-chat-toggle {
    position: fixed; right: 22px; bottom: 22px; z-index: 99999;
    width: 62px; height: 62px;
    border: none; border-radius: 50%;
    background: var(--msa-green); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.msa-chat-toggle:hover { background: #14664b; }
/* Logo op de groene cirkel: de groene ruit valt weg tegen de cirkel, witte "MSA" blijft zichtbaar. */
.msa-chat-toggle img { display: block; }
.msa-chat-toggle:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 0, 0, .28); }
.msa-chat.is-open .msa-chat-toggle { display: none; }

.msa-chat-panel {
    position: fixed; right: 22px; bottom: 22px; z-index: 100000;
    width: 360px; max-width: calc(100vw - 32px);
    height: 540px; max-height: calc(100vh - 44px);
    background: #fff; border-radius: 16px; overflow: hidden;
    /* Zichtbaarheid volgt de is-open-class (niet het hidden-attribuut) → kruisje sluit betrouwbaar. */
    display: none; flex-direction: column;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
.msa-chat.is-open .msa-chat-panel { display: flex; }
.msa-chat-head {
    background: var(--msa-navy); color: #fff;
    padding: 14px 16px; font-weight: 700;
    display: flex; align-items: center; justify-content: space-between;
}
.msa-chat-title { display: inline-flex; align-items: center; gap: 8px; }
.msa-chat-title img { display: block; border-radius: 4px; }
.msa-chat-close {
    background: none; border: none; color: #fff;
    font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.msa-chat-log {
    flex: 1; overflow-y: auto;
    padding: 16px; display: flex; flex-direction: column; gap: 10px;
    background: #f4f6f8;
}
.msa-chat-msg {
    max-width: 82%; padding: 10px 13px; border-radius: 14px;
    line-height: 1.45; font-size: 14.5px; white-space: pre-wrap; word-wrap: break-word;
}
.msa-chat-msg.bot { background: #fff; color: #1f2937; align-self: flex-start; border: 1px solid #e5e9ee; border-bottom-left-radius: 4px; }
.msa-chat-msg.user { background: var(--msa-green); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msa-chat-msg.typing { color: #6b7280; font-style: italic; }

.msa-chat-form {
    display: flex; gap: 8px; padding: 12px; border-top: 1px solid #e5e9ee; background: #fff;
}
.msa-chat-input {
    flex: 1; border: 1px solid #cbd5e1; border-radius: 10px;
    padding: 10px 12px; font-size: 14.5px; outline: none;
}
.msa-chat-input:focus { border-color: var(--msa-green); }
.msa-chat-form button {
    border: none; border-radius: 10px; background: var(--msa-green);
    color: #fff; width: 44px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.msa-chat-form button:hover { background: #14664b; }
.msa-chat-form button:disabled { opacity: .5; cursor: default; }
