/* ============================================
   COB AI CHATBOT STYLES
   
   A modern, accessible AI chatbot interface
   for the COB website with smooth animations,
   responsive design, and COB brand colors.
   ============================================ */

:root {
    --cob-ai-primary: #7ab51d;
    --cob-ai-primary-hover: #689a19;
    --cob-ai-primary-light: #7ab51d;
    --cob-ai-secondary: #557f14;
    --cob-ai-bg-dark: #1a1a1a;
    --cob-ai-bg-light: #f9fafb;
    --cob-ai-bg-white: #ffffff;
    --cob-ai-text-dark: #111827;
    --cob-ai-text-gray: #6b7280;
    --cob-ai-text-light: #9ca3af;
    --cob-ai-border: #e5e7eb;
    --cob-ai-border-dark: #d1d5db;
    --cob-ai-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --cob-ai-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --cob-ai-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --cob-ai-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --cob-ai-radius: 12px;
    --cob-ai-radius-sm: 8px;
    --cob-ai-radius-full: 9999px;
    --cob-ai-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --cob-ai-z-base: var(--cob-z-chatbot, 9000);
    --cob-ai-z-overlay: calc(var(--cob-z-chatbot, 9000) + 1);
    --cob-ai-z-top: calc(var(--cob-z-chatbot, 9000) + 2);
}

/* ============================================
   WRAPPER & POSITIONING
   ============================================ */

.cob-ai-chatbot {
    position: fixed;
    z-index: var(--cob-ai-z-base);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

/* ==============================================
   ISOLATION RESETS
   Prevent theme CSS (especially body.has-tailwind button)
   from overriding chatbot styles. Uses high specificity.
   ============================================== */
.cob-ai-chatbot *,
.cob-ai-chatbot *::before,
.cob-ai-chatbot *::after {
    box-sizing: border-box;
}

/*
 * Override Tailwind's aggressive button reset:
 *   body.has-tailwind button { background: none; border: none; padding: 0; margin: 0; font: inherit; }
 * Specificity of body.has-tailwind button = 0-1-1
 * We use body.has-tailwind .cob-ai-chatbot button = 0-2-1 to win.
 * For non-Tailwind pages we also add body .cob-ai-chatbot selectors.
 */
/*
 * Reset Tailwind's body.has-tailwind button { background:none; border:none; … }
 * The font-size/line-height overrides are handled by excluding cob-ai-* buttons
 * from the Tailwind rule in tailwind-compiled.css via :not([class*='cob-ai-']).
 */
body .cob-ai-chatbot button,
body .cob-ai-chatbot input,
body .cob-ai-chatbot textarea,
body .cob-ai-chatbot select {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-style: normal;
    text-transform: none;
    letter-spacing: normal;
    -webkit-appearance: none;
    appearance: none;
}

body .cob-ai-chatbot h1,
body .cob-ai-chatbot h2,
body .cob-ai-chatbot h3,
body .cob-ai-chatbot h4 {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.3;
}

.cob-ai-chatbot[data-position="bottom-right"] {
    bottom: 24px;
    right: 24px;
}

.cob-ai-chatbot[data-position="bottom-left"] {
    bottom: 24px;
    left: 24px;
}

.cob-ai-chatbot[data-position="bottom-center"] {
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
}

/* ============================================
   FLOATING ICON BUTTON
   ============================================ */

.cob-ai-icon-trigger {
    position: relative;
    width: 70px;
    height: 70px;
    background: #7ab51d;
    border-radius: var(--cob-ai-radius-full);
    box-shadow: var(--cob-ai-shadow-lg);
    cursor: pointer;
    transition: var(--cob-ai-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--cob-ai-primary);
    outline: none;
}

.cob-ai-icon-trigger:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: var(--cob-ai-shadow-xl);
    background: #689a19;
    border-color: var(--cob-ai-primary-light);
}

.cob-ai-icon-trigger:active {
    transform: scale(0.95);
}

.cob-ai-icon-trigger:focus-visible {
    outline: 3px solid var(--cob-ai-primary-light);
    outline-offset: 2px;
}

.cob-ai-icon-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cob-ai-icon {
    width: 45px;
    height: 45px;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

/* Pulsing animation ring */
.cob-ai-icon-pulse {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: var(--cob-ai-radius-full);
    border: 2px solid var(--cob-ai-primary-light);
    background: transparent;
    opacity: 0;
    animation: cob-ai-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    z-index: 0;
}

@keyframes cob-ai-pulse {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.15);
    }
}

/* Message content glow animation (subtle single pulse) */
@keyframes cob-ai-message-glow-border {
    0%, 15% {
        border-color: rgba(122, 181, 29, 0);
        background-color: var(--cob-ai-bg-light);
    }
    50% {
        border-color: rgba(122, 181, 29, 0.6);
        background-color: rgba(122, 181, 29, 0.08);
    }
    100% {
        border-color: rgba(122, 181, 29, 0);
        background-color: var(--cob-ai-bg-light);
    }
}

/* Expanding ring animation - uitgeschakeld */

.cob-ai-message-content.cob-ai-message-glow {
    position: relative;
    animation: cob-ai-message-glow-border 3s cubic-bezier(0.4, 0, 0.6, 1) forwards;
    border: 2px solid transparent !important;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    overflow: visible;
    z-index: 1;
}


/* Add paragraph spacing for system messages */
.cob-ai-message-content p {
    margin: 0;
    padding-bottom: 0.5em;
}

.cob-ai-message-content p:last-child {
    padding-bottom: 0;
}

/* Notification badge */
.cob-ai-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: var(--cob-ai-radius-full);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: cob-ai-badge-bounce 0.5s ease-out;
}

@keyframes cob-ai-badge-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ============================================
   CHAT CONTAINER
   ============================================ */

.cob-ai-chat-container {
    position: fixed;
    /* 118px: 24 px tussen venster en de zichtbare cirkel van de trigger (= marge onder het icoon) */
    bottom: 118px;
    right: 24px;
    width: 620px;
    max-width: calc(100vw - 48px);
    /* Compact starten: hoogte volgt de inhoud (welkomstbericht) en groeit —
       dankzij de bottom-ankering náár boven — mee met het gesprek, tot de
       oude vaste maat als plafond. */
    height: auto;
    max-height: min(600px, calc(100vh - 140px));
    /* Laat de auto-hoogte meeanimeren waar de browser dat kan (Chrome 129+) */
    interpolate-size: allow-keywords;
    transition: height 0.25s ease;
    background: var(--cob-ai-bg-white);
    border:1px solid var(--cob-ai-border);
    border-radius: var(--cob-ai-radius);
    box-shadow: var(--cob-ai-shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: var(--cob-ai-z-overlay);
    animation: cob-ai-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Overlays binnenin (eerdere gesprekken, zoeken, login/uitlog-lightbox) hebben
   de volle hoogte nodig — anders liggen ze over een klein venstertje. */
.cob-ai-chat-container:has(.cob-ai-history-panel),
.cob-ai-chat-container:has(.cob-ai-logout-overlay) {
    height: min(600px, calc(100vh - 140px));
}

@keyframes cob-ai-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cob-ai-chat-container.minimized {
    height: 60px;
    overflow: hidden;
}

/* VP-17: sleepgreep linksboven — venster verkleinen/vergroten */
.cob-ai-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    cursor: nwse-resize;
    z-index: 6;
    touch-action: none;
}
.cob-ai-resize-handle::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 10px;
    height: 10px;
    border-top: 2px solid #c8cdd4;
    border-left: 2px solid #c8cdd4;
    border-top-left-radius: 5px;
    transition: border-color 0.15s;
}
.cob-ai-resize-handle:hover::before { border-color: var(--cob-ai-primary); }
/* Tijdens het slepen geen hoogte-animatie of tekstselectie */
.cob-ai-chat-container.cob-ai-resizing {
    transition: none;
    user-select: none;
}
.cob-ai-chat-container.minimized .cob-ai-resize-handle { display: none; }
@media (max-width: 768px) {
    .cob-ai-resize-handle { display: none; }
}

/* ============================================
   HEADER
   ============================================ */

.cob-ai-chat-header {
    background: white;
    color: var(--cob-ai-text-dark);
    padding: 14px 20px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--cob-ai-border);
}

