/* ============================================
   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: #81a208;
    --cob-ai-primary-hover: #6d8a07;
    --cob-ai-primary-light: #9bbe32;
    --cob-ai-secondary: #5c7406;
    --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: #81a208;
    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: #6d8a07;
    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(129, 162, 8, 0);
        background-color: var(--cob-ai-bg-light);
    }
    50% {
        border-color: rgba(129, 162, 8, 0.6);
        background-color: rgba(129, 162, 8, 0.08);
    }
    100% {
        border-color: rgba(129, 162, 8, 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;
    bottom: 125px;
    right: 24px;
    width: 620px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 140px);
    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);
}

@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;
}

/* ============================================
   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: 12px;
    flex: 1;
    min-width: 0;
}

.cob-ai-chat-logo {
    width: 36px;
    height: 36px;
    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;
}

.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(129, 162, 8, 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 {
    display: block;
    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 {
    display: block;
    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: 1;
    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;
}

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

.cob-ai-message-content {
    max-width: 85%;
    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;
}

.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: 16px 0 8px 0;
    font-weight: 600;
    color: var(--cob-ai-text-dark);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.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;
    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;
}

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

.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 {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--cob-ai-radius-sm);
    overflow: hidden;
    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: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--cob-ai-secondary);
    font-size: 16px;
    white-space: nowrap;
}

.cob-ai-message.bot .cob-ai-message-content td {
    padding: 7px 12px;
    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;
}

/* Thumbs up/down active states */
.cob-ai-action-btn.thumbs-up.active {
    background: var(--cob-ai-primary) !important;
    color: white !important;
    border-radius: 6px;
}

.cob-ai-action-btn.thumbs-down.active {
    background: #dc2626 !important;
    color: white !important;
    border-radius: 6px;
}

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

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

.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(129, 162, 8, 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;
}

/* Expert mode badge */
.cob-ai-expert-badge {
    background: var(--cob-ai-primary);
    color: white;
    padding: 3px 10px 4px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    margin-left: 8px;
    flex-shrink: 0;
}

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

/* 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(129, 162, 8, 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(129, 162, 8, 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;
}

.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);
    min-height: 24px;
    max-height: 120px;
    padding: 6px 0;
}

.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: #81a208 !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: #6d8a07 !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;
    }
}

@media (max-width: 480px) {
    .cob-ai-chatbot[data-position="bottom-right"],
    .cob-ai-chatbot[data-position="bottom-left"] {
        right: 16px;
        left: auto;
    }
    
    .cob-ai-chat-header {
        padding: 12px 16px;
    }
    
    .cob-ai-chat-header-content {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .cob-ai-chat-title {
        flex: 1 1 auto;
        min-width: 120px;
    }
    
    .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;
    }
    
    .cob-ai-messages {
        padding: 16px 12px;
    }
    
    .cob-ai-input-area {
        padding: 12px;
    }
}

/* ============================================
   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, #81a208);
    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, #6d8a07); }
.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 #8DC63F;
    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 #8DC63F;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(141, 198, 63, .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: #5c8c24;
    box-shadow: 0 3px 16px rgba(141, 198, 63, .3);
}

.cob-ai-sidebar-reopen-tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #8DC63F;
    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 #8DC63F !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(141, 198, 63, 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: #8DC63F !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: #5c8c24 !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 #8DC63F !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: #8DC63F !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(141, 198, 63, .3) !important;
}
body .cob-ai-publish-btn-fixed:hover {
    background: #5c8c24 !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: #8DC63F;
    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: #8DC63F;
    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: #8DC63F;
    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, #81a208) !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: #81a208 !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: #6d8a07 !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(129,162,8,.12) !important; color: #5a6b1f !important; }
body .cob-ai-image-preview { padding: 6px 8px 0 !important; }
body .cob-ai-image-chip {
    display: inline-flex !important; align-items: center !important; gap: 8px !important;
    background: #f3f6e8 !important; border: 1px solid #dbe3bf !important; border-radius: 10px !important;
    padding: 5px 8px !important; max-width: 100% !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: 40px !important; height: 40px !important; border-radius: 6px !important;
    background: #fff !important; border: 1px solid #dbe3bf !important; font-size: 20px !important;
}
body .cob-ai-image-chip-name {
    font-size: 12px !important; color: #4a5524 !important; max-width: 160px !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: 18px !important; line-height: 1 !important; color: #7a7a7a !important; padding: 0 2px !important;
}
body .cob-ai-image-chip-remove:hover { color: #c0392b !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 #81a208 !important; outline-offset: -6px !important; }
