.kv-ai-messages {
    flex: 1; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
    background: #f8fafc; font-size: 14px; line-height: 1.48;
}
.kv-msg { padding: 10px 12px; border-radius: 10px; max-width: 88%; word-wrap: break-word; }
.kv-msg-bot { background: #fff; border: 1px solid #e2e8f0; align-self: flex-start; color: #1a202c; }
.kv-msg-user { background: var(--kv-ai-color, #0056b3); color: #fff; align-self: flex-end; white-space: pre-wrap; }
.kv-msg-img-only { padding: 4px; background: transparent; border: none; }

.kv-msg-bot p { margin: 0 0 8px 0; }
.kv-msg-bot p:last-child { margin-bottom: 0; }
.kv-msg-bot ul, .kv-msg-bot ol { margin: 4px 0 8px 18px; padding: 0; }
.kv-msg-bot li { margin-bottom: 4px; }
.kv-msg-bot code { background: #edf2f7; padding: 1px 5px; border-radius: 4px; font-family: monospace; font-size: 13px; }
.kv-msg-bot pre { background: #1e293b; color: #f8fafc; padding: 8px 10px; border-radius: 6px; overflow-x: auto; margin: 6px 0; font-size: 12.5px; }
.kv-msg-bot pre code { background: none; color: inherit; padding: 0; }

.kv-msg-thumb-wrap { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.kv-msg-thumb-solo { margin-top: 0; }
.kv-msg-thumb {
    max-width: 84px; max-height: 64px; border-radius: 6px; display: block;
    cursor: zoom-in; object-fit: cover; border: 1px solid rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.kv-msg-thumb:hover { opacity: 0.9; transform: scale(1.04); }

#kv-ai-img-modal {
    display: none; position: fixed; inset: 0; z-index: 9999999;
    background: rgba(15, 23, 42, 0.82); align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box;
}
.kv-ai-img-modal-inner { position: relative; max-width: 92vw; max-height: 92vh; }
.kv-ai-img-modal-inner img {
    max-width: 92vw; max-height: 88vh; border-radius: 8px; display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45); background: #fff;
}
.kv-ai-img-modal-close {
    position: absolute; top: -14px; right: -14px; width: 32px; height: 32px;
    border-radius: 50%; border: none; background: #fff; color: #0f172a;
    font-size: 20px; line-height: 1; font-weight: bold; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.kv-ai-form { display: flex; padding: 10px; border-top: 1px solid #e2e8f0; background: #fff; gap: 6px; align-items: center; }
.kv-ai-input { flex: 1; border: 1px solid #cbd5e0; border-radius: 6px; padding: 8px 10px; font-size: 14px; outline: none; }
.kv-ai-file-btn { background: #edf2f7; border: none; border-radius: 6px; padding: 8px 10px; cursor: pointer; font-size: 14px; }
.kv-ai-send { background: var(--kv-ai-color, #0056b3); color: #fff; border: none; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.kv-ai-send:disabled { opacity: 0.6; cursor: not-allowed; }