.cob-ai-chat-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.cob-ai-chat-title {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.cob-ai-chat-logo {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
}

.cob-ai-chat-title-text {
    flex: 1;
    min-width: 0;
}

.cob-ai-chat-title-text h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--cob-ai-text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

/* "COBot" vet, "AI-assistent" licht — zelfde letter, ander gewicht */
.cob-ai-chat-title-text h3 strong {
    font-weight: 700;
}

.cob-ai-chat-title-text h3 span {
    font-weight: 300;
}

.cob-ai-chat-subtitle {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: var(--cob-ai-text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cob-ai-chat-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cob-ai-chatbot .cob-ai-btn-icon {
    background: var(--cob-ai-bg-light);
    border: none;
    border-radius: var(--cob-ai-radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--cob-ai-transition);
    color: var(--cob-ai-text-gray);
    padding: 0;
    margin: 0;
}

.cob-ai-chatbot .cob-ai-btn-icon:hover {
    background: var(--cob-ai-border);
    color: var(--cob-ai-text-dark);
}

.cob-ai-chatbot .cob-ai-btn-icon:active {
    transform: scale(0.95);
}

/* Focus Dropdown (single-select mode picker) */
.cob-ai-focus-wrapper {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cob-ai-focus-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--cob-ai-text-gray);
    white-space: nowrap;
}

.cob-ai-chatbot .cob-ai-focus-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px !important;
    margin: 0 !important;
    background: white !important;
    border: 1px solid var(--cob-ai-border) !important;
    border-radius: var(--cob-ai-radius-sm);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    color: var(--cob-ai-text-dark);
    cursor: pointer;
    transition: var(--cob-ai-transition);
    white-space: nowrap;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: none;
    box-shadow: none;
}

.cob-ai-chatbot .cob-ai-focus-btn:hover {
    background: var(--cob-ai-bg-light);
    border-color: var(--cob-ai-border-dark);
}

.cob-ai-chatbot .cob-ai-focus-btn:focus {
    outline: none;
    border-color: var(--cob-ai-primary);
    box-shadow: 0 0 0 2px rgba(122, 181, 29, 0.1);
}

.cob-ai-focus-selected {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cob-ai-focus-chevron {
    flex-shrink: 0;
    color: var(--cob-ai-text-gray);
    transition: transform 0.2s ease;
}

.cob-ai-focus-btn[aria-expanded="true"] .cob-ai-focus-chevron {
    transform: rotate(180deg);
}

.cob-ai-focus-dropdown {
    z-index: 10001;
    min-width: 180px;
    background: white;
    border: 1px solid var(--cob-ai-border);
    border-radius: var(--cob-ai-radius-sm);
    box-shadow: var(--cob-ai-shadow-lg);
    max-height: 360px;
    overflow-y: auto;
    display: none;
    /* Dropdown lives on document.body — needs full isolation */
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    box-sizing: border-box;
}

/* Reset buttons inside body-level dropdown */
.cob-ai-focus-dropdown button {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-transform: none;
    letter-spacing: normal;
    -webkit-appearance: none;
    appearance: none;
}

.cob-ai-focus-dropdown.show {
    /* !important: de widget-dropdown leeft op document.body en kan zo door globale
       host-pagina-regels geraakt worden. Op Tailwind-pagina's (modernization-full,
       bv. /projecten/) stampt de archief-JS `tw-hidden` (display:none !important) op
       elk [id$="-dropdown"] — ook op de onze. Hogere specificiteit + !important wint. */
    display: block !important;
    animation: cob-ai-focus-fade-in 0.2s ease;
}

@keyframes cob-ai-focus-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cob-ai-focus-options {
    padding: 4px;
}

.cob-ai-focus-option {
    display: block;
    width: 100%;
    padding: 8px 12px !important;
    margin: 0 !important;
    border: none !important;
    background: none !important;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.15s ease;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    color: var(--cob-ai-text-dark);
    text-align: left;
    text-transform: none !important;
    letter-spacing: normal;
    text-decoration: none;
    box-shadow: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-appearance: none;
    appearance: none;
}

.cob-ai-focus-option:hover {
    background: var(--cob-ai-bg-light) !important;
}

.cob-ai-focus-option.active {
    background: var(--cob-ai-bg-light) !important;
    font-weight: 600 !important;
    color: var(--cob-ai-primary);
}

/* ===== Taalkiezer (vlaggetje) ===== */
.cob-ai-lang-wrapper {
    position: relative;
    display: inline-flex;
}

.cob-ai-chatbot .cob-ai-lang-btn .cob-ai-lang-flag {
    font-size: 18px;
    line-height: 1;
}

.cob-ai-lang-dropdown {
    z-index: 10001;
    min-width: 170px;
    background: white;
    border: 1px solid var(--cob-ai-border);
    border-radius: var(--cob-ai-radius-sm);
    box-shadow: var(--cob-ai-shadow-lg);
    overflow-y: auto;
    display: none;
    padding: 4px;
    box-sizing: border-box;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cob-ai-lang-dropdown.show {
    /* Zie .cob-ai-focus-dropdown.show: !important tegen globale host-hide-regels. */
    display: block !important;
    animation: cob-ai-focus-fade-in 0.2s ease;
}

.cob-ai-lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px !important;
    margin: 0 !important;
    border: none !important;
    background: none !important;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.15s ease;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    color: var(--cob-ai-text-dark);
    text-align: left;
    text-transform: none !important;
    letter-spacing: normal;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.cob-ai-lang-option .cob-ai-lang-flag {
    font-size: 16px;
    line-height: 1;
}

.cob-ai-lang-option:hover {
    background: var(--cob-ai-bg-light) !important;
}

.cob-ai-lang-option.active {
    background: var(--cob-ai-bg-light) !important;
    font-weight: 600 !important;
    color: var(--cob-ai-primary);
}

.cob-ai-content-filter option {
    background: var(--cob-ai-bg-white);
    color: var(--cob-ai-text-dark);
}

/* ============================================
   MESSAGES AREA
   ============================================ */

.cob-ai-messages {
    /* flex-basis auto (niet 0%): de inhoud bepaalt zo de hoogte van het
       compacte venster; bij het hoogteplafond krimpt dit deel en scrollt het. */
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px;
    background: var(--cob-ai-bg-light);
    scroll-behavior: smooth;
}

.cob-ai-messages::-webkit-scrollbar {
    width: 8px;
}

.cob-ai-messages::-webkit-scrollbar-track {
    background: transparent;
}

.cob-ai-messages::-webkit-scrollbar-thumb {
    background: var(--cob-ai-border-dark);
    border-radius: var(--cob-ai-radius-full);
}

.cob-ai-messages::-webkit-scrollbar-thumb:hover {
    background: var(--cob-ai-text-light);
}

/* Message Bubbles */
.cob-ai-message {
    animation: cob-ai-fade-in 0.3s ease-out;
    margin-bottom: 16px;
}

@keyframes cob-ai-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cob-ai-message.user {
    display: flex;
    justify-content: flex-end; /* eigen vragen rechts (bot-antwoorden links) */
}

.cob-ai-message.bot {
    display: flex;
    justify-content: flex-start;
}

.cob-ai-message-content {
    max-width: 90%;
    padding: 12px 16px;
    border-radius: var(--cob-ai-radius);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cob-ai-message.user .cob-ai-message-content {
    background: var(--cob-ai-primary);
    color: white;
    border-bottom-right-radius: 4px; /* "staartje" aan de rechterkant nu de bubbel rechts staat */
}

.cob-ai-message.bot .cob-ai-message-content {
    background: white;
    color: var(--cob-ai-text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: var(--cob-ai-shadow-sm);
    position: relative;
    padding-bottom: 0px; /* Extra space for copy button */
}

/* Markdown Styling in Bot Messages */
.cob-ai-message.bot .cob-ai-message-content h1,
.cob-ai-message.bot .cob-ai-message-content h2,
.cob-ai-message.bot .cob-ai-message-content h3 {
    margin: 10px 0 6px 0;
    font-weight: 600;
    color: var(--cob-ai-text-dark);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

/* De ruimte tússen twee blokken is de grootste van (ondermarge vorige,
   bovenmarge kop) — margin-collapse. De 16px ondermarge van een alinea won het
   daardoor van de kop en gaf te veel lucht boven tussenkopjes. Daarom hier ook
   het blok vóór een kop inkorten; samen met de 10px hierboven wordt het gat 10px. */
.cob-ai-message.bot .cob-ai-message-content p:has(+ h1),
.cob-ai-message.bot .cob-ai-message-content p:has(+ h2),
.cob-ai-message.bot .cob-ai-message-content p:has(+ h3),
.cob-ai-message.bot .cob-ai-message-content ul:has(+ h1),
.cob-ai-message.bot .cob-ai-message-content ul:has(+ h2),
.cob-ai-message.bot .cob-ai-message-content ul:has(+ h3),
.cob-ai-message.bot .cob-ai-message-content ol:has(+ h1),
.cob-ai-message.bot .cob-ai-message-content ol:has(+ h2),
.cob-ai-message.bot .cob-ai-message-content ol:has(+ h3),
.cob-ai-message.bot .cob-ai-message-content table:has(+ h1),
.cob-ai-message.bot .cob-ai-message-content table:has(+ h2),
.cob-ai-message.bot .cob-ai-message-content table:has(+ h3) {
    margin-bottom: 10px;
}

/* Kop als eerste blok in de bubbel: geen gat bovenin. */
.cob-ai-message.bot .cob-ai-message-content > h1:first-child,
.cob-ai-message.bot .cob-ai-message-content > h2:first-child,
.cob-ai-message.bot .cob-ai-message-content > h3:first-child {
    margin-top: 0;
}

.cob-ai-message.bot .cob-ai-message-content h1 {
    font-size: 20px;
    font-weight: 700;
}

.cob-ai-message.bot .cob-ai-message-content h2 {
    font-size: 18px;
    font-weight: 600;
}

.cob-ai-message.bot .cob-ai-message-content h3 {
    font-size: 16px;
    font-weight: 600;
}

.cob-ai-message.bot .cob-ai-message-content p {
    margin: 0px 0px 16px 0px;
    /* De generieke regel (.cob-ai-message-content p) geeft padding-bottom: 0.5em
       voor systeem-/gebruikersberichten. In botberichten stapelt die padding op de
       16px marge (padding collapst niet) → dubbele witruimte. Hier dus uit. */
    padding-bottom: 0;
    line-height: 1.6;
    font-size: 16px;
}

.cob-ai-message.bot .cob-ai-message-content ul {
    margin: 12px 0;
    padding-left: 0;
    margin-left: 24px;
    list-style-type: disc;
    list-style-position: outside;
}

.cob-ai-message.bot .cob-ai-message-content ol {
    margin: 12px 0;
    padding-left: 0;
    margin-left: 24px;
    list-style-type: decimal;
    list-style-position: outside;
}

.cob-ai-message.bot .cob-ai-message-content li {
    margin: 6px 0;
    line-height: 1.6;
    padding-left: 4px;
    font-size: 16px;
}

.cob-ai-message.bot .cob-ai-message-content ul ul,
.cob-ai-message.bot .cob-ai-message-content ol ol,
.cob-ai-message.bot .cob-ai-message-content ul ol,
.cob-ai-message.bot .cob-ai-message-content ol ul {
    margin: 6px 0;
    margin-left: 20px;
}

/* Kopje/label direct boven een lijst (bv. **Leden:** of een echt heading) hoort
   visueel bij díe lijst: strak eronder, ruimer erboven — zodat de witruimte onder
   het kopje kleiner is dan erboven (dat scheidt het van het vorige blok).
   :not(:first-child) — begint het antwoord meteen met zo'n kopje, dan is er geen
   vorig blok om van te scheiden en zou die 20px alleen een gat bovenin geven. */
.cob-ai-message.bot .cob-ai-message-content p:has(+ ul):not(:first-child),
.cob-ai-message.bot .cob-ai-message-content p:has(+ ol):not(:first-child),
.cob-ai-message.bot .cob-ai-message-content h1:has(+ ul):not(:first-child),
.cob-ai-message.bot .cob-ai-message-content h2:has(+ ul):not(:first-child),
.cob-ai-message.bot .cob-ai-message-content h3:has(+ ul):not(:first-child),
.cob-ai-message.bot .cob-ai-message-content h1:has(+ ol):not(:first-child),
.cob-ai-message.bot .cob-ai-message-content h2:has(+ ol):not(:first-child),
.cob-ai-message.bot .cob-ai-message-content h3:has(+ ol):not(:first-child) {
    margin-top: 14px;
    margin-bottom: 4px;
}

/* Zo'n kopje áls eerste element: geen bovenmarge, wel de strakke onderkant
   zodat het bij zijn lijst blijft horen. */
.cob-ai-message.bot .cob-ai-message-content p:has(+ ul):first-child,
.cob-ai-message.bot .cob-ai-message-content p:has(+ ol):first-child,
.cob-ai-message.bot .cob-ai-message-content h1:has(+ ul):first-child,
.cob-ai-message.bot .cob-ai-message-content h2:has(+ ul):first-child,
.cob-ai-message.bot .cob-ai-message-content h3:has(+ ul):first-child,
.cob-ai-message.bot .cob-ai-message-content h1:has(+ ol):first-child,
.cob-ai-message.bot .cob-ai-message-content h2:has(+ ol):first-child,
.cob-ai-message.bot .cob-ai-message-content h3:has(+ ol):first-child {
    margin-top: 0;
    margin-bottom: 4px;
}

/* De lijst die direct op zo'n kopje volgt krijgt geen eigen top-marge meer,
   anders wint de grootste marge (margin-collapse) en ontstaat er alsnog te veel ruimte. */
.cob-ai-message.bot .cob-ai-message-content p + ul,
.cob-ai-message.bot .cob-ai-message-content p + ol,
.cob-ai-message.bot .cob-ai-message-content h1 + ul,
.cob-ai-message.bot .cob-ai-message-content h2 + ul,
.cob-ai-message.bot .cob-ai-message-content h3 + ul,
.cob-ai-message.bot .cob-ai-message-content h1 + ol,
.cob-ai-message.bot .cob-ai-message-content h2 + ol,
.cob-ai-message.bot .cob-ai-message-content h3 + ol {
    margin-top: 0;
}

.cob-ai-message.bot .cob-ai-message-content a {
    color: var(--cob-ai-primary);
    text-decoration: underline;
    transition: color 0.2s ease;
}

/* Streaming: onafgemaakte link alvast als link gestyled (anti-flikker, zie _maskIncompleteLinks) */
.cob-ai-message.bot .cob-ai-message-content .cob-ai-link-pending {
    color: var(--cob-ai-primary);
    text-decoration: underline;
}

.cob-ai-message.bot .cob-ai-message-content a:hover {
    color: var(--cob-ai-secondary);
}

.cob-ai-message.bot .cob-ai-message-content code {
    background: var(--cob-ai-bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Courier New', Courier, monospace;
}

.cob-ai-message.bot .cob-ai-message-content pre {
    background: var(--cob-ai-bg-dark);
    color: white;
    padding: 12px;
    border-radius: var(--cob-ai-radius-sm);
    overflow-x: auto;
    margin: 8px 0;
}

.cob-ai-message.bot .cob-ai-message-content pre code {
    background: none;
    padding: 0;
}

.cob-ai-message.bot .cob-ai-message-content blockquote {
    border-left: 4px solid var(--cob-ai-primary);
    padding-left: 12px;
    margin: 8px 0;
    color: var(--cob-ai-text-gray);
    font-style: italic;
}

.cob-ai-message.bot .cob-ai-message-content strong {
    font-weight: 600;
    color: var(--cob-ai-text-dark);
}

.cob-ai-message.bot .cob-ai-message-content em {
    font-style: italic;
}

/* Tables */
.cob-ai-message.bot .cob-ai-message-content table {
    /* display:block + overflow-x zodat een brede tabel (nowrap-koppen zoals
       "Ingenieursdiensten") bínnen de tekstbubbel scrollt i.p.v. eruit te steken. */
    display: block;
    width: max-content;
    max-width: 100%;
    border-collapse: collapse;
    border-radius: var(--cob-ai-radius-sm);
    overflow-x: auto;
    font-size: 16px;
    line-height: 1.6;
    margin: 0.75em 0;
    border: 1px solid var(--cob-ai-border);
}

.cob-ai-message.bot .cob-ai-message-content thead tr {
    border-bottom: 2px solid #c8d89a;
}

.cob-ai-message.bot .cob-ai-message-content th {
    padding: 6px 7px;
    text-align: left;
    font-weight: 600;
    color: var(--cob-ai-secondary);
    font-size: 15px;
    white-space: nowrap;
}

.cob-ai-message.bot .cob-ai-message-content td {
    padding: 6px 7px;
    font-size: 15px;
    vertical-align: top;
    border-top: 1px solid var(--cob-ai-border);
    color: var(--cob-ai-text-dark);
}


/* Message Action Buttons (thumbs + copy) */
.cob-ai-message-actions {
    position: absolute;
    bottom: 0px;
    right: -40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.cob-ai-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white !important;
    border: none !important;
    border-radius: 6px;
    padding: 6px !important;
    width: 32px;
    height: 32px;
    color: var(--cob-ai-text-light) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit !important;
}

.cob-ai-action-btn:hover {
    background: var(--cob-ai-bg-light) !important;
    color: var(--cob-ai-text-dark) !important;
}

.cob-ai-action-btn:active {
    transform: scale(0.95);
}

.cob-ai-action-btn svg {
    flex-shrink: 0;
}

/* Neutrale knop (score 2) alleen in expert-modus; voor gewone gebruikers verborgen. */
.cob-ai-action-btn.thumbs-neutral {
    display: none;
}
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-neutral {
    display: inline-flex;
}

/* Thumbs up/down active states — zachte tint + gekleurd icoon i.p.v. een vol
   gevulde knop: de kleur blijft een accent, de kolom blijft rustig. */
.cob-ai-action-btn.thumbs-up.active {
    background: #f2f7e6 !important;
    color: #55700a !important;
    box-shadow: inset 0 0 0 1.5px #b7cf7a;
    border-radius: 6px;
}

.cob-ai-action-btn.thumbs-neutral.active {
    background: #fdf6e3 !important;
    color: #8a5d10 !important;
    box-shadow: inset 0 0 0 1.5px #e0c98e;
    border-radius: 6px;
}

.cob-ai-action-btn.thumbs-down.active {
    background: #fdf0ec !important;
    color: #9a4526 !important;
    box-shadow: inset 0 0 0 1.5px #e5b3a4;
    border-radius: 6px;
}

/* Expertmodus: duimpjes moeten opvallen — ze dragen hun accentkleur al vóór je
   erop klikt (de zachte tint die ze anders pas geactiveerd kregen). Aanklikken
   maakt de knop vol gevuld: dichte achtergrondkleur met een wit, gevuld duimpje. */
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-up {
    background: #f2f7e6 !important;
    color: #55700a !important;
}
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-neutral {
    background: #fdf6e3 !important;
    color: #8a5d10 !important;
}
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-down {
    background: #fdf0ec !important;
    color: #9a4526 !important;
}
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-up:hover {
    box-shadow: inset 0 0 0 1.5px #b7cf7a;
}
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-neutral:hover {
    box-shadow: inset 0 0 0 1.5px #e0c98e;
}
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-down:hover {
    box-shadow: inset 0 0 0 1.5px #e5b3a4;
}
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-up.active {
    background: #7ab51d !important;
    color: #ffffff !important;
    box-shadow: none;
}
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-neutral.active {
    background: #b07d12 !important;
    color: #ffffff !important;
    box-shadow: none;
}
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-down.active {
    background: #b34a26 !important;
    color: #ffffff !important;
    box-shadow: none;
}
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-up.active svg,
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-neutral.active svg,
html.cob-ai-expert-active .cob-ai-action-btn.thumbs-down.active svg {
    fill: currentColor;   /* dicht duimpje: gevuld, niet alleen lijnwerk */
}

/* Copy button success state */
.cob-ai-action-btn.cob-ai-copy-button.copied {
    background: rgba(122, 181, 29, 0.1) !important;
    color: var(--cob-ai-primary) !important;
}

/* Feedback textarea (shown after thumbs click) */
.cob-ai-feedback-textarea-wrap {
    margin-top: 10px;
    margin-bottom: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* VP-18: label boven het feedbackveld — maakt het onderscheid met het
   chatveld expliciet (experts typten hier hun volgende vraag). */
.cob-ai-feedback-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin: 0 0 6px 2px;
}

/* VP-18: hint + knop wanneer de feedbacktekst op een chatvraag lijkt */
.cob-ai-feedback-vraaghint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 6px;
    padding: 7px 9px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 12px;
    color: #78716c;
}
.cob-ai-feedback-vraaghint[hidden] { display: none; }
body .cob-ai-chatbot .cob-ai-feedback-alsvraag-btn,
body.has-tailwind .cob-ai-chatbot .cob-ai-feedback-alsvraag-btn {
    padding: 4px 10px !important;
    background: #fff !important;
    color: var(--cob-ai-text-dark) !important;
    border: 1px solid #d6d3d1 !important;
    border-radius: 6px;
    font-size: 12px !important;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
body .cob-ai-chatbot .cob-ai-feedback-alsvraag-btn:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-feedback-alsvraag-btn:hover {
    border-color: var(--cob-ai-primary) !important;
    color: var(--cob-ai-primary) !important;
}

.cob-ai-feedback-textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.4;
}

.cob-ai-feedback-textarea:focus {
    outline: none;
    border-color: var(--cob-ai-primary);
    box-shadow: 0 0 0 2px rgba(122, 181, 29, 0.15);
}

body .cob-ai-chatbot .cob-ai-feedback-submit-btn,
body.has-tailwind .cob-ai-chatbot .cob-ai-feedback-submit-btn {
    display: block;
    margin-top: 6px;
    padding: 5px 14px !important;
    background: var(--cob-ai-primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px;
    font-size: 12px !important;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

body .cob-ai-chatbot .cob-ai-feedback-submit-btn:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-feedback-submit-btn:hover {
    background: #6e8a07 !important;
}

body .cob-ai-chatbot .cob-ai-feedback-submit-btn:disabled,
body.has-tailwind .cob-ai-chatbot .cob-ai-feedback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Blijvend, bewerkbaar feedbackblok — tekst blijft zichtbaar onder het antwoord.
   Het BLOK is bewust neutraal voor elke score; alleen het scorechipje draagt de
   kleur (goed = groen, deels = amber, niet goed = terracotta). Zo blijft de chat
   rustig en is de score toch in één oogopslag te zien. */
.cob-ai-feedback-saved {
    --fb-bg: #f7f8f7;
    --fb-border: #e3e6e1;
    --fb-accent: #6b7280;
    --fb-chip-border: #d5d9d2;
    margin-top: 10px;
    /* De bubbel zelf heeft padding-bottom: 0 (ruimte voor de kopieerknop), dus
       de blokken die eronder hangen brengen hun eigen onderruimte mee. */
    margin-bottom: 12px;
    padding: 10px 12px;
    background: var(--fb-bg);
    border: 1px solid var(--fb-border);
    border-radius: 10px;
}

.cob-ai-feedback-saved.is-score-3 {
    --fb-accent: #55700a;
    --fb-chip-border: #c9dc93;
}

/* Zelfde amber als de actieve "wel en niet goed"-duim, zodat chip en knop rijmen */
.cob-ai-feedback-saved.is-score-2 {
    --fb-accent: #8a5d10;
    --fb-chip-border: #e6d3a3;
}

.cob-ai-feedback-saved.is-score-1 {
    --fb-accent: #9a4526;
    --fb-chip-border: #ecc4b8;
}

.cob-ai-feedback-saved-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 5px;
}

.cob-ai-feedback-saved-chip {
    text-transform: none;
    letter-spacing: normal;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px 2px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--fb-chip-border);
    color: var(--fb-accent);
}

.cob-ai-feedback-saved-text {
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    color: #1f2937;
}

/* Secundaire knop (aanpassen/annuleren): neutraal, zodat hij bij elke scorekleur past */
body .cob-ai-chatbot .cob-ai-feedback-edit-btn,
body.has-tailwind .cob-ai-chatbot .cob-ai-feedback-edit-btn {
    margin-top: 8px;
    padding: 3px 12px !important;
    background: rgba(255, 255, 255, 0.7) !important;
    color: #4b5563 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px;
    font-size: 12px !important;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}

body .cob-ai-chatbot .cob-ai-feedback-edit-btn:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-feedback-edit-btn:hover {
    background: #ffffff !important;
    border-color: #9ca3af !important;
}

/* Eén vervolgactie onder het antwoord, passend bij de gegeven score */
.cob-ai-score-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: -4px 0 12px;
    font-size: 12.5px;
    color: #4b5563;
}
/* Knoppenrij onderin het beoordelingskaartje: "Aanpassen" links, de vervolgactie
   rechts. Staat de actie los onder het antwoord (geen toelichting gegeven), dan
   houdt .cob-ai-score-actions hierboven zijn eigen marge. */
.cob-ai-feedback-saved-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.cob-ai-feedback-saved-actions .cob-ai-score-actions {
    margin: 0 0 0 auto;   /* duwt de vervolgactie naar rechts */
}
/* Alle knoppen in deze rij even hoog: "Feedback aanpassen" (direct kind) kreeg
   de kleinere basispadding + eigen margin en stak daardoor af tegen de
   vervolgactie ("⭐ Bewaar als voorbeeldantwoord"). */
body .cob-ai-chatbot .cob-ai-feedback-saved-actions .cob-ai-feedback-edit-btn,
body.has-tailwind .cob-ai-chatbot .cob-ai-feedback-saved-actions .cob-ai-feedback-edit-btn {
    margin-top: 0;
    padding: 5px 14px !important;
}
/* Statusregel (⭐ voorbeeldantwoord): geen actieknop maar een mededeling — die
   krijgt een eigen volle regel bóven "Aanpassen", links uitgelijnd. */
.cob-ai-feedback-saved-actions .cob-ai-score-actions--status {
    flex-basis: 100%;
    order: -1;
    margin: 0 0 2px;
    justify-content: flex-start;
}

/* Rond vraagteken-knopje naast een actie; opent het uitlegvenster. */
.cob-ai-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid #d5ddc4;
    border-radius: 50%;
    background: #fff;
    color: #6b7a52;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cob-ai-info-btn:hover,
.cob-ai-info-btn:focus-visible {
    background: #f2f6e8;
    border-color: #7ab51d;
    color: #41521f;
}
.cob-ai-info-btn .cob-ai-icon { width: 14px; height: 14px; }

/* Knoppen met een icoon: icoon en tekst op één regel naast elkaar. Zonder deze
   flex-regel valt de SVG op een eigen regel (de knop zelf is inline-block en
   het thema zet svg's op display:block). Zelfde specificiteit als de
   basisstyling hierboven, anders wint die. */
body .cob-ai-chatbot .cob-ai-tryagain-btn,
body.has-tailwind .cob-ai-chatbot .cob-ai-tryagain-btn,
body .cob-ai-chatbot .cob-ai-example-btn,
body.has-tailwind .cob-ai-chatbot .cob-ai-example-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
body .cob-ai-chatbot .cob-ai-feedback-edit-btn .cob-ai-icon,
body.has-tailwind .cob-ai-chatbot .cob-ai-feedback-edit-btn .cob-ai-icon {
    display: block;
    width: 14px;
    height: 14px;
    margin: 0;
    flex: 0 0 auto;
}

/* ===== Uitlegvenster (info-lightbox) ===== */
.cob-ai-info-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
    animation: cob-ai-info-fade 0.15s ease-out;
}
@keyframes cob-ai-info-fade { from { opacity: 0; } to { opacity: 1; } }
.cob-ai-info-panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px 22px 22px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.cob-ai-info-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.cob-ai-info-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: #2f3b1c;
}
.cob-ai-info-close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
}
.cob-ai-info-close:hover,
.cob-ai-info-close:focus-visible { background: #f1f5f9; color: #111827; }
.cob-ai-info-text {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.55;
    color: #374151;
}
.cob-ai-info-text:last-child { margin-bottom: 0; }

/* ===== Voortgangsbalk (nieuw antwoord genereren) ===== */
.cob-ai-progress {
    height: 4px;
    margin-top: 8px;
    border-radius: 999px;
    background: #e4ebd3;
    overflow: hidden;
}
.cob-ai-progress-bar {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7ab51d, #7ab51d);
    transition: width 0.25s ease-out;
}
.cob-ai-score-actions-note {
    font-weight: 600;
    color: #55700a;
}
body .cob-ai-chatbot .cob-ai-score-actions .cob-ai-feedback-edit-btn,
body.has-tailwind .cob-ai-chatbot .cob-ai-score-actions .cob-ai-feedback-edit-btn {
    margin-top: 0;
    padding: 5px 14px !important;
}

body .cob-ai-chatbot .cob-ai-linkbtn,
body.has-tailwind .cob-ai-chatbot .cob-ai-linkbtn {
    padding: 0 !important;
    background: none !important;
    border: none !important;
    color: var(--cob-ai-primary) !important;
    font-size: 12.5px !important;
    font-weight: 600;
    font-family: inherit;
    text-decoration: underline;
    cursor: pointer;
}

body .cob-ai-chatbot .cob-ai-linkbtn:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-linkbtn:hover {
    color: #6e8a07 !important;
}

/* Expert name prompt */
.cob-ai-expert-name-prompt {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    min-width: 220px;
}

.cob-ai-expert-name-prompt label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.cob-ai-expert-name-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 6px;
}

.cob-ai-expert-name-input:focus {
    outline: none;
    border-color: var(--cob-ai-primary);
    box-shadow: 0 0 0 2px rgba(122, 181, 29, 0.15);
}

.cob-ai-expert-name-save {
    width: 100%;
    padding: 6px 12px;
    background: var(--cob-ai-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.cob-ai-expert-name-save:hover {
    background: #6e8a07;
}

/* Legacy alias */
.cob-ai-copy-button-container {
    position: absolute;
    bottom: 0px;
    right: -40px;
}

/* System message - filter info */
.cob-ai-message.bot.system-filter .cob-ai-message-content {
    background: rgba(122, 181, 29, 0.08);
    border-left: 4px solid var(--cob-ai-primary);
    font-size: 13px;
    padding: 8px 14px;
}

.cob-ai-message.bot.system-filter .cob-ai-message-content::before {
    content: "🔍 ";
}

/* Message timestamp */
.cob-ai-message-time {
    font-size: 11px;
    color: var(--cob-ai-text-light);
    margin-top: 4px;
    text-align: right;
}

.cob-ai-message.bot .cob-ai-message-time {
    text-align: left;
}

/* Welcome message with quick actions */
.cob-ai-welcome-message {
    background: white;
    padding: 20px;
    border-radius: var(--cob-ai-radius);
    box-shadow: var(--cob-ai-shadow);
    margin-bottom: 16px;
}

/* Compact starten: zolang het welkomstbericht het laatste (enige) element is,
   geen extra marge eronder — de ondermarge is pas nodig zodra er berichten
   onder komen. Scheelt loze ruimte in het initiële venster. */
.cob-ai-messages > .cob-ai-welcome-message:last-child {
    margin-bottom: 0;
}

.cob-ai-welcome-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--cob-ai-text-dark);
    margin-bottom: 8px;
}

.cob-ai-welcome-text {
    color: var(--cob-ai-text-gray);
    margin-bottom: 0;
    line-height: 1.5;
}

.cob-ai-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.cob-ai-chatbot .cob-ai-quick-action-btn {
    background: var(--cob-ai-bg-light);
    border: 1px solid var(--cob-ai-border);
    border-radius: var(--cob-ai-radius-sm);
    padding: 12px 16px;
    margin: 0;
    font-size: 15px !important;
    color: var(--cob-ai-text-dark);
    cursor: pointer;
    transition: var(--cob-ai-transition);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cob-ai-chatbot .cob-ai-quick-action-btn:hover {
    background: var(--cob-ai-primary-light);
    color: white;
    border-color: var(--cob-ai-primary-light);
    transform: translateY(-1px);
    box-shadow: var(--cob-ai-shadow);
}

.cob-ai-quick-action-btn svg {
    flex-shrink: 0;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */

.cob-ai-typing-indicator {
    padding: 12px 20px;
    background: var(--cob-ai-bg-white);
    border-top: 1px solid var(--cob-ai-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cob-ai-typing-dots {
    display: flex;
    gap: 4px;
}

.cob-ai-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cob-ai-primary);
    animation: cob-ai-typing-bounce 1.4s infinite ease-in-out both;
}

.cob-ai-typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.cob-ai-typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes cob-ai-typing-bounce {
    0%, 80%, 100% {
        opacity: 0.4;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.cob-ai-typing-text {
    font-size: 14px;
    color: var(--cob-ai-text-gray);
    font-style: italic;
}

/* ============================================
   INPUT AREA
   ============================================ */

.cob-ai-input-area {
    flex-shrink: 0;
    background: var(--cob-ai-bg-white);
    border-top: 1px solid var(--cob-ai-border);
    padding: 16px;
}

.cob-ai-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cob-ai-bg-light);
    border: 2px solid var(--cob-ai-border);
    border-radius: var(--cob-ai-radius);
    padding: 8px;
    transition: var(--cob-ai-transition);
}

.cob-ai-input-container:focus-within {
    border-color: var(--cob-ai-primary);
    background: white;
}

.cob-ai-clear-btn {
    background: transparent;
    color: var(--cob-ai-text-light);
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.cob-ai-clear-btn:hover {
    background: var(--cob-ai-bg-light);
    color: var(--cob-ai-text-gray);
}

.cob-ai-question-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    color: var(--cob-ai-text-dark);
    /* height:auto is bewust expliciet: sommige pagina-stylesheets zetten een
       globale `textarea { height: 230px }` — op cob.nl doet
       assets/css/tunneloverzicht-main.css dat op /tunnelopgave/. Onze class
       (specificiteit 0-1-0) wint van dat kale `textarea` (0-0-1), zodat het veld
       op de natuurlijke 1-regel-hoogte start i.p.v. tegen max-height te lopen.
       GEEN !important: de auto-resize-JS zet een inline height die nog moet winnen. */
    height: auto;
    box-sizing: border-box;
    min-height: 24px;
    max-height: 120px;
    padding: 6px 0;
    /* Geen scrollbalk zolang het veld meegroeit. Windows tekent (anders dan
       macOS) een klassieke scrollbalk met pijltjes zodra scrollHeight door
       DPI-afronding 1px boven de gezette hoogte uitkomt. De auto-resize-JS zet
       overflow-y pas op auto als de tekst niet meer binnen max-height past. */
    overflow-y: hidden;
    scrollbar-width: thin;
}

.cob-ai-question-input::placeholder {
    color: var(--cob-ai-text-light);
}

.cob-ai-input-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: contain;
}

.cob-ai-chatbot .cob-ai-send-btn,
.cob-ai-widget-inline .cob-ai-send-btn {
    background: #7ab51d !important;
    border: none !important;
    border-radius: var(--cob-ai-radius-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--cob-ai-transition);
    color: white !important;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
}

.cob-ai-chatbot .cob-ai-send-btn:hover,
.cob-ai-widget-inline .cob-ai-send-btn:hover {
    background: #689a19 !important;
    transform: translateY(-1px);
    box-shadow: var(--cob-ai-shadow);
}

.cob-ai-chatbot .cob-ai-send-btn:active,
.cob-ai-widget-inline .cob-ai-send-btn:active {
    transform: translateY(0);
}

.cob-ai-chatbot .cob-ai-send-btn:disabled,
.cob-ai-widget-inline .cob-ai-send-btn:disabled {
    background: var(--cob-ai-border);
    cursor: not-allowed;
    transform: none;
}

.cob-ai-input-hint {
    margin-top: 8px;
    text-align: center;
    display: none;
}

.cob-ai-hint-text {
    font-size: 12px;
    color: var(--cob-ai-text-light);
}

.cob-ai-hint-text kbd {
    background: var(--cob-ai-bg-light);
    border: 1px solid var(--cob-ai-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-family: inherit;
}

/* ============================================
   OVERLAY (Mobile backdrop)
   ============================================ */

.cob-ai-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--cob-ai-z-overlay) - 1);
    animation: cob-ai-overlay-fade-in 0.3s ease-out;
}

@keyframes cob-ai-overlay-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .cob-ai-chat-container {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        height: 80vh;
        max-height: 80vh;
        border-radius: var(--cob-ai-radius) var(--cob-ai-radius) 0 0;
        animation: cob-ai-slide-up-mobile 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    @keyframes cob-ai-slide-up-mobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .cob-ai-icon-trigger {
        width: 56px;
        height: 56px;
    }
    
    .cob-ai-icon {
        width: 32px;
        height: 32px;
    }
    
    .cob-ai-message-content {
        max-width: 90%;
    }
    
    .cob-ai-quick-actions {
        grid-template-columns: 1fr;
    }

    /* iOS Safari zoomt de hele pagina in zodra een invoerveld met letters
       kleiner dan 16px focus krijgt, en zoomt daarna niet terug: het
       chatvenster (100% breed) valt dan rechts buiten beeld. Vanaf 16px
       blijft de zoom achterwege. (Bug gemeld 27-08-2026.) */
    .cob-ai-question-input,
    .cob-ai-feedback-textarea {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    /* Triggerknopje netjes in de hoek: bottom en right gelijk */
    .cob-ai-chatbot[data-position="bottom-right"],
    .cob-ai-chatbot[data-position="bottom-left"] {
        right: 16px;
        left: auto;
        bottom: 16px;
    }
    
    .cob-ai-chat-header {
        padding: 12px 14px;
    }

    /* Eén headerrij: de knoppen staan naast de titel (geen dubbele header).
       De titel krimpt met ellipsis als het krap wordt; alleen de focus-kiezer
       wrapt naar een eigen regel. */
    .cob-ai-chat-header-content {
        flex-wrap: wrap;
        gap: 6px;
    }

    .cob-ai-chat-title {
        flex: 1 1 0;
        min-width: 0;
    }

    .cob-ai-chat-logo {
        width: 32px;
        height: 32px;
    }

    .cob-ai-chat-title-text h3 {
        font-size: 14px;
    }

    .cob-ai-focus-wrapper {
        order: 3;
        width: 100%;
    }

    .cob-ai-focus-btn {
        width: 100%;
        justify-content: space-between;
    }

    .cob-ai-focus-selected {
        max-width: none;
    }

    .cob-ai-chat-actions {
        order: 2;
        flex-shrink: 0;
        gap: 4px;
    }

    .cob-ai-chat-actions .cob-ai-btn-icon {
        width: 30px;
        height: 30px;
    }

    .cob-ai-chat-actions .cob-ai-btn-icon svg {
        width: 18px;
        height: 18px;
    }

    .cob-ai-messages {
        padding: 16px 12px;
    }

    .cob-ai-input-area {
        padding: 12px;
    }
}

/* Heel smalle schermen: alleen "COBot" in de titel, zodat de knoppen ernaast passen */
@media (max-width: 359px) {
    .cob-ai-chat-title-text h3 span {
        display: none;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .cob-ai-chatbot {
        display: none !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.cob-ai-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
#cob-ai-clear-chat{
    display: none;
}
/* Sub-action chips for two-step quick actions */
.cob-ai-sub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.cob-ai-chatbot .cob-ai-sub-action-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    margin: 0;
    background: var(--cob-ai-bg-primary);
    border: 1.5px solid var(--cob-ai-primary);
    border-radius: 20px;
    color: var(--cob-ai-primary);
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cob-ai-chatbot .cob-ai-sub-action-chip:hover {
    background: var(--cob-ai-primary);
    color: #fff;
}

.cob-ai-chatbot .cob-ai-sub-action-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Taalhulp bar (fixed under header, admin only) ─
   Selectors prefixed with .cob-ai-chatbot to beat
   Tailwind's body.has-tailwind button reset.
   ─────────────────────────────────────────────────── */

.cob-ai-chatbot .cob-ai-th-bar {
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid var(--cob-ai-border);
    flex-shrink: 0;
}

.cob-ai-chatbot .cob-ai-th-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cob-ai-chatbot .cob-ai-th-bar-label {
    font: 600 14px/1.3 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--cob-ai-text-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

.cob-ai-chatbot .cob-ai-th-bar-options {
    display: flex;
    gap: 6px;
    flex: 1;
}

.cob-ai-chatbot .cob-ai-th-bar-info {
    font: 400 12px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    padding: 8px 0 0;
    color: #64748b;
}

.cob-ai-chatbot .cob-ai-th-bar-info .cob-ai-th-bar-warn {
    color: #92400e;
}

.cob-ai-chatbot .cob-ai-th-bar-info-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cob-ai-chatbot .cob-ai-th-bar-info-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cob-ai-chatbot .cob-ai-th-bar-info-sep {
    color: #d1d5db;
    font-weight: 300;
}

.cob-ai-chatbot .cob-ai-th-bar-info-ok {
    color: #16a34a;
    font-weight: 600;
}

.cob-ai-chatbot .cob-ai-th-bar-info-dates {
    font: 400 11px/1.3 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #94a3b8;
    margin-top: 4px;
}

.cob-ai-chatbot .cob-ai-th-bar-view-btn {
    font: 600 11px/1.3 Inter, system-ui, -apple-system, "Segoe UI", sans-serif !important;
    background: var(--cob-ai-primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 5px 12px !important;
    margin: 0 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: background 0.15s !important;
}

.cob-ai-chatbot .cob-ai-th-bar-view-btn:hover {
    background: var(--cob-ai-primary-hover) !important;
}

.cob-ai-chatbot .cob-ai-th-bar-btn {
    font: 500 13px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif !important;
    flex: 1;
    padding: 8px 8px !important;
    margin: 0 !important;
    border: 1px solid var(--cob-ai-border) !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: var(--cob-ai-text-dark) !important;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    text-align: center;
    box-shadow: none;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
}

.cob-ai-chatbot .cob-ai-th-bar-btn:hover {
    border-color: var(--cob-ai-primary) !important;
    background: #fafdf5 !important;
}

.cob-ai-chatbot .cob-ai-th-bar-btn--primary {
    font-weight: 600;
}

.cob-ai-chatbot .cob-ai-th-bar-btn.selected {
    border-color: var(--cob-ai-primary) !important;
    background: #f0f5e0 !important;
    color: var(--cob-ai-primary-hover) !important;
}

.cob-ai-chatbot .cob-ai-th-bar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Focus styles for keyboard navigation */
.cob-ai-quick-action-btn:focus-visible,
.cob-ai-sub-action-chip:focus-visible,
.cob-ai-content-filter:focus-visible {
    outline: 3px solid var(--cob-ai-primary-light);
    outline-offset: 2px;
}

/* Textarea has no separate outline or border - container handles focus state */
.cob-ai-question-input:focus,
.cob-ai-question-input:focus-visible {
    outline: none;
    border: none;
    box-shadow: none;
}

/* ============================================
   INLINE WIDGET (CMS)
   ============================================ */

.cob-ai-widget-inline {
    max-height: 500px;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.4s ease;
    position: relative;
    z-index: 1;
}

.cob-ai-widget-input-area {
    border-radius: var(--cob-ai-radius);
}

/* Alleen in widget: padding 0. Uitgeklapt venster behoudt standaard padding. */
.cob-ai-widget-inline .cob-ai-widget-input-area {
    padding: 0;
}

/* Uitgeklapt AI-chatbot venster: herstel padding (basisregel, expliciet voor duidelijkheid) */
#cob-ai-chat-container .cob-ai-input-area {
    padding: 16px;
}

@media (max-width: 480px) {
    #cob-ai-chat-container .cob-ai-input-area {
        padding: 12px;
    }
}

.cob-ai-widget-input-area.cob-ai-widget-input-area {
    border-top: none;
}

/* Widget: messages area (uitklapt bij eerste vraag) */
.cob-ai-widget-messages {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cob-ai-widget-expanded .cob-ai-widget-messages {
    max-height: 400px;
    min-height: 120px;
    overflow-y: auto;
    padding: 12px 0;
    margin-bottom: 12px;
}

.cob-ai-widget-expanded .cob-ai-widget-messages::-webkit-scrollbar {
    width: 8px;
}

.cob-ai-widget-expanded .cob-ai-widget-messages::-webkit-scrollbar-thumb {
    background: var(--cob-ai-border-dark);
    border-radius: 4px;
}

.cob-ai-widget-expanded .cob-ai-widget-messages .cob-ai-message {
    margin-bottom: 12px;
}

.cob-ai-widget-expanded .cob-ai-widget-messages .cob-ai-message:last-child {
    margin-bottom: 0;
}

/* Alleen Home 2025: grote groene titel */
.cob-ai-home-title {
    font-size: 2.25rem !important;
    font-weight: 600 !important;
    color: rgb(141 198 63) !important;
    line-height: 1.2 !important;
    letter-spacing: -0.025em !important;
    margin-bottom: 1.5rem !important;
    font-family: inherit !important;
}

/* Widget-variant: alleen AI-antwoorden padding links 0, gebruiker behoudt padding */
.rich-text + .cob-ai-widget-inline .cob-ai-message.bot .cob-ai-message-content {
    padding-left: 0;
}

.cob-ai-widget-open-venster {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--cob-ai-border);
    position: relative;
    z-index: 2;
}

.cob-ai-widget-open-venster-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 10px 20px !important;
    background: rgb(141 198 63) !important;
    border: none !important;
    border-radius: var(--cob-ai-radius);
    color: #fff !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.cob-ai-widget-open-venster-btn:hover {
    background: rgb(92 140 36) !important;
    transform: translateY(-1px);
    box-shadow: var(--cob-ai-shadow);
}

.cob-ai-widget-open-venster-btn:active {
    transform: translateY(0);
}

/* Morph: widget collapses (legacy, niet meer gebruikt bij nieuwe flow) */
.cob-ai-widget-morphed {
    opacity: 0;
    max-height: 0 !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}

.cob-ai-widget-morphed .cob-ai-widget-title,
.cob-ai-widget-morphed .cob-ai-input-area {
    opacity: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   TAALHULP — Admin-only panel integrated in chatbot
   ═══════════════════════════════════════════════════════════ */

/* Admin bar — sub-header for taalhulp controls */
.cob-ai-admin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #fff;
    border-bottom: 2px solid var(--cob-ai-border, #e5e7eb);
    flex-shrink: 0;
    gap: 8px;
}

.cob-ai-admin-bar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.cob-ai-admin-bar-right {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.cob-ai-admin-bar-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cob-ai-secondary);
    flex-shrink: 0;
}

.cob-ai-admin-bar-select {
    padding: 5px 8px;
    border: 1px solid var(--cob-ai-border, #e5e7eb);
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
    color: #333;
    max-width: 110px;
}

.cob-ai-admin-bar-btn {
    padding: 5px 12px;
    background: var(--cob-ai-primary, #7ab51d);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s;
    line-height: 1.4;
}

.cob-ai-admin-bar-btn:hover { background: var(--cob-ai-primary-hover, #689a19); }
.cob-ai-admin-bar-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cob-ai-admin-bar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.12s;
}

.cob-ai-admin-bar-link:hover {
    background: rgba(0,0,0,0.06);
}

/* Panel replaces messages area when showing results */
.cob-ai-taalhulp-panel {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.cob-ai-th-panel-back {
    padding: 8px 12px;
    border-top: 1px solid var(--cob-ai-border);
    flex-shrink: 0;
    text-align: center;
}

.cob-ai-th-panel-results {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.cob-ai-th-panel-empty {
    text-align: center;
    padding: 40px 24px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.6;
}

.cob-ai-th-panel-loading {
    text-align: center;
    padding: 40px 24px;
    color: #94a3b8;
}

.cob-ai-th-panel-loading p { margin-top: 12px; font-size: 13px; }

.cob-ai-th-panel-footer {
    display: flex;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--cob-ai-border);
    flex-shrink: 0;
}

.cob-ai-th-panel-link {
    font-size: 12px;
    color: var(--cob-ai-primary);
    text-decoration: none;
    font-weight: 500;
}

.cob-ai-th-panel-link:hover { text-decoration: underline; }

/* Score ring */
.cob-ai-th-score-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
}

.cob-ai-th-score--good { background: #dcfce7; color: #16a34a; }
.cob-ai-th-score--medium { background: #fef3c7; color: #d97706; }
.cob-ai-th-score--low { background: #fee2e2; color: #dc2626; }

/* Summary */
.cob-ai-th-panel-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.cob-ai-th-panel-summary small { color: #94a3b8; font-size: 12px; }

.cob-ai-th-panel-success {
    text-align: center;
    padding: 30px 24px;
}

.cob-ai-th-panel-success .cob-ai-th-score-ring {
    margin: 0 auto 12px;
}

.cob-ai-th-panel-success p {
    color: #16a34a;
    font-weight: 600;
    font-size: 14px;
}

/* Field blocks */
.cob-ai-th-panel-field {
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 16px;
}

.cob-ai-th-panel-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.cob-ai-th-panel-field-score { font-size: 12px; font-weight: 600; }

.cob-ai-th-panel-field-summary {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Corrections */
.cob-ai-th-panel-correction {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
}

.cob-ai-th-panel-badge {
    display: inline-block;
    width: 72px;
    text-align: center;
    padding: 2px 0;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    margin-top: 2px;
}

.cob-ai-th-panel-badge--spelling { background: #fbd4e4; color: #ed1164; }
.cob-ai-th-panel-badge--jargon { background: #d6effa; color: #0081bd; }
.cob-ai-th-panel-badge--schrijfwijzer { background: #fde5cf; color: #f58222; }
.cob-ai-th-panel-badge--toon { background: #e8f5d6; color: #6b9a1e; }
.cob-ai-th-panel-badge--zinsbouw { background: #fef9c3; color: #ca8a04; }

.cob-ai-th-panel-correction-body { flex: 1; min-width: 0; }
.cob-ai-th-panel-correction-old { color: #dc2626; text-decoration: line-through; margin-bottom: 2px; }
.cob-ai-th-panel-correction-new { color: #16a34a; font-weight: 500; margin-bottom: 2px; }
.cob-ai-th-panel-correction-why { color: #94a3b8; font-style: italic; font-size: 11px; line-height: 1.4; }

/* ═══════════════════════════════════════════════════════════
   PER-WIDGET AI CHECK BUTTONS + TOOLTIP
   ═══════════════════════════════════════════════════════════ */

.cob-ai-widget-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f0f7e4;
    border: 1.5px solid #7ab51d;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 10px;
    opacity: 1;
    transition: background 0.15s, transform 0.12s;
    flex-shrink: 0;
}

.cob-ai-widget-check:hover {
    background: #e2f0c8;
    transform: scale(1.08);
}

.cob-ai-widget-check:disabled {
    opacity: 0.4;
    cursor: wait;
    transform: none;
}

.cob-ai-widget-check-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--cob-ai-primary);
    border-radius: 50%;
    animation: cob-spin 0.6s linear infinite;
}

@keyframes cob-spin { to { transform: rotate(360deg); } }

/* Widget tooltip */
.cob-ai-widget-tooltip {
    position: absolute;
    top: 42px;
    right: 6px;
    width: 380px;
    max-height: 420px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    z-index: 100;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    color: #1e293b;
}

.cob-ai-wt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.cob-ai-wt-score {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}
.cob-ai-wt-score--good { background: #dcfce7; color: #16a34a; }
.cob-ai-wt-score--medium { background: #fef3c7; color: #d97706; }
.cob-ai-wt-score--low { background: #fee2e2; color: #dc2626; }

.cob-ai-wt-header-text { flex: 1; font-size: 13px; }

.cob-ai-wt-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #94a3b8;
    padding: 0 4px;
    line-height: 1;
}
.cob-ai-wt-close:hover { color: #1e293b; }

.cob-ai-wt-body {
    padding: 10px 16px;
    max-height: 280px;
    overflow-y: auto;
}

.cob-ai-wt-item {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f8fafc;
}
.cob-ai-wt-item:last-child { border-bottom: none; }

.cob-ai-wt-badge {
    display: inline-block;
    width: 72px;
    text-align: center;
    padding: 2px 0;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-top: 2px;
}
.cob-ai-wt-badge--spelling { background: #fbd4e4; color: #ed1164; }
.cob-ai-wt-badge--jargon { background: #d6effa; color: #0081bd; }
.cob-ai-wt-badge--schrijfwijzer { background: #fde5cf; color: #f58222; }
.cob-ai-wt-badge--toon { background: #e8f5d6; color: #6b9a1e; }
.cob-ai-wt-badge--zinsbouw { background: #fef9c3; color: #ca8a04; }

.cob-ai-wt-item-body { flex: 1; min-width: 0; }
.cob-ai-wt-old { color: #dc2626; text-decoration: line-through; font-size: 12px; margin-bottom: 1px; }
.cob-ai-wt-new { color: #16a34a; font-weight: 500; font-size: 12px; margin-bottom: 1px; }
.cob-ai-wt-why { color: #94a3b8; font-style: italic; font-size: 11px; line-height: 1.4; }

.cob-ai-wt-footer {
    padding: 8px 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.cob-ai-wt-footer a {
    color: var(--cob-ai-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}
.cob-ai-wt-footer a:hover { text-decoration: underline; }

/* ── Taalhulp status in admin bar ───────────────── */
.cob-ai-th-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    font-size: 11px;
    line-height: 1;
}

.cob-ai-th-status-score {
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}
.cob-ai-th-status-score--good { background: #dcfce7; color: #16a34a; }
.cob-ai-th-status-score--medium { background: #fef3c7; color: #d97706; }
.cob-ai-th-status-score--low { background: #fee2e2; color: #dc2626; }

.cob-ai-th-status-date {
    color: #94a3b8;
    font-size: 10px;
}

.cob-ai-th-status-warning {
    color: #d97706;
    font-size: 11px;
    font-weight: 500;
}

.cob-ai-admin-bar-btn--sm {
    padding: 2px 8px !important;
    font-size: 10px !important;
    min-height: 0 !important;
}

/* ═══════════════════════════════════════════════════
   REVIEW OVERLAY (Modus B: Full-page review)
   ═══════════════════════════════════════════════════ */

.cob-ai-review-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #f8fafc;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cob-ai-review-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cob-ai-review-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cob-ai-review-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cob-ai-review-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.cob-ai-review-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 15px;
    border: 3px solid;
}
.cob-ai-review-score--good { border-color: #16a34a; color: #16a34a; background: #f0fdf4; }
.cob-ai-review-score--medium { border-color: #d97706; color: #d97706; background: #fffbeb; }
.cob-ai-review-score--low { border-color: #dc2626; color: #dc2626; background: #fef2f2; }

.cob-ai-review-stats {
    font-size: 13px;
    color: #64748b;
}

.cob-ai-review-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cob-ai-review-legend-item {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 8px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--badge-color) 12%, white);
    color: var(--badge-color);
}

.cob-ai-review-mode-toggle {
    display: flex;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.cob-ai-review-mode-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}
.cob-ai-review-mode-btn:hover { background: #f1f5f9; }
.cob-ai-review-mode-btn.active {
    background: #1e293b;
    color: #fff;
}

.cob-ai-review-close {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cob-ai-review-close:hover { background: #f1f5f9; color: #1e293b; }

/* Review content area */
.cob-ai-review-content {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 24px;
}

/* Per-field review block */
.cob-ai-review-field {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.cob-ai-review-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.cob-ai-review-field-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.cob-ai-review-field-score {
    font-weight: 700;
    font-size: 13px;
}

.cob-ai-review-field-body {
    display: flex;
    min-height: 100px;
}

/* Left: original text with highlights */
.cob-ai-review-text {
    flex: 1;
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
    border-right: 1px solid #e2e8f0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Right: margin comments */
.cob-ai-review-comments {
    width: 280px;
    min-width: 280px;
    padding: 12px;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual margin comment */
.cob-ai-review-comment {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid var(--comment-color, #94a3b8);
    border-radius: 4px;
    padding: 10px;
    font-size: 12px;
    line-height: 1.5;
    position: relative;
}

.cob-ai-review-comment-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 1px 5px;
    border-radius: 2px;
    margin-bottom: 6px;
    background: color-mix(in srgb, var(--comment-color) 12%, white);
    color: var(--comment-color);
}

.cob-ai-review-comment-old {
    color: #dc2626;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.cob-ai-review-comment-new {
    color: #16a34a;
    font-weight: 500;
    margin-bottom: 4px;
}

.cob-ai-review-comment-why {
    color: #64748b;
    font-style: italic;
    margin-bottom: 8px;
}

.cob-ai-review-comment-actions {
    display: flex;
    gap: 6px;
}

.cob-ai-review-accept,
.cob-ai-review-reject {
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.cob-ai-review-accept {
    background: #f0fdf4;
    border-color: #86efac;
    color: #16a34a;
}
.cob-ai-review-accept:hover { background: #dcfce7; }

.cob-ai-review-reject {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}
.cob-ai-review-reject:hover { background: #fee2e2; }

.cob-ai-review-comment.accepted {
    opacity: 0.4;
    border-left-color: #16a34a;
}
.cob-ai-review-comment.rejected {
    opacity: 0.3;
    border-left-color: #dc2626;
    text-decoration: line-through;
}

/* Inline highlight in review text */
.cob-ai-review-highlight {
    padding: 1px 2px;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.15s;
}
.cob-ai-review-highlight--spelling { background: rgba(220, 38, 38, 0.12); border-bottom: 2px solid #dc2626; }
.cob-ai-review-highlight--jargon { background: rgba(8, 145, 178, 0.10); border-bottom: 2px solid #0891b2; }
.cob-ai-review-highlight--schrijfwijzer { background: rgba(74, 124, 89, 0.10); border-bottom: 2px solid #4a7c59; }
.cob-ai-review-highlight--toon { background: rgba(192, 38, 211, 0.10); border-bottom: 2px solid #c026d3; }
.cob-ai-review-highlight--zinsbouw { background: rgba(202, 138, 4, 0.10); border-bottom: 2px solid #ca8a04; }

.cob-ai-review-highlight:hover { filter: brightness(0.92); }
.cob-ai-review-highlight.active { outline: 2px solid var(--comment-color); outline-offset: 1px; }

/* Summary bar at top */
.cob-ai-review-summary {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* Responsive: stack on narrow screens */
@media (max-width: 768px) {
    .cob-ai-review-field-body { flex-direction: column; }
    .cob-ai-review-comments { width: 100%; min-width: 0; border-top: 1px solid #e2e8f0; }
    .cob-ai-review-text { border-right: none; }
    .cob-ai-review-header { flex-direction: column; gap: 10px; padding: 10px 16px; }
    .cob-ai-review-header-right { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════
   GRAMMARLY MODE (Modus A: Inline op pagina)
   ═══════════════════════════════════════════════════ */

/* Margin comments sidebar (injected into page) */
.cob-ai-margin-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: #fafbfc;
    border-left: 1px solid #e2e8f0;
    overflow-y: auto;
    z-index: 99999;
    padding: 90px 16px 24px;
    box-shadow: -4px 0 16px rgba(0,0,0,0.08);
    font-family: "Segoe UI", Helvetica, Arial, sans-serif;
    transition: transform 0.25s ease;
}

.cob-ai-margin-sidebar.cob-ai-sidebar-collapsed {
    transform: translateX(100%);
}

.cob-ai-margin-sidebar-header {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
    font-family: "Segoe UI", Helvetica, Arial, sans-serif;
    transition: transform 0.25s ease;
}

.cob-ai-margin-sidebar-header.cob-ai-sidebar-collapsed {
    transform: translateX(100%);
}

/* Reopen tab: zichtbaar als sidebar ingeklapt, verborgen als open */
.cob-ai-sidebar-reopen-tab {
    position: fixed;
    top: 96px;
    right: 16px;
    z-index: 99998;
    padding: 8px 14px 8px 12px;
    background: #fff;
    color: #374151;
    border: 2px solid #7ab51d;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(122, 181, 29, .2);
    display: none;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: box-shadow .15s, border-color .15s;
}
.cob-ai-sidebar-reopen-tab:hover {
    border-color: #689a19;
    box-shadow: 0 3px 16px rgba(122, 181, 29, .3);
}

.cob-ai-sidebar-reopen-tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #7ab51d;
    color: #fff;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 6px;
}

/* Reopen tab: toon als sidebar ingeklapt */
body:not(.cob-ai-grammarly-active) .cob-ai-sidebar-reopen-tab {
    display: flex;
    align-items: center;
}

/* Zorg dat reopen-tab niet achter scrollbar verdwijnt */
@supports (scrollbar-gutter: stable) {
    .cob-ai-sidebar-reopen-tab { right: env(scrollbar-width, 15px); }
}


.cob-ai-margin-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.cob-ai-sidebar-filters {
    display: flex;
    gap: 4px;
}

/* Beat Tailwind's body.has-tailwind button { font: inherit } with
   a font shorthand + !important. Individual props don't win against shorthand. */
body .cob-ai-sidebar-filter {
    font: 600 10px/1.2 "Segoe UI", Helvetica, Arial, sans-serif !important;
    flex: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 3px 0 !important;
    border-radius: 4px !important;
    border: none !important;
    background: color-mix(in srgb, var(--filter-color) 15%, white) !important;
    color: var(--filter-color) !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
    text-transform: uppercase !important;
    letter-spacing: 0.2px !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.cob-ai-sidebar-filter.active {
    opacity: 1 !important;
}

.cob-ai-sidebar-filter:not(.active) {
    opacity: 0.35 !important;
}

.cob-ai-sidebar-filter:hover {
    opacity: 1 !important;
}

.cob-ai-sidebar-filter-count {
    font: 700 9px/1 "Segoe UI", Helvetica, Arial, sans-serif !important;
}

.cob-ai-margin-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

body .cob-ai-margin-sidebar-close {
    font: normal 18px/1 sans-serif !important;
    width: 28px !important;
    height: 28px !important;
    border: none !important;
    background: none !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
}
body .cob-ai-margin-sidebar-close:hover { background: #f1f5f9 !important; color: #64748b !important; }

/* Margin comment (in sidebar) */
.cob-ai-margin-comment {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--comment-color, #94a3b8);
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.6;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.cob-ai-margin-comment:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.cob-ai-margin-comment.active { box-shadow: 0 0 0 2px var(--comment-color); }
.cob-ai-margin-comment.cob-ai-section-hidden { display: none !important; }

.cob-ai-margin-comment-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 7px;
    border-radius: 3px;
    margin-bottom: 6px;
    background: color-mix(in srgb, var(--comment-color) 12%, white);
    color: var(--comment-color);
}

.cob-ai-margin-comment-old {
    color: #dc2626;
    text-decoration: line-through;
    font-size: 13px;
    margin-bottom: 2px;
}

.cob-ai-margin-comment-new {
    color: #16a34a;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.cob-ai-margin-comment-why {
    color: #64748b;
    font-size: 12px;
    margin: 6px 0 0;
    line-height: 1.5;
}

.cob-ai-margin-comment-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

body .cob-ai-margin-accept,
body .cob-ai-margin-reject {
    font: 600 11px/1.2 "Segoe UI", Helvetica, Arial, sans-serif !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    border: 1px solid !important;
    background: #fff !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
    margin: 0 !important;
}
.cob-ai-margin-accept {
    border-color: #86efac !important;
    color: #16a34a !important;
}
.cob-ai-margin-accept:hover {
    background: #f0fdf4 !important;
}
.cob-ai-margin-reject {
    border-color: #fecaca !important;
    color: #dc2626 !important;
}
.cob-ai-margin-reject:hover {
    background: #fef2f2 !important;
}

.cob-ai-margin-comment.accepted {
    opacity: 0.35;
    border-left-color: #16a34a;
}
.cob-ai-margin-comment.rejected {
    opacity: 0.25;
    border-left-color: #e2e8f0;
}

/* Inline highlights on the actual page (Grammarly mode) */
mark.cob-ai-inline-mark {
    padding: 1px 2px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
}
mark.cob-ai-inline-mark--spelling { background: rgba(237, 17, 100, 0.15); border-bottom: 2px solid #ed1164; }
mark.cob-ai-inline-mark--jargon { background: rgba(0, 161, 228, 0.12); border-bottom: 2px solid #00a1e4; }
mark.cob-ai-inline-mark--schrijfwijzer { background: rgba(245, 130, 34, 0.12); border-bottom: 2px solid #f58222; }
mark.cob-ai-inline-mark--toon { background: rgba(153, 204, 51, 0.15); border-bottom: 2px solid #99cc33; }
mark.cob-ai-inline-mark--zinsbouw { background: rgba(202, 138, 4, 0.12); border-bottom: 2px solid #ca8a04; }

mark.cob-ai-inline-mark:hover { filter: brightness(0.9); }
mark.cob-ai-inline-mark.active { outline: 2px solid; outline-offset: 1px; }

/* Push page content left when sidebar is open */
body.cob-ai-grammarly-active {
    margin-right: 380px;
    transition: margin-right 0.3s ease;
}

/* ═══════════════════════════════════════════════════
   PROJECT PREVIEW MODE (AI-tekst suggesties)
   ═══════════════════════════════════════════════════ */

/* Block-level highlight on AI-generated section containers */
.cob-ai-preview-section-active {
    position: relative;
    border-left: 3px solid #7ab51d !important;
    border-radius: 4px;
    padding-left:10px;
    transition: box-shadow 0.2s;
}
.cob-ai-preview-section-active.active {
    box-shadow: 0 0 0 2px rgba(122, 181, 29, 0.35);
}

/* Inline tekst-toggle knoppen (Nieuwe tekst / Oude tekst) */
body .cob-ai-text-toggle-group {
    display: inline-flex !important;
    float: none !important;
    margin: 12px 0 0 0 !important;
    border-radius: 5px !important;
    border: none !important;
    overflow: hidden !important;
    background: #7ab51d !important;
    clear: both !important;
}

body .cob-ai-text-toggle-btn {
    font: 600 10px/1.2 "Segoe UI", Helvetica, Arial, sans-serif !important;
    padding: 4px 10px !important;
    border: none !important;
    background: transparent !important;
    color: #fff !important;
    cursor: pointer !important;
    transition: background 0.12s !important;
    letter-spacing: 0.2px !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}

body .cob-ai-text-toggle-btn + .cob-ai-text-toggle-btn {
    border-left: 1px solid rgba(255, 255, 255, 0.3) !important;
}

body .cob-ai-text-toggle-btn.active {
    background: #689a19 !important;
}

body .cob-ai-text-toggle-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Leeg-state in sidebar als er nog geen taalcheck is */
.cob-ai-sidebar-empty {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    padding: 28px 16px;
    line-height: 1.5;
}

/* Sidebar: count hint (zichtbaar / verborgen) */
.cob-ai-sidebar-count-hint {
    font-size: 11px;
    color: #94a3b8;
    padding: 4px 16px 6px;
    border-bottom: 1px solid #f1f5f9;
}
.cob-ai-sidebar-count-hint em {
    font-style: normal;
    color: #cbd5e1;
}


/* ── Floating WYSIWYG toolbar ─────────────────────────────── */
.cob-ai-floating-toolbar {
    display: none;
    align-items: center;
    gap: 2px;
    padding: 5px 8px;
    background: #1e293b;
    border-radius: 8px;
    position: fixed;
    z-index: 100000;
    transform: translateX(-50%);
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    pointer-events: auto;
}
.cob-ai-floating-toolbar.visible { display: flex; }

.cob-ai-floating-toolbar::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1e293b;
}

.cob-ai-floating-toolbar button {
    padding: 4px 7px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}
.cob-ai-floating-toolbar button:hover { background: #475569; color: #fff; }

.cob-ai-toolbar-sep {
    width: 1px;
    height: 18px;
    background: #475569;
    margin: 0 2px;
}

/* Bewerkbare tekst in inline editmode */
.cob-ai-text-editing {
    outline: 2px solid #7ab51d !important;
    border-radius: 4px !important;
    padding: 4px 6px !important;
    min-height: 40px;
    cursor: text;
    background: rgba(99, 102, 241, 0.03) !important;
}

/* Review-balk: niet meer in gebruik (publiceren is linksonder, taalsuggesties in sidebar) */

/* Publiceren knop: fixed linksonder */
body .cob-ai-publish-btn-fixed,
body button#cob-ai-publish-btn-fixed {
    position: fixed !important;
    bottom: 16px !important;
    left: 16px !important;
    z-index: 99998 !important;
    padding: 10px 28px !important;
    border-radius: 24px !important;
    border: none !important;
    background: #7ab51d !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    transition: background 0.15s, box-shadow 0.15s !important;
    white-space: nowrap !important;
    letter-spacing: .3px !important;
    text-transform: uppercase !important;
    box-shadow: 0 2px 12px rgba(122, 181, 29, .3) !important;
}
body .cob-ai-publish-btn-fixed:hover {
    background: #689a19 !important;
    box-shadow: 0 4px 16px rgba(92, 140, 36, .4) !important;
}
body .cob-ai-publish-btn-fixed:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Geen bovenbalk meer — geen extra padding nodig */

/* Tab badges in sidebar header */
.cob-ai-preview-header-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.cob-ai-sidebar-tab-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.cob-ai-sidebar-tab-badge--ai {
    background: rgba(99, 102, 241, 0.1);
    color: #7ab51d;
    border: 1px solid rgba(99, 102, 241, 0.25);
}
.cob-ai-sidebar-tab-badge--taal {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Group dividers in sidebar */
.cob-ai-sidebar-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 2px 6px;
    margin-top: 6px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 10px;
}
.cob-ai-sidebar-group-header:first-child {
    margin-top: 0;
    padding-top: 0;
}
.cob-ai-sidebar-group-header--taal {
    margin-top: 18px;
}

.cob-ai-sidebar-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
}

.cob-ai-sidebar-group-count {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
}

/* Preview card extras (extends .cob-ai-margin-comment) */
.cob-ai-preview-card {
    cursor: pointer;
}

.cob-ai-preview-card-label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 5px;
}

.cob-ai-preview-card-text {
    font-size: 12px;
    color: #475569;
    line-height: 1.55;
    margin-bottom: 10px;
}

/* Section wrapper inside preview card (new vs old) */
.cob-ai-preview-card-section {
    margin-bottom: 8px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.cob-ai-preview-card-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 5px 8px 3px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.cob-ai-preview-card-section-label--new {
    color: #7ab51d;
    background: rgba(99, 102, 241, 0.05);
    border-bottom-color: rgba(99, 102, 241, 0.15);
}

.cob-ai-preview-card-text--new,
.cob-ai-preview-card-text--old {
    font-size: 12px;
    line-height: 1.55;
    padding: 6px 8px;
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 0;
}

.cob-ai-preview-card-text--new {
    color: #1e293b;
}

.cob-ai-preview-card-text--old {
    color: #64748b;
}

/* DOM toggle button */
.cob-ai-preview-dom-toggle {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.cob-ai-preview-dom-toggle:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #1e293b;
}

/* Section highlighting when showing old (published) text */
.cob-ai-preview-section-old {
    border-left: 3px solid #94a3b8 !important;
    border-radius: 4px;
    padding-left: 10px;
    color: inherit;
}

/* Normalize text color: both new and old sections use the same page color */
.cob-ai-preview-section-active,
.cob-ai-preview-section-old {
    color: #374151;
}

/* Versheidsnotificatie (concept nieuwer dan taalcheck) */
.cob-ai-freshness-notice {
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 0;
    border-top: 1px solid #fde68a;
    border-bottom: 1px solid #fde68a;
    margin: 0 -12px 0;
}

/* Taalcheck herhalen-knop in panel header */
.cob-ai-margin-sidebar-top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cob-ai-run-taalcheck-btn {
    font-size: 11px;
    font-weight: 600;
    color: #7ab51d;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 5px;
    padding: 3px 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.cob-ai-run-taalcheck-btn:hover {
    background: #e0e7ff;
}

/* ═══════════════════════════════════════════════════
   FULLSCREEN LOADER
   ═══════════════════════════════════════════════════ */

.cob-ai-fullscreen-loader {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cob-ai-loader-content {
    background: #fff;
    border-radius: 16px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-width: 360px;
}

.cob-ai-loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--cob-ai-primary, #4a7c59);
    border-radius: 50%;
    animation: cob-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.cob-ai-loader-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
}

.cob-ai-loader-status {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 4px;
}

.cob-ai-loader-progress-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 16px 0 12px;
}

.cob-ai-loader-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cob-ai-primary, #4a7c59), #16a34a);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}

.cob-ai-loader-sub {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

/* ═══════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════ */

.cob-ai-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100002;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.cob-ai-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    pointer-events: auto;
    animation: cob-toast-in 0.3s ease;
    max-width: 360px;
}

@keyframes cob-toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.cob-ai-toast--success { border-left: 4px solid #16a34a; }
.cob-ai-toast--warning { border-left: 4px solid #d97706; }
.cob-ai-toast--error { border-left: 4px solid #dc2626; }
.cob-ai-toast--info { border-left: 4px solid #3b82f6; }

.cob-ai-toast-icon { font-size: 16px; flex-shrink: 0; }
.cob-ai-toast-message { flex: 1; }

.cob-ai-toast-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   PAGE NOTIFICATION (top-right card with AI icon)
   ═══════════════════════════════════════════════════ */

.cob-ai-page-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 999999;
    width: 260px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06);
    transform: translateX(300px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
    pointer-events: auto;
}

.cob-ai-page-notification.visible {
    transform: translateX(0);
    opacity: 1;
}

.cob-ai-page-notif-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 0;
    font-size: 13px;
    color: #1e293b;
}

body .cob-ai-page-notif-close {
    font: normal 16px/1 sans-serif !important;
    position: absolute !important;
    top: 6px !important;
    right: 8px !important;
    background: none !important;
    border: none !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    padding: 2px !important;
    margin: 0 !important;
}
body .cob-ai-page-notif-close:hover { color: #64748b !important; }

.cob-ai-page-notif-body {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #475569;
}

body .cob-ai-page-notif-action {
    font: 600 12px/1.3 "Segoe UI", Helvetica, Arial, sans-serif !important;
    display: block !important;
    width: 100% !important;
    padding: 8px !important;
    background: var(--cob-ai-primary, #7ab51d) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0 0 10px 10px !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
    margin: 0 !important;
    text-align: center !important;
}
body .cob-ai-page-notif-action:hover { filter: brightness(1.1); }

/* ===== Afbeeldingen: thumbnail-strip + lightbox ===== */
/* Gallery zit BINNEN de tekstbubbel → zelfde breedte als de tekst (geen full-width). */
body .cob-ai-images { margin-top: 10px !important; width: 100% !important; }
body .cob-ai-gallery {
    display: grid !important; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)) !important;
    gap: 8px !important;
}
/* Kaart: beeld boven, caption als nette voet eronder. Neutrale rand (gelijk aan het chatvenster),
   witte caption, één regel met ellipsis — geen lelijk afbreken (het is een impressie; volledige
   titel staat in de tooltip). */
body .cob-ai-thumb {
    display: flex !important; flex-direction: column !important; width: 100% !important; padding: 0 !important;
    border: 1px solid var(--cob-ai-border, #e5e7eb) !important; border-radius: 10px !important; overflow: hidden !important;
    cursor: pointer !important; background: #fff !important; text-align: left !important;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease !important;
}
body .cob-ai-thumb:hover {
    transform: translateY(-2px) !important; box-shadow: 0 6px 16px rgba(0,0,0,.16) !important;
    border-color: var(--cob-ai-border-dark, #d1d5db) !important;
}
body .cob-ai-thumb img {
    display: block !important; width: 100% !important; aspect-ratio: 4 / 3 !important; height: auto !important;
    object-fit: cover !important; margin: 0 !important; max-width: none !important; background: #f0f0f0 !important;
}
body .cob-ai-thumb-cap {
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
    padding: 5px 8px 6px !important; font-size: 10px !important; line-height: 1.3 !important;
    color: #444 !important; font-weight: 600 !important; background: #fff !important;
    border-top: 1px solid #f0f1f3 !important;
}
/* Inline afbeelding (render='inline'): figuur tussen de tekst i.p.v. strip onderaan. */
body .cob-ai-inline-image {
    position: relative !important; display: block !important; margin: 12px 0 !important;
    max-width: 360px !important; border: 1px solid var(--cob-ai-border, #e5e7eb) !important;
    border-radius: 10px !important; overflow: hidden !important; background: #fff !important;
    cursor: zoom-in !important;
    transition: box-shadow .15s ease, border-color .15s ease !important;
}
body .cob-ai-inline-image:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,.14) !important;
    border-color: var(--cob-ai-border-dark, #d1d5db) !important;
}
body .cob-ai-inline-image img {
    display: block !important; width: 100% !important; height: auto !important;
    margin: 0 !important; max-width: none !important; background: #f0f0f0 !important;
}
body .cob-ai-inline-image figcaption {
    padding: 6px 10px 8px !important; font-size: 11px !important; line-height: 1.35 !important;
    color: #555 !important; background: #fff !important; border-top: 1px solid #f0f1f3 !important;
}
body .cob-ai-lightbox {
    display: none !important; position: fixed !important; inset: 0 !important; z-index: 999999 !important;
    background: rgba(0,0,0,.78) !important; align-items: center !important; justify-content: center !important; padding: 24px !important;
}
body .cob-ai-lightbox.is-open { display: flex !important; }
body .cob-ai-lb-inner { position: relative !important; max-width: 92vw !important; max-height: 92vh !important; display: flex !important; flex-direction: column !important; }
body .cob-ai-lb-img { max-width: 92vw !important; max-height: 80vh !important; object-fit: contain !important; border-radius: 6px !important; background: #fff !important; margin: 0 !important; }
body .cob-ai-lb-close {
    position: absolute !important; top: -14px !important; right: -14px !important; width: 34px !important; height: 34px !important;
    border-radius: 50% !important; border: none !important; background: #fff !important; color: #222 !important;
    font-size: 22px !important; line-height: 1 !important; cursor: pointer !important; box-shadow: 0 2px 8px rgba(0,0,0,.3) !important;
}
body .cob-ai-lb-bar {
    display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 12px !important;
    margin-top: 10px !important; color: #fff !important; font-size: 13px !important;
}
body .cob-ai-lb-cap { opacity: .9 !important; }
body .cob-ai-lb-link {
    display: inline-flex !important; align-items: center !important; gap: 4px !important;
    background: #7ab51d !important; color: #fff !important; border: none !important; cursor: pointer !important;
    font-weight: 600 !important; font-size: 13px !important; white-space: nowrap !important;
    padding: 7px 14px !important; border-radius: 999px !important; text-decoration: none !important;
    transition: background .15s ease !important;
}
body .cob-ai-lb-link:hover { background: #689a19 !important; text-decoration: none !important; }
body .cob-ai-lb-actions { display: inline-flex !important; align-items: center !important; gap: 8px !important; flex-shrink: 0 !important; }
body .cob-ai-lb-ext {
    display: inline-flex !important; align-items: center !important; gap: 4px !important;
    background: transparent !important; color: #fff !important; border: 1px solid rgba(255,255,255,.55) !important; cursor: pointer !important;
    font-weight: 600 !important; font-size: 13px !important; white-space: nowrap !important;
    padding: 6px 13px !important; border-radius: 999px !important; text-decoration: none !important;
    transition: background .15s ease, border-color .15s ease !important;
}
body .cob-ai-lb-ext:hover { background: rgba(255,255,255,.15) !important; border-color: #fff !important; text-decoration: none !important; }

/* ===== Vision-upload: paperclip-knop, preview, drag-drop ===== */
body .cob-ai-attach-btn {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    width: 36px !important; height: 36px !important; padding: 0 !important; margin: 0 4px !important;
    border: none !important; background: none !important; color: #6b7a3a !important;
    cursor: pointer !important; border-radius: 8px !important; flex: 0 0 auto !important;
}
body .cob-ai-attach-btn:hover { background: rgba(122, 181, 29,.12) !important; color: #5a6b1f !important; }
body .cob-ai-image-preview { padding: 6px 8px 0 !important; }
body .cob-ai-image-chip {
    display: flex !important; align-items: center !important; gap: 10px !important;
    background: #fff !important; border: 1px solid #dbe3bf !important; border-radius: 10px !important;
    padding: 8px 10px !important; max-width: 100% !important;
    box-shadow: 0 1px 2px rgba(31, 41, 20, 0.06) !important;
}
/* Naam en type onder elkaar; de naam mag krimpen, de knop nooit. */
body .cob-ai-image-chip-text {
    display: flex !important; flex-direction: column !important; gap: 1px !important;
    min-width: 0 !important; flex: 1 1 auto !important;
}
body .cob-ai-image-chip-meta {
    font-size: 11px !important; color: #78826a !important; line-height: 1.3 !important;
    white-space: nowrap !important;
}
body .cob-ai-image-chip img { width: 40px !important; height: 40px !important; object-fit: cover !important; border-radius: 6px !important; margin: 0 !important; max-width: none !important; }
body .cob-ai-image-chip-doc {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    width: 36px !important; height: 36px !important; border-radius: 6px !important;
    background: #fff !important; border: 1px solid #dbe3bf !important; font-size: 20px !important;
    flex: 0 0 auto !important;
}
body .cob-ai-image-chip-name {
    font-size: 13px !important; color: #2f3a1c !important; font-weight: 600 !important;
    line-height: 1.35 !important; max-width: 100% !important;
    overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important;
}
body .cob-ai-image-chip-remove {
    border: none !important; background: none !important; cursor: pointer !important;
    font-size: 17px !important; line-height: 1 !important; color: #8a927e !important;
    padding: 0 !important; width: 24px !important; height: 24px !important;
    border-radius: 50% !important; flex: 0 0 auto !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    transition: background-color .15s, color .15s !important;
}
body .cob-ai-image-chip-remove:hover { color: #c0392b !important; background: #f6e7e4 !important; }
body .cob-ai-user-image {
    display: block !important; max-width: 200px !important; max-height: 160px !important;
    border-radius: 10px !important; margin-top: 6px !important; object-fit: cover !important;
}
body .cob-ai-user-file {
    display: inline-flex !important; align-items: center !important; gap: 6px !important;
    margin-top: 6px !important; padding: 5px 10px !important; border-radius: 10px !important;
    background: rgba(255,255,255,0.18) !important; font-size: 12px !important; max-width: 220px !important;
    overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important;
}
body .cob-ai-dragover { outline: 2px dashed #7ab51d !important; outline-offset: -6px !important; }

/* ============================================
   EXPERT-REVIEWSESSIES (uitnodigingslink)
   ============================================ */

/* 🔁-knop: alleen in expert-modus én pas als het antwoord niet goed was
   (score 1 of 2 → .cob-ai-msg-improve op het bericht). */
.cob-ai-action-btn.cob-ai-regen-btn {
    display: none;
}
html.cob-ai-expert-active .cob-ai-message.cob-ai-msg-improve .cob-ai-action-btn.cob-ai-regen-btn {
    display: inline-flex;
}

/* Geregenereerde antwoorden: herkenbaar "alleen voor jou"-blok, zonder streep.
   .cob-ai-message.bot is een flexrij; hier moet het chipje juist BOVEN het
   antwoord staan, dus zetten we deze bubbel terug op block. De bubbel zelf
   blijft wit zoals elk botantwoord; alleen het badge-chipje draagt de kleur. */
.cob-ai-message.cob-ai-regen-bubble {
    display: block;
}
.cob-ai-message.cob-ai-regen-bubble .cob-ai-message-content {
    background: white;
    border: 1px solid #e3e6e1;
}
.cob-ai-regen-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #55700a;
    background: #eef3dc;
    border: 1px solid #dde6c2;
    border-radius: 20px;
    padding: 2px 10px 3px;
    margin-bottom: 6px;
}

/* Keuzepaneel "feedback meenemen?" vóór het regenereren — neutraal blok */
.cob-ai-regen-panel {
    margin-top: 10px;
    margin-bottom: 12px;
    padding: 9px 12px;
    background: #f7f8f7;
    border: 1px solid #e3e6e1;
    border-radius: 8px;
}
.cob-ai-regen-steer-label {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}
.cob-ai-regen-panel-btns,
.cob-ai-golden-propose-btns {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}
.cob-ai-regen-panel-btns .cob-ai-feedback-submit-btn,
.cob-ai-golden-propose-btns .cob-ai-feedback-submit-btn {
    margin-top: 0;
}

/* Voorbeeldantwoord: bewerkbare kaart — neutraal blok, ster/label als accent */
.cob-ai-golden-propose {
    margin-top: 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f7f8f7;
    border: 1px solid #e3e6e1;
    border-radius: 10px;
}
.cob-ai-golden-propose-label {
    font-size: 12px;
    font-weight: 700;
    color: #8a5d10;
}
.cob-ai-golden-propose-hint {
    font-size: 12px;
    color: #7c6218;
    margin: 4px 0 6px;
}

/* ------------------------------------------------------------------
   Expert-strookje ONDER het chatvenster (voorheen een groene pil in de
   header, die daar de focus-keuze wegdrukte).
   ------------------------------------------------------------------ */
.cob-ai-expert-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 14px;
    flex-shrink: 0;
    padding: 7px 20px 8px;
    background: #fff;
    border-top: 1px solid var(--cob-ai-border, #e5e7eb);
    font-size: 11.5px;
    line-height: 1.3;
    color: #5b6b47;
}
.cob-ai-expert-strip-who {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cob-ai-expert-strip-who.is-clickable { cursor: pointer; }
.cob-ai-expert-strip-who strong { color: #41521f; font-weight: 700; }
.cob-ai-expert-strip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cob-ai-primary);
    flex-shrink: 0;
}
body .cob-ai-chatbot .cob-ai-expert-strip-link,
body.has-tailwind .cob-ai-chatbot .cob-ai-expert-strip-link {
    margin-left: auto;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    color: #5d7605 !important;
    font-family: inherit;
    font-size: 11.5px !important;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}
/* Icoonknoppen rechts in de strips (geschiedenis, taaladvies, expert, uitloggen). */
.cob-ai-strip-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
body .cob-ai-chatbot .cob-ai-strip-iconbtn,
body.has-tailwind .cob-ai-chatbot .cob-ai-strip-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 50%;
    color: #7ab51d !important;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}
body .cob-ai-chatbot .cob-ai-strip-iconbtn:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-strip-iconbtn:hover {
    background: #e7efd3 !important;
    color: #41521f !important;
}
body .cob-ai-chatbot .cob-ai-strip-iconbtn.is-active,
body.has-tailwind .cob-ai-chatbot .cob-ai-strip-iconbtn.is-active {
    background: var(--cob-ai-primary, #7ab51d) !important;
    color: #ffffff !important;
}
body .cob-ai-chatbot .cob-ai-strip-iconbtn.is-active:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-strip-iconbtn.is-active:hover {
    background: #689a19 !important;
}
body .cob-ai-chatbot .cob-ai-strip-iconbtn.cob-ai-strip-push,
body.has-tailwind .cob-ai-chatbot .cob-ai-strip-iconbtn.cob-ai-strip-push {
    margin-left: auto;
}
.cob-ai-strip-iconbtn svg { display: block; }

/* Uitloggen: bevestiging in een lightbox binnen het chatvenster. */
.cob-ai-logout-overlay {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(35, 44, 22, 0.45);
}
.cob-ai-logout-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px 22px;
    max-width: 280px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    text-align: center;
}
.cob-ai-logout-box p { margin: 0 0 14px; font-weight: 600; color: #3f4a33; }
.cob-ai-logout-actions { display: flex; gap: 8px; justify-content: center; }
body .cob-ai-chatbot .cob-ai-logout-cancel,
body.has-tailwind .cob-ai-chatbot .cob-ai-logout-cancel {
    padding: 8px 14px !important;
    background: #eef1e6 !important;
    border: none !important;
    border-radius: 8px !important;
    color: #3f4a33 !important;
    font-weight: 600;
    cursor: pointer;
}
body .cob-ai-chatbot .cob-ai-logout-ok,
body.has-tailwind .cob-ai-chatbot .cob-ai-logout-ok {
    padding: 8px 14px !important;
    background: var(--cob-ai-primary, #7ab51d) !important;
    border: none !important;
    border-radius: 8px !important;
    color: #fff !important;
    font-weight: 700;
    cursor: pointer;
}
body .cob-ai-chatbot .cob-ai-logout-ok:hover { background: #689a19 !important; }

/* ---- Identiteit in de header (variant 'header') -------------------------- */
.cob-ai-header-user {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
    font-size: 11px;
    font-weight: 600;
    color: #5d7605;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cob-ai-header-user-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cob-ai-primary, #7ab51d);
    box-shadow: 0 0 0 2px rgba(122, 181, 29, 0.25);
    flex-shrink: 0;
}
body .cob-ai-chatbot .cob-ai-header-expert-toggle.is-active,
body.has-tailwind .cob-ai-chatbot .cob-ai-header-expert-toggle.is-active {
    background: var(--cob-ai-primary, #7ab51d) !important;
    color: #fff !important;
    border-radius: 50%;
}

/* ---- Verticale icoonbalk links (variant 'rail') --------------------------- */
/* De rail komt NAAST de chat: container 52px breder, zodat de chatinhoud zijn
   volle breedte houdt. Uitlijning: bovenste knop op één lijn met het logo in de
   header (padding 14px, knop 36px = logo 36px); avatar onderin op één lijn met
   het AI-icoon in het invoerveld. */
.cob-ai-chat-container.cob-ai-rail-active {
    width: 672px;
    padding-left: 52px;
}
.cob-ai-identity-rail {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 0 30px;
    background: #fff;
    border-right: 1px solid var(--cob-ai-border, #e5e7eb);
    z-index: 5;
}
body .cob-ai-chatbot .cob-ai-identity-rail .cob-ai-strip-iconbtn,
body.has-tailwind .cob-ai-chatbot .cob-ai-identity-rail .cob-ai-strip-iconbtn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}
.cob-ai-identity-rail .cob-ai-strip-iconbtn svg { width: 20px; height: 20px; }
.cob-ai-rail-spacer { flex: 1; }

/* Directe tooltip naast de railknoppen (native title is traag en onopvallend). */
.cob-ai-identity-rail [data-tip] { position: relative; }
.cob-ai-identity-rail [data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #2f3627;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease 0.08s;
    z-index: 70;
}
.cob-ai-identity-rail [data-tip]:hover::after { opacity: 1; }
body .cob-ai-chatbot .cob-ai-rail-avatar,
body.has-tailwind .cob-ai-chatbot .cob-ai-rail-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none !important;
    padding: 0 !important;
    background: var(--cob-ai-primary, #7ab51d) !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
body .cob-ai-chatbot .cob-ai-rail-avatar:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-rail-avatar:hover {
    box-shadow: 0 0 0 3px rgba(122, 181, 29, 0.3);
}

/* Account-popover naast de avatar (linksonder). */
.cob-ai-account-menu {
    position: absolute;
    left: 58px;
    bottom: 14px;
    z-index: 65;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--cob-ai-border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    padding: 6px;
}
.cob-ai-account-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f2ea;
    margin-bottom: 4px;
}
.cob-ai-account-menu .cob-ai-account-menu-avatar { width: 32px; height: 32px; font-size: 12px; flex-shrink: 0; }
.cob-ai-account-menu-wie { display: flex; flex-direction: column; min-width: 0; }
.cob-ai-account-menu-wie strong { font-size: 13px; color: #2f3627; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cob-ai-account-menu-wie span { font-size: 11px; color: #5d6652; }
body .cob-ai-chatbot .cob-ai-account-menu-item,
body.has-tailwind .cob-ai-chatbot .cob-ai-account-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px !important;
    background: none !important;
    border: none !important;
    border-radius: 8px !important;
    color: #3f4a33 !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
body .cob-ai-chatbot .cob-ai-account-menu-item:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-account-menu-item:hover {
    background: #f3f6ec !important;
}

/* Zoek-modal over eerdere gesprekken. */
.cob-ai-search-overlay { align-items: flex-start; padding-top: 64px; }
.cob-ai-search-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    padding: 12px;
    width: min(420px, calc(100% - 48px));
}
body .cob-ai-chatbot .cob-ai-search-input,
body.has-tailwind .cob-ai-chatbot .cob-ai-search-input { margin-bottom: 6px !important; }
.cob-ai-search-results { max-height: 300px; overflow-y: auto; }
body .cob-ai-chatbot .cob-ai-search-result,
body.has-tailwind .cob-ai-chatbot .cob-ai-search-result {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 10px !important;
    background: none !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    text-align: left;
}
body .cob-ai-chatbot .cob-ai-search-result:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-search-result:hover { background: #f3f6ec !important; }
.cob-ai-search-result .t {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #2f3627;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cob-ai-search-result .d { font-size: 11px; color: #8a917d; white-space: nowrap; }
/* In rail-modus verhuizen identiteit en acties naar de balk. */
.cob-ai-rail-active #cob-ai-header-user,
.cob-ai-rail-active #cob-ai-history-btn,
.cob-ai-rail-active #cob-ai-logout-btn,
.cob-ai-rail-active #cob-ai-login-btn,
.cob-ai-rail-active #cob-ai-expert-toggle { display: none !important; }

/* Puntjes-loader op knoppen in "bezig"-stand (uitloggen/inloggen). */
.cob-ai-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 6px;
    align-items: center;
    vertical-align: middle;
}
.cob-ai-dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    animation: cobAiDotPulse 1s infinite ease-in-out;
}
.cob-ai-dots i:nth-child(2) { animation-delay: 0.15s; }
.cob-ai-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cobAiDotPulse {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
}

/* Inloggen-lightbox (deelt de logout-overlay/box-stijlen). */
.cob-ai-login-box { max-width: 320px; width: 100%; text-align: left; }
.cob-ai-login-box > p { text-align: center; }
body .cob-ai-chatbot .cob-ai-login-input,
body.has-tailwind .cob-ai-chatbot .cob-ai-login-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 8px !important;
    padding: 9px 12px !important;
    border: 1px solid #d6dbc9 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: #fff !important;
    color: #2f3627 !important;
}
body .cob-ai-chatbot .cob-ai-login-input:focus,
body.has-tailwind .cob-ai-chatbot .cob-ai-login-input:focus {
    outline: none !important;
    border-color: var(--cob-ai-primary, #7ab51d) !important;
    box-shadow: 0 0 0 3px rgba(122, 181, 29, 0.2) !important;
}
.cob-ai-login-error {
    color: #9b1c1c;
    background: #fde8e8;
    border-radius: 6px;
    padding: 7px 10px;
    margin-bottom: 8px;
    font-size: 0.9em;
}
.cob-ai-login-alt {
    display: block;
    margin-top: 10px;
    text-align: center;
    font-size: 0.85em;
    color: #5d7605;
}

/* Alleen de eerste link duwt naar rechts; volgende links sluiten erop aan. */
body .cob-ai-chatbot .cob-ai-expert-strip-link ~ .cob-ai-expert-strip-link,
body.has-tailwind .cob-ai-chatbot .cob-ai-expert-strip-link ~ .cob-ai-expert-strip-link {
    margin-left: 0;
}
body .cob-ai-chatbot .cob-ai-expert-strip-link:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-expert-strip-link:hover {
    color: #41521f !important;
}
/* Afrondknop in het strookje: als enige een echte knop, want dit is de laatste
   stap van de testronde. Na indienen wordt hij rustig (grijs met vinkje). */
body .cob-ai-chatbot .cob-ai-expert-strip-eval,
body.has-tailwind .cob-ai-chatbot .cob-ai-expert-strip-eval {
    padding: 4px 12px !important;
    background: var(--cob-ai-primary, #7ab51d) !important;
    border: none !important;
    border-radius: 999px !important;
    color: #ffffff !important;
    font-family: inherit;
    font-size: 11.5px !important;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
/* Zonder "Mijn beoordelingen" (frame-modus) duwt de knop zelf naar rechts. */
body .cob-ai-chatbot .cob-ai-expert-strip-who + .cob-ai-expert-strip-eval,
body.has-tailwind .cob-ai-chatbot .cob-ai-expert-strip-who + .cob-ai-expert-strip-eval {
    margin-left: auto;
}
body .cob-ai-chatbot .cob-ai-expert-strip-eval:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-expert-strip-eval:hover {
    background: #6e8a07 !important;
}
body .cob-ai-chatbot .cob-ai-expert-strip-eval.is-done,
body.has-tailwind .cob-ai-chatbot .cob-ai-expert-strip-eval.is-done {
    background: #eef2e2 !important;
    color: #5d7605 !important;
    box-shadow: inset 0 0 0 1px #d7e2be;
}
body .cob-ai-chatbot .cob-ai-expert-strip-eval.is-done:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-expert-strip-eval.is-done:hover {
    background: #e4ebd3 !important;
}

/* Mobiel: naam + "Mijn beoordelingen" op de bovenste regel, de evaluatieknop
   als nette volle regel eronder (voorheen wrapte de pil er half onder). */
@media (max-width: 480px) {
    .cob-ai-expert-strip {
        padding: 8px 14px 10px;
        gap: 6px 10px;
    }
    body .cob-ai-chatbot .cob-ai-expert-strip-eval,
    body.has-tailwind .cob-ai-chatbot .cob-ai-expert-strip-eval {
        flex: 1 1 100%;
        text-align: center;
    }
}

/* "Wijzig deze pagina" (footer.php, inline styles — vandaar !important) valt op
   smalle schermen over de geopende bot heen; de bot zet cob-ai-chat-open op body. */
@media (max-width: 900px) {
    body.cob-ai-chat-open #super-admin-bar {
        display: none !important;
    }
}

/* Subtiel regeltje in de chat (welkom terug), geen bericht-bubbel */
.cob-ai-expert-note {
    margin: 2px 0 14px;
    padding: 7px 12px;
    background: #f6f8ef;
    border: 1px solid #e4ebd3;
    border-radius: 10px;
    font-size: 12px;
    color: #5b6b47;
    text-align: center;
}
.cob-ai-expert-note a { color: #5d7605; font-weight: 600; }
/* Thema-regels als `[class*='tw-'] a {font-size:16px !important}` (tailwind-compiled)
   blazen de link in de 12px-note op ("bekijk ze" veel te groot) — zelfde wapen als
   bij .cob-ai-expert-strip-link: erven afdwingen met hogere specificiteit. */
body .cob-ai-chatbot .cob-ai-expert-note a,
body.has-tailwind .cob-ai-chatbot .cob-ai-expert-note a {
    font-size: inherit !important;
    line-height: inherit !important;
}

/* ------------------------------------------------------------------
   Welkomst-lightbox bij binnenkomst via de uitnodigingslink
   ------------------------------------------------------------------ */
body .cob-ai-expert-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(24, 30, 16, 0.55);
    opacity: 0;
    transition: opacity 0.18s ease-out;
    box-sizing: border-box;
}
body .cob-ai-expert-modal.is-open { opacity: 1; }

body .cob-ai-expert-modal .cob-ai-expert-modal-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    padding: 30px 32px 26px;
    box-sizing: border-box;
    transform: translateY(10px);
    transition: transform 0.18s ease-out;
    font-family: var(--cob-ai-font, inherit);
    color: #1f2937;
}
body .cob-ai-expert-modal.is-open .cob-ai-expert-modal-card { transform: translateY(0); }

body .cob-ai-expert-modal .cob-ai-expert-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
}
body .cob-ai-expert-modal .cob-ai-expert-modal-close:hover { background: #f3f4f6; color: #4b5563; }

body .cob-ai-expert-modal .cob-ai-expert-modal-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cob-ai-primary, #7ab51d);
    margin-bottom: 6px;
}
body .cob-ai-expert-modal .cob-ai-expert-modal-title {
    margin: 0 0 10px;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    color: #2c3a12;
}
body .cob-ai-expert-modal .cob-ai-expert-modal-lead {
    margin: 0 0 16px;
    font-size: 14.5px;
    line-height: 1.55;
    color: #374151;
}
/* Uitleg van de duimpjes en het voorbeeldantwoord in de welkomstkaart. */
body .cob-ai-expert-modal .cob-ai-expert-modal-how {
    margin: 0 0 16px;
    padding: 0 0 0 18px;
    font-size: 14px;
    line-height: 1.55;
    color: #374151;
}
body .cob-ai-expert-modal .cob-ai-expert-modal-how li {
    margin: 0 0 8px;
}
body .cob-ai-expert-modal .cob-ai-expert-modal-task {
    padding: 14px 16px;
    background: #f6f8ef;
    border: 1px solid #e4ebd3;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}
body .cob-ai-expert-modal .cob-ai-expert-modal-task-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5d7605;
    margin-bottom: 6px;
}
body .cob-ai-expert-modal .cob-ai-expert-modal-task p { margin: 0 0 8px; }
body .cob-ai-expert-modal .cob-ai-expert-modal-task p:last-child { margin-bottom: 0; }
body .cob-ai-expert-modal .cob-ai-expert-modal-task ul,
body .cob-ai-expert-modal .cob-ai-expert-modal-task ol { margin: 6px 0; padding-left: 20px; }

body .cob-ai-expert-modal .cob-ai-expert-modal-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 20px;
}
body .cob-ai-expert-modal .cob-ai-expert-modal-start {
    padding: 11px 26px;
    background: var(--cob-ai-primary, #7ab51d);
    color: #ffffff;
    border: none;
    border-radius: 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
body .cob-ai-expert-modal .cob-ai-expert-modal-start:hover { background: #6e8a07; }
body .cob-ai-expert-modal .cob-ai-expert-modal-link {
    color: #5d7605;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: underline;
}
body .cob-ai-expert-modal .cob-ai-expert-modal-foot {
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #6b7280;
}

@media (max-width: 520px) {
    body .cob-ai-expert-modal { padding: 14px; }
    body .cob-ai-expert-modal .cob-ai-expert-modal-card { padding: 26px 20px 20px; }
    body .cob-ai-expert-modal .cob-ai-expert-modal-title { font-size: 21px; }
    body .cob-ai-expert-modal .cob-ai-expert-modal-actions { flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
}

/* ------------------------------------------------------------------
   Eindevaluatie-lightbox: het hele formulier in één ruime pop-up.
   Erft de welkomst-lightbox en verbreedt hem — de schaal moet op één
   regel passen en de tekstvakken moeten uitnodigen om te schrijven.
   ------------------------------------------------------------------ */
body .cob-ai-eval-modal .cob-ai-eval-card {
    max-width: 760px;
    max-height: calc(100vh - 40px);
    padding: 30px 36px 28px;
}
body .cob-ai-eval-modal .cob-ai-eval-loading {
    margin: 8px 0;
    font-size: 14.5px;
    color: #6b7280;
}
body .cob-ai-eval-modal .cob-ai-eval-counter {
    margin: -8px 0 18px;
    font-size: 13px;
    color: #6b7280;
}
body .cob-ai-eval-modal .cob-ai-eval-section {
    margin: 26px 0 4px;
    padding-top: 16px;
    border-top: 1px solid #eef0e8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5d7605;
}
body .cob-ai-eval-modal .cob-ai-eval-section:first-of-type { border-top: none; padding-top: 0; }

body .cob-ai-eval-modal .cob-ai-eval-q {
    padding: 14px 16px;
    margin-top: 12px;
    border: 1px solid #eceee6;
    border-radius: 12px;
    background: #fcfdfa;
}
body .cob-ai-eval-modal .cob-ai-eval-q.is-missing {
    border-color: #e5a79a;
    background: #fdf6f4;
}
body .cob-ai-eval-modal .cob-ai-eval-label {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: #2c3a12;
}

/* Likert: vijf gelijke kolommen + n.v.t.; onder 640px onder elkaar. */
body .cob-ai-eval-modal .cob-ai-eval-scale {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
body .cob-ai-eval-modal .cob-ai-eval-opt {
    flex: 1 1 0;
    min-width: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 9px 6px;
    background: #ffffff;
    border: 1px solid #e2e8d2;
    border-radius: 10px;
    font-size: 11.5px;
    line-height: 1.25;
    text-align: center;
    color: #4b5563;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
body .cob-ai-eval-modal .cob-ai-eval-opt.is-na {
    flex: 0 0 auto;
    min-width: 64px;
    color: #8a8f80;
}
body .cob-ai-eval-modal .cob-ai-eval-opt:hover { border-color: #b9cd7c; background: #f9fbf3; }
body .cob-ai-eval-modal .cob-ai-eval-opt.is-checked,
body .cob-ai-eval-modal .cob-ai-eval-opt:has(input:checked) {
    border-color: var(--cob-ai-primary, #7ab51d);
    background: #f2f6e6;
    color: #41521f;
    font-weight: 600;
}
body .cob-ai-eval-modal .cob-ai-eval-opt input {
    margin: 0;
    accent-color: var(--cob-ai-primary, #7ab51d);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

body .cob-ai-eval-modal .cob-ai-eval-text {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    background: #ffffff;
    border: 1px solid #e2e8d2;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.5;
    color: #1f2937;
    resize: vertical;
}
body .cob-ai-eval-modal .cob-ai-eval-text.is-open { font-size: 14px; }
body .cob-ai-eval-modal .cob-ai-eval-text::placeholder { color: #9aa18c; }
body .cob-ai-eval-modal .cob-ai-eval-text:focus {
    outline: none;
    border-color: var(--cob-ai-primary, #7ab51d);
    box-shadow: 0 0 0 3px rgba(122, 181, 29, 0.15);
}

body .cob-ai-eval-modal .cob-ai-eval-error {
    margin: 16px 0 0;
    padding: 10px 14px;
    background: #fdecea;
    border: 1px solid #f5c6c0;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.45;
    color: #8a2f24;
}
body .cob-ai-eval-modal .cob-ai-eval-actions {
    position: sticky;
    bottom: 0;
    margin-top: 22px;
    padding: 14px 0 10px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff 30%);
}
body .cob-ai-eval-modal .cob-ai-eval-later {
    padding: 0;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer;
}
body .cob-ai-eval-modal .cob-ai-eval-later:hover { color: #41521f; }

/* Status van het automatisch bewaren: bevestiging aan de rand van het oog,
   nooit een blokkade. Leeg (geen tekst) neemt hij geen ruimte in. */
body .cob-ai-eval-modal .cob-ai-eval-saved {
    margin-left: auto;
    font-size: 12.5px;
    line-height: 1.4;
    color: #6b7280;
    text-align: right;
}
body .cob-ai-eval-modal .cob-ai-eval-saved.is-ok::before {
    content: "✓ ";
    color: var(--cob-ai-primary, #7ab51d);
    font-weight: 700;
}
body .cob-ai-eval-modal .cob-ai-eval-saved.is-fail { color: #a2512f; }
@media (max-width: 600px) {
    body .cob-ai-eval-modal .cob-ai-eval-saved { margin-left: 0; text-align: center; }
}

body .cob-ai-eval-modal .cob-ai-eval-card.is-done { text-align: center; max-width: 520px; }
body .cob-ai-eval-modal .cob-ai-eval-card.is-done .cob-ai-expert-modal-actions {
    justify-content: center;
}
body .cob-ai-eval-modal .cob-ai-eval-check {
    width: 54px;
    height: 54px;
    margin: 6px auto 14px;
    border-radius: 50%;
    background: #f2f6e6;
    color: var(--cob-ai-primary, #7ab51d);
    font-size: 28px;
    font-weight: 700;
    line-height: 54px;
}

@media (max-width: 640px) {
    body .cob-ai-eval-modal .cob-ai-eval-card { padding: 26px 18px 20px; }
    body .cob-ai-eval-modal .cob-ai-eval-opt {
        flex: 1 1 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 9px;
        text-align: left;
        font-size: 13px;
    }
    body .cob-ai-eval-modal .cob-ai-eval-opt.is-na { flex: 1 1 100%; }
}


/* ============================================================
   Geraadpleegde bronnen (sources-SSE-event, uitzetbaar experiment)
   Klassen staan in de RUCSS-safelist (functions/fix/wp-rocket-pdfjs.php)
   ============================================================ */
.cob-ai-sources {
    margin: 10px 0 14px;
    padding: 8px 10px 12px;
    background: #f7f8f4;
    border: 1px solid #e2e6d8;
    border-radius: 8px;
    font-size: 13px;
}
.cob-ai-sources-summary {
    cursor: pointer;
    font-weight: 600;
    color: #5d7605;
    list-style: none;
}
.cob-ai-sources-summary::-webkit-details-marker { display: none; }
.cob-ai-sources-summary::before {
    content: '▸ ';
    font-size: 11px;
}
.cob-ai-sources[open] .cob-ai-sources-summary::before {
    content: '▾ ';
}
.cob-ai-sources-list {
    margin: 6px 0 2px;
    padding: 0 0 0 4px;
    list-style: none;
}
.cob-ai-sources-item {
    margin: 4px 0;
    line-height: 1.4;
}
.cob-ai-sources-link {
    color: #374151;
    text-decoration: underline;
    text-decoration-color: #7ab51d;
}
.cob-ai-sources-link:hover { color: #5d7605; }
.cob-ai-sources-pages {
    color: #6b7280;
    white-space: nowrap;
}

/* ============================================
   EXTERN NIEUWS (opt-in webzoek-fallback)
   Ask-first-toestemmingsdialoog (overlay in het chatvenster), aanbod-knop
   onder een zwak antwoord en een neutrale witte resultaatbox met de
   gebruikte externe bronnen (zelfde toon als .cob-ai-sources).
   ============================================ */
.cob-ai-web-news-offer {
    margin: 10px 0 4px;
}
.cob-ai-web-news-offer-lead {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}
.cob-ai-web-offer-btn.is-used {
    opacity: .55;
    cursor: default;
}
.cob-ai-web-news-banner {
    margin: 12px 0 14px;
    padding: 10px 14px;
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    border-left: 3px solid var(--cob-ai-primary, #7ab51d);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.cob-ai-web-news-head strong { color: #1f2937; }
.cob-ai-web-news-sources {
    list-style: none;
    margin: 8px 0 0;
    padding: 8px 0 0;
    border-top: 1px solid #f3f4f6;
}
.cob-ai-web-news-sources li { margin: 5px 0; }
.cob-ai-web-news-sources a {
    color: #374151;
    text-decoration: underline;
    text-decoration-color: var(--cob-ai-primary, #7ab51d);
}
.cob-ai-web-news-sources a:hover { color: #5d7605; }
.cob-ai-web-news-date {
    color: #9ca3af;
    white-space: nowrap;
}

/* Toestemmingsdialoog (ask-first) — overlay binnen het chatvenster */
.cob-ai-webask-overlay {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, .35);
    border-radius: inherit;
    padding: 20px;
}
.cob-ai-webask-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
    padding: 20px 22px;
    max-width: 400px;
    width: 100%;
}
.cob-ai-webask-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}
.cob-ai-webask-globe {
    margin-right: 8px;
}
.cob-ai-webask-body {
    font-size: 13px;
    line-height: 1.55;
    color: #4b5563;
    margin-bottom: 16px;
}
.cob-ai-webask-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cob-ai-webask-btn {
    width: 100%;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.cob-ai-webask-btn:hover { background: #f9fafb; }
.cob-ai-webask-btn--primary {
    background: var(--cob-ai-primary, #7ab51d);
    border-color: var(--cob-ai-primary, #7ab51d);
    color: #ffffff;
}
.cob-ai-webask-btn--primary:hover {
    background: #6e8c06;
    border-color: #6e8c06;
}
.cob-ai-webask-btn:focus-visible {
    outline: 2px solid #375e0f;
    outline-offset: 2px;
}
.cob-ai-webask-domains {
    margin: -6px 0 14px;
    font-size: 12.5px;
}
.cob-ai-webask-domains summary {
    cursor: pointer;
    color: #6b7280;
    text-decoration: underline;
    text-decoration-color: #d1d5db;
}
.cob-ai-webask-info {
    margin-right: 5px;
    color: #9ca3af;
}
.cob-ai-webask-domains summary:hover { color: #374151; }
.cob-ai-webask-domain-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* Domein-chip (favicon + domeinnaam) — gedeeld door modal en voortgangskaart */
.cob-ai-web-domain-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 11.5px;
    color: #4b5563;
    white-space: nowrap;
}
.cob-ai-web-domain-chip img {
    border-radius: 3px;
    flex: 0 0 auto;
}

/* Live zoek-voortgangskaart tijdens het webzoeken */
.cob-ai-web-progress {
    margin: 8px 0;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 3px solid var(--cob-ai-primary, #7ab51d);
    border-radius: 8px;
    font-size: 13px;
    color: #4b5563;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.cob-ai-web-progress-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1f2937;
}
.cob-ai-web-progress-spin {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    border: 2px solid #e5e7eb;
    border-top-color: var(--cob-ai-primary, #7ab51d);
    border-radius: 50%;
    animation: cob-ai-web-spin .8s linear infinite;
}
@keyframes cob-ai-web-spin {
    to { transform: rotate(360deg); }
}
.cob-ai-web-progress-queries { margin-top: 4px; }
.cob-ai-web-progress-q {
    margin-top: 4px;
    font-size: 12.5px;
    color: #6b7280;
}
.cob-ai-web-progress-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.cob-ai-web-progress-chips:empty { display: none; }

/* ============================================
   DEBUGPANEEL (?cobdebug=1 · Ctrl+Shift D,B)
   Vast paneel links van het chatvenster; JS zet display:flex zodra
   debugmodus aan is én de chat open staat. Onder 1200px verborgen
   (payload staat dan in de console). Donker monospace-thema zodat het
   duidelijk "gereedschap" is en nooit met de site-UI verward wordt.
   ============================================ */
#cob-ai-debug-panel {
    display: none;
    position: fixed;
    bottom: 118px; /* gelijk aan .cob-ai-chat-container */
    right: calc(24px + 620px + 12px);
    width: 640px;
    max-width: calc(100vw - 620px - 72px);
    height: 720px;
    max-height: calc(100vh - 140px);
    flex-direction: column;
    background: #1e1e28;
    color: #d8d8e2;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    z-index: var(--cob-ai-z-overlay);
    overflow: hidden;
}
.cob-dbg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #2a2a38;
    flex-shrink: 0;
}
.cob-dbg-title { font-weight: 600; color: #7ab51d; flex: 1; }
#cob-ai-debug-panel .cob-dbg-btn {
    background: #3a3a4c;
    color: #d8d8e2;
    border: none;
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
}
#cob-ai-debug-panel .cob-dbg-btn:hover { background: #4a4a5e; }
.cob-dbg-entries { overflow-y: auto; flex: 1; padding: 8px; }
.cob-dbg-entry {
    border: 1px solid #34344a;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #232330;
}
.cob-dbg-entry > summary {
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 600;
    color: #fff;
    word-break: break-word;
}
.cob-dbg-sec { margin: 4px 8px 8px; border-top: 1px solid #2e2e40; }
.cob-dbg-sec > summary { padding: 6px 4px; cursor: pointer; color: #7ab51d; }
.cob-dbg-kv { padding: 2px 4px 6px; }
.cob-dbg-kv-row { display: flex; gap: 8px; padding: 1px 4px; }
.cob-dbg-k { color: #8f8fa8; min-width: 130px; flex-shrink: 0; }
.cob-dbg-v { word-break: break-word; white-space: pre-wrap; }
.cob-dbg-cands { padding: 2px 0 6px; }
.cob-dbg-cand {
    border-left: 3px solid transparent;
    padding: 4px 6px;
    margin: 3px 0;
    background: #262635;
    border-radius: 4px;
}
.cob-dbg-cand.is-ctx { border-left-color: #7ab51d; }
.cob-dbg-cand.is-drop { border-left-color: #d9534f; opacity: 0.85; }
.cob-dbg-cand-top { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.cob-dbg-rank { color: #8f8fa8; }
.cob-dbg-badge { font-size: 11px; border-radius: 4px; padding: 0 5px; background: #34344a; white-space: nowrap; }
.cob-dbg-cand.is-ctx .cob-dbg-badge { background: #3f5410; color: #d3ee85; }
.cob-dbg-cand.is-drop .cob-dbg-badge { background: #54211f; color: #f2b8b5; }
.cob-dbg-sec-name { word-break: break-word; }
.cob-dbg-cand-sec { color: #b8b8d0; font-size: 11px; padding-left: 2px; word-break: break-word; }
.cob-dbg-cand-scores { color: #a8a8c0; font-size: 11px; margin-top: 1px; }
.cob-dbg-boosts { color: #e0c060; }
.cob-dbg-ctx { padding: 2px 0 6px; }
.cob-dbg-ctx-row { padding: 2px 4px; word-break: break-word; }
.cob-dbg-ctx-row.is-skip { color: #f2b8b5; }
.cob-dbg-ctx-block > summary { cursor: pointer; }
.cob-dbg-ctx-block.is-extra > summary { color: #e0c060; }
.cob-dbg-ctx-text {
    margin: 4px 0 6px;
    padding: 6px 8px;
    background: #16161e;
    border-radius: 6px;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 11px;
    color: #c8c8da;
}
@media (max-width: 1200px) {
    #cob-ai-debug-panel { display: none !important; }
}

/* ---- Taalcheck: downloadblok onder het antwoord ------------------------- */
.cob-ai-attachment {
    margin: 12px 0 4px;
    padding: 12px 14px;
    border: 1px solid #dfe2d8;
    border-radius: 8px;
    background: #f7f9f3;
    font-size: 0.92em;
}
/* Downloadkaart: Word-icoon links, titel + bestandsnaam, groene pijlknop
   rechts. Een witte kaart op het lichtgroene paneel — het officiële blauwe
   Word-icoon vloekt op een groene knopvulling, op wit komt het tot z'n recht. */
.cob-ai-attachment-download {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #dfe2d8;
    border-radius: 10px;
    padding: 10px 14px;
    color: inherit !important;
    text-decoration: none !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}
body .cob-ai-attachment-download:hover {
    background: #fff !important;
    border-color: #7ab51d;
    box-shadow: 0 2px 10px rgba(122, 181, 29, 0.22);
}
.cob-ai-attachment-icon { flex: 0 0 auto; display: flex; }
.cob-ai-attachment-icon svg { width: 30px; height: 30px; display: block; }
.cob-ai-attachment-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cob-ai-attachment-title { font-weight: 600; color: #2f3a26; line-height: 1.3; }
.cob-ai-attachment-file {
    color: #5d6652;
    font-size: 0.85em;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cob-ai-attachment-arrow {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #7ab51d;
    color: #fff;
    transition: background .15s ease;
}
.cob-ai-attachment-arrow svg { transition: transform .15s ease; }
.cob-ai-attachment-download:hover .cob-ai-attachment-arrow { background: #7ab51d; }
.cob-ai-attachment-download:hover .cob-ai-attachment-arrow svg { transform: translateY(2px); }
.cob-ai-attachment-details { margin-top: 10px; }
.cob-ai-attachment-details summary { cursor: pointer; color: #3f4a33; font-weight: 600; }
.cob-ai-attachment-list { margin: 8px 0 0; padding-left: 18px; }
.cob-ai-attachment-list li { margin-bottom: 4px; line-height: 1.45; }
.cob-ai-attachment-warning { margin-top: 10px; color: #8a6d1f; }

/* ---- Taalcheck: correctiekaartjes (stijl van de taalhulp-kaarten) -------- */
.cob-ai-tc-cards { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.cob-ai-tc-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 3px solid var(--tc-color, #94a3b8);
    border-radius: 8px;
    padding: 8px 10px;
}
.cob-ai-tc-card--advies { background: #fbfbf9; }
.cob-ai-tc-card-badge {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tc-color, #64748b);
    margin-bottom: 4px;
}
.cob-ai-tc-card-diff { line-height: 1.5; word-break: break-word; }
.cob-ai-tc-card-diff del {
    background: #fde8e8;
    color: #9b1c1c;
    text-decoration: line-through;
    border-radius: 3px;
    padding: 0 2px;
}
.cob-ai-tc-card-diff ins {
    background: #e6f4d7;
    color: #3f6212;
    text-decoration: none;
    border-radius: 3px;
    padding: 0 2px;
    margin-left: 2px;
}
.cob-ai-tc-card-why { margin-top: 4px; color: #5d6652; font-size: 0.88em; }
.cob-ai-tc-cards-more { color: #5d6652; font-size: 0.88em; padding: 2px 2px 0; }
.cob-ai-tc-copy {
    margin: 8px 0 6px;
    background: #7ab51d;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: 600;
    cursor: pointer;
}
.cob-ai-tc-copy:hover { background: #7ab51d; }
.cob-ai-tc-corrected {
    white-space: pre-wrap;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    max-height: 320px;
    overflow-y: auto;
    line-height: 1.55;
}

body .cob-ai-image-chip-doc.cob-ai-chip-word {
    background: #eef4fc !important; border-color: #cfe0f5 !important; padding: 0 !important; }
body .cob-ai-image-chip-doc.cob-ai-chip-word svg { display: block !important; }
/* Uitleg onder de chip: rustige toelichting, niet schreeuwerig. */
.cob-ai-chip-hint {
    margin: 8px 2px 0; padding-left: 10px; border-left: 2px solid #dbe3bf;
    color: #5d6652; font-size: 0.82em; line-height: 1.45;
}

/* ============================================================
   INGELOGDE COB-ERS (plugin cob-cobot-portal)
   Naamstrip onderin (deelt .cob-ai-expert-strip-stijlen), login-
   poppetje in de header en het gespreksgeschiedenis-paneel.
   ============================================================ */

/* Suffix in de expert-strip wanneer de expert óók met WP is ingelogd */
.cob-ai-expert-strip-suffix {
    color: #8a9678;
    font-weight: 400;
}

/* Login-poppetje: zelfde look als de andere headerknoppen, maar het is een <a> */
body .cob-ai-chatbot a.cob-ai-login-btn,
body.has-tailwind .cob-ai-chatbot a.cob-ai-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
}

/* Geschiedenis-paneel: slide-over binnen het chatvenster */
.cob-ai-history-panel {
    position: absolute;
    inset: 0; /* fallback; JS zet top/bottom/left op het berichten-deel */
    z-index: 30;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0;
    border-top: 1px solid var(--cob-ai-border, #e5e7eb);
    animation: cobAiHistoryIn .18s ease-out;
}
@keyframes cobAiHistoryIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.cob-ai-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #e4ebd3;
    background: #f6f8ef;
    border-radius: inherit;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.cob-ai-history-head strong {
    font-size: 14px;
    color: #41521f;
}
.cob-ai-history-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
body .cob-ai-chatbot .cob-ai-history-new,
body.has-tailwind .cob-ai-chatbot .cob-ai-history-new {
    border: 1px solid var(--cob-ai-primary, #7ab51d);
    background: #fff;
    color: #41521f;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
}
body .cob-ai-chatbot .cob-ai-history-new:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-history-new:hover {
    background: var(--cob-ai-primary, #7ab51d);
    color: #fff;
}
body .cob-ai-chatbot .cob-ai-history-close,
body.has-tailwind .cob-ai-chatbot .cob-ai-history-close {
    border: none;
    background: none;
    font-size: 20px;
    line-height: 1;
    color: #5b6b47;
    cursor: pointer;
    padding: 2px 6px;
}
body .cob-ai-chatbot .cob-ai-history-search,
body.has-tailwind .cob-ai-chatbot .cob-ai-history-search {
    margin: 10px 16px 6px;
    padding: 8px 12px;
    border: 1px solid #dbe3c9;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}
body .cob-ai-chatbot .cob-ai-history-search:focus,
body.has-tailwind .cob-ai-chatbot .cob-ai-history-search:focus {
    border-color: var(--cob-ai-primary, #7ab51d);
    box-shadow: 0 0 0 3px rgba(122, 181, 29, .15);
}
.cob-ai-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 14px;
}
.cob-ai-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    margin: 2px 4px;
    border-radius: 8px;
    cursor: pointer;
}
.cob-ai-history-item:hover { background: #f6f8ef; }
.cob-ai-history-item.is-current {
    background: #eef4dd;
    outline: 1px solid #d7e3b5;
}
.cob-ai-history-item-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cob-ai-history-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #2f3a22;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cob-ai-history-item-meta {
    font-size: 11px;
    color: #8a9678;
}
.cob-ai-history-item-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .12s ease;
}
.cob-ai-history-item:hover .cob-ai-history-item-actions { opacity: 1; }
body .cob-ai-chatbot .cob-ai-history-act,
body.has-tailwind .cob-ai-chatbot .cob-ai-history-act {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    padding: 3px 5px;
    border-radius: 6px;
}
body .cob-ai-chatbot .cob-ai-history-act:hover,
body.has-tailwind .cob-ai-chatbot .cob-ai-history-act:hover { background: #e4ebd3; }
.cob-ai-history-empty {
    padding: 26px 18px;
    text-align: center;
    font-size: 12.5px;
    color: #8a9678;
}

/* ============================================
   COBOT HERO-CHAT (homepage-testvarianten ?cobot_hero=1|2|3)
   Variant 1/2: balk in de linkerkolom van de hero; variant 3: brede balk.
   ============================================ */

.cob-ai-hero-chat {
    width: 100%;
    max-width: 640px;
    margin-top: 30px; /* witruimte onder de "Over het COB"-link */
    position: relative;
    z-index: 20;
    font-family: inherit;
}
/* Met hero-chat actief: ruimte tussen de balk en SNELLE LINKS
   (overschrijft de standaard flex-gap van de hero-wrapper) */
.cob-ai-hero-gap-compact {
    gap: 42px !important;
}

.cob-ai-hero-inputbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 9999px;
    padding: 8px 8px 8px 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.cob-ai-hero-inputbar:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 1); /* zelfde dunne lijn, ietsje helderder */
    animation: cobHeroGlowPulse 2.4s ease-in-out infinite;
}
/* Zachte witte glow die rustig ademt zolang het veld focus heeft (geen ring).
   Bewust subtiel: één element, alleen box-shadow — verwaarloosbaar voor de
   browser (de statische backdrop-blur van de balk is al het zwaarste stukje). */
@keyframes cobHeroGlowPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.14),
                    0 8px 32px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3),
                    0 8px 32px rgba(0, 0, 0, 0.3);
    }
}
/* Placeholder meteen weg zodra je erin klikt (niet pas bij tikken) */
textarea.cob-ai-hero-input:focus::placeholder {
    color: transparent;
}
/* Hero-icoon: eigen PNG van Allart (groene chip, witte AI-letters) */
.cob-ai-hero-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: contain;
}
textarea.cob-ai-hero-input,
textarea.cob-ai-hero-input:focus,
textarea.cob-ai-hero-input:focus-visible {
    flex: 1;
    background: transparent;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    resize: none;
    color: #fff;
    font-size: 16px;
    line-height: 1.45;
    max-height: 120px;
    padding: 7px 0;
    font-family: inherit;
}
textarea.cob-ai-hero-input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}
.cob-ai-hero-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #7ab51d;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}
.cob-ai-hero-send:hover {
    background: #7cb32f;
    transform: scale(1.06);
}

/* Antwoordpaneel: dicht tot er een gesprek loopt (variant 1). Glazig donker
   paneel dat mooi over de herofoto valt — zelfde familie als de invulbalk. */
.cob-ai-hero-chat .cob-ai-hero-messages {
    display: none;
}
.cob-ai-hero-chat.cob-ai-widget-expanded .cob-ai-hero-messages {
    display: block;
    background: rgba(16, 22, 11, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 14px;
    max-height: 44vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    animation: cobHeroPanelIn 0.35s ease;
    text-align: left;
}
@keyframes cobHeroPanelIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* Bubbels in het glas-paneel: bot-bubbel glazig i.p.v. wit, tekst wit */
.cob-ai-hero-messages .cob-ai-message.bot .cob-ai-message-content {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: none;
}
.cob-ai-hero-messages .cob-ai-message.bot .cob-ai-message-content h1,
.cob-ai-hero-messages .cob-ai-message.bot .cob-ai-message-content h2,
.cob-ai-hero-messages .cob-ai-message.bot .cob-ai-message-content h3,
.cob-ai-hero-messages .cob-ai-message.bot .cob-ai-message-content strong {
    color: #fff;
}
.cob-ai-hero-messages .cob-ai-message.bot .cob-ai-message-content a {
    color: #c9e89a;
}
.cob-ai-hero-messages .cob-ai-welcome-message,
.cob-ai-hero-messages .cob-ai-typing-indicator,
.cob-ai-hero-messages .cob-ai-typing-text {
    color: rgba(255, 255, 255, 0.88);
}
/* Scrollbar past bij het donkere glas */
.cob-ai-hero-messages::-webkit-scrollbar { width: 8px; }
.cob-ai-hero-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 4px;
}

/* "Open in venster"-knop in herostijl */
.cob-ai-hero-open-venster {
    margin-top: 10px;
}
.cob-ai-hero-chat .cob-ai-widget-open-venster-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 9999px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.15s ease;
}
.cob-ai-hero-chat .cob-ai-widget-open-venster-btn:hover {
    background: rgba(122, 181, 29, 0.4);
}

/* ============================================
   COBOT IDLE-NUDGE (testvariant ?cobot_nudge=1)
   Klein tekstballonnetje boven de launcher i.p.v. hard auto-openen.
   ============================================ */

.cob-ai-nudge {
    position: fixed;
    right: 24px;
    bottom: 122px;
    z-index: 2147482000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 290px;
    background: #fff;
    border: 1px solid #e2e8dd;
    border-radius: 16px 16px 4px 16px;
    padding: 14px 34px 14px 14px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
    font-family: system-ui, -apple-system, sans-serif;
}
.cob-ai-nudge-visible {
    opacity: 1;
    transform: none;
}
.cob-ai-nudge-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    object-fit: contain;
}
.cob-ai-nudge-text {
    font-size: 14px;
    line-height: 1.45;
    color: #2d3a26;
}
.cob-ai-nudge-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: none;
    color: #9aa48f;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
}
.cob-ai-nudge-close:hover {
    color: #2d3a26;
    background: #eef2e8;
}

/* Launcher zwaait even mee bij de nudge */
@keyframes cobAiWiggle {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-10deg) scale(1.06); }
    30% { transform: rotate(9deg) scale(1.06); }
    45% { transform: rotate(-7deg); }
    60% { transform: rotate(5deg); }
    75% { transform: rotate(-2deg); }
}
.cob-ai-wiggle {
    animation: cobAiWiggle 1.3s ease-in-out 2;
    transform-origin: 50% 80%;
}

/* Hero-chat op mobiel: iets compacter */
@media (max-width: 640px) {
    .cob-ai-hero-chat {
        margin-top: 20px;
    }
    .cob-ai-hero-chat.cob-ai-widget-expanded .cob-ai-hero-messages {
        max-height: 50vh;
        padding: 14px;
    }
    .cob-ai-nudge {
        right: 16px;
        bottom: 96px;
        max-width: calc(100vw - 96px);
    }
}

/* ============================================
   STOP-KNOP + BUSY-HINT (bot bezig)
   ============================================ */

/* Verstuurknop wordt stop-knop tijdens denken/streamen: rustige puls */
.cob-ai-send-btn.cob-ai-stop-mode,
.cob-ai-hero-send.cob-ai-stop-mode,
.cob-ai-widget-send.cob-ai-stop-mode {
    animation: cobStopPulse 1.6s ease-in-out infinite;
}
@keyframes cobStopPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Hint boven het invoerveld als je tikt terwijl de bot nog bezig is */
.cob-ai-input-container,
.cob-ai-hero-inputbar {
    position: relative;
}
.cob-ai-busy-hint {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 8px;
    right: 8px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid #7ab51d;
    color: #fff;
    font-size: 13.5px;
    line-height: 1.45;
    padding: 9px 14px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 50;
    pointer-events: none;
    font-family: Inter, system-ui, -apple-system, sans-serif;
}
.cob-ai-busy-hint-visible {
    opacity: 1;
    transform: none;
}

/* Bijschrift onder een door de gebruiker gestopt antwoord */
.cob-ai-stopped-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 9px;
    border-top: 1px dashed #d9dfd2;
    font-size: 12.5px;
    font-style: italic;
    color: #8a9678;
}
.cob-ai-stopped-note svg {
    flex-shrink: 0;
    opacity: 0.65;
}

/* VP-15: "Probeer opnieuw" onder een foutmelding (spiegelt widget/cob-ai-widget.css) */
.cob-ai-retry { text-align: left; }
.cob-ai-retry-btn {
    display: inline-block;
    margin: 4px 0 8px;
    padding: 8px 16px;
    border: 1px solid #9bbe32;
    border-radius: 18px;
    background: #fff;
    color: #4a5568;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}
.cob-ai-retry-btn:hover {
    background: #f2f7e3;
}
