/* Shared, scoped chat component for the landing and OWNER preview. */
.kayfa-ai-chat { --ai-green: #173f32; --ai-paper: #f5f2e9; color: #173f32; font-family: inherit; min-width: 0; }
.kayfa-ai-chat * { box-sizing: border-box; }
.kayfa-ai-chat [hidden] { display: none !important; }
.kayfa-ai-chat .ai-consent { background: var(--ai-paper); color: var(--ai-green); border: 1px solid #d8ddd4; border-radius: 14px; padding: 14px; margin-bottom: 12px; font-size: 13px; line-height: 1.6; }
.kayfa-ai-chat .ai-consent p { margin: 8px 0; }
.kayfa-ai-chat .ai-consent summary { cursor: pointer; text-decoration: underline; }
.kayfa-ai-chat .ai-consent button { margin-top: 12px; }
.kayfa-ai-chat > .ai-privacy { font-size: 12px; line-height: 1.6; margin-top: 8px; }
#aiHistory .ai-history-text { white-space: pre-wrap; overflow-wrap: anywhere; }
#aiHistory .ai-history-meta { overflow-wrap: anywhere; }
.kayfa-ai-chat .ai-messages { height: 290px; overflow-y: auto; padding: 14px; background: var(--ai-paper); border: 1px solid #d8ddd4; border-radius: 14px; overscroll-behavior: contain; }
.kayfa-ai-chat .ai-message { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; border-radius: 12px; margin: 0 24px 10px 0; background: #fff; color: #173f32; line-height: 1.6; font-size: 14px; }
.kayfa-ai-chat .ai-message--user { margin: 0 0 10px 24px; background: #173f32; color: #fff; }
.kayfa-ai-chat .ai-message strong { display: block; font-size: 11px; margin-bottom: 3px; }
.kayfa-ai-chat .ai-chat-form { display: flex; gap: 8px; margin-top: 12px; align-items: end; }
.kayfa-ai-chat textarea { width: 100%; min-width: 0; min-height: 70px; resize: vertical; border: 1px solid #acb9ae; border-radius: 10px; padding: 10px; background: #fff; color: #173f32; font: inherit; font-size: 14px; }
.kayfa-ai-chat button, .kayfa-ai-chat .ai-contact { border: 1px solid #b0bfb3; border-radius: 9px; padding: 9px 13px; background: #173f32; color: #fff; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; }
.kayfa-ai-chat button:disabled { cursor: not-allowed; opacity: .55; }
.kayfa-ai-chat button:focus-visible, .kayfa-ai-chat textarea:focus-visible, .kayfa-ai-chat a:focus-visible { outline: 3px solid #bf8c50; outline-offset: 3px; }
.kayfa-ai-chat .ai-chat-status { min-height: 24px; font-size: 13px; margin-top: 8px; color: inherit; overflow-wrap: anywhere; }
.kayfa-ai-chat .ai-handoff { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.kayfa-ai-chat .ai-contact, .kayfa-ai-chat .ai-reset { background: #f5f2e9; color: #173f32; }
.kayfa-ai-chat .ai-chat-note { font-size: 12px; line-height: 1.6; margin: 8px 0; color: inherit; }
#aiSettings .kayfa-ai-chat { color: var(--bs-body-color); }
#aiSettings .ai-version-content { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow-y: auto; font: inherit; font-size: 13px; }
.kayfa-ai-chat .ai-handoff .ai-contact { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 8px; text-align: center; }
.kayfa-ai-chat .ai-reset { display: block; min-height: 44px; margin: 14px 0 0 auto; }
.kayfa-landing .ai-dialog { border: 1px solid #cbd5c8; border-radius: 24px; background: #f5f2e9; color: #173f32; padding: 24px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; margin: auto; box-shadow: 0 20px 80px #0005; }
.kayfa-landing .ai-dialog::backdrop { background: #122d25aa; }
.kayfa-landing .ai-dialog-head { display: flex; gap: 12px; align-items: start; justify-content: space-between; margin-bottom: 12px; }
.kayfa-landing .ai-dialog h3 { font-size: 24px; margin: 0; }
.kayfa-landing .ai-dialog-close { background: none; border: 0; color: inherit; cursor: pointer; font-size: 28px; padding: 0 6px; }
@media (max-width: 575px) {
    .kayfa-landing .ai-dialog { padding: 18px; }
    .kayfa-ai-chat .ai-messages { height: min(290px, 38dvh); }
}
