#kv-ai-btn {
    position: fixed; bottom: 20px; right: 20px; z-index: 999999;
    background: var(--kv-ai-color, #0056b3); color: #fff; border: none; border-radius: 50px;
    padding: 12px 20px; font-size: 15px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.22); font-family: sans-serif;
}
#kv-ai-btn:hover { opacity: 0.92; }

.kv-ai-box {
    background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    flex-direction: column; overflow: hidden; font-family: sans-serif; border: 1px solid #e2e8f0;
    box-sizing: border-box;
}
.kv-ai-floating {
    display: none; position: fixed; bottom: 76px; right: 20px; z-index: 999999;
    width: var(--kv-ai-float-w, clamp(320px, 30vw, calc(100vw - 32px)));
    max-width: calc(100vw - 32px);
    height: var(--kv-ai-float-h, 75vh);
    min-height: 360px;
    max-height: calc(100vh - 100px);
}
.kv-ai-inline {
    display: flex;
    width: var(--kv-ai-inline-w, 100%);
    max-width: 100%;
    height: var(--kv-ai-inline-h, 70vh);
    min-height: 360px;
    max-height: 92vh;
    margin: 20px auto;
}
.kv-ai-inline.kv-ai-no-ai:not(.kv-ai-has-height),
.kv-ai-floating.kv-ai-no-ai:not(.kv-ai-has-height) {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}
.kv-ai-no-ai.kv-ai-has-height .kv-ai-op-panel {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    overflow-y: auto;
}
.kv-ai-no-ai.kv-ai-has-height .kv-ai-op-form {
    flex: 1;
}
.kv-ai-no-ai.kv-ai-has-height .kv-ai-op-question {
    flex: 1;
    min-height: 90px;
    resize: none;
}

.kv-ai-header {
    background: var(--kv-ai-color, #0056b3); color: #fff; padding: 11px 14px; font-weight: 600;
    display: flex; justify-content: space-between; align-items: center; font-size: 15px; gap: 8px;
}
.kv-ai-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv-ai-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.kv-ai-op-btn, .kv-ai-help-btn, .kv-ai-reset {
    background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.35);
    color: #fff; border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; font-weight: 500;
}
.kv-ai-op-btn { background: rgba(255,255,255,0.28); font-weight: 600; }
.kv-ai-op-btn:hover, .kv-ai-help-btn:hover, .kv-ai-reset:hover { background: rgba(255,255,255,0.38); }
.kv-ai-close { background: none; border: none; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }

.kv-ai-help-panel {
    background: #eff6ff; border-bottom: 1px solid #bfdbfe; padding: 10px 14px;
    font-size: 13px; color: #1e3a8a; line-height: 1.45;
}
.kv-ai-help-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.kv-ai-help-close { background: none; border: none; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }

.kv-ai-inline-wrap {
    width: var(--kv-ai-inline-w, 100%);
    max-width: 100%;
    margin: 16px auto;
    box-sizing: border-box;
}
.kv-ai-inline-wrap .kv-ai-inline {
    margin: 12px 0 0 0;
}
.kv-ai-inline-trigger {
    background: var(--kv-ai-color, #0056b3); color: #fff; border: none; border-radius: 8px;
    padding: 12px 22px; font-size: 15px; font-weight: 600; cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.14); font-family: sans-serif;
}
.kv-ai-inline-trigger:hover { opacity: 0.92; }
