/* ══════════════════════════════════════════════════════════════
   KNOWLEDGE BASE (AnythingLLM)
   ══════════════════════════════════════════════════════════════ */

.allm-status-bar{display:flex;align-items:center;gap:12px;padding:12px 18px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);margin-bottom:20px;flex-wrap:wrap;}
.allm-status-dot{width:9px;height:9px;border-radius:50%;flex-shrink:0;}
.allm-status-dot.connected{background:var(--success);box-shadow:0 0 6px color-mix(in oklch,var(--success) 60%,transparent);animation:pulse-g 2s ease-in-out infinite;}
.allm-status-dot.disconnected{background:var(--text-faint);}
.allm-status-text{font-size:13px;font-weight:500;flex:1;}
.allm-status-sub{font-size:11.5px;color:var(--text-muted);}

/* Setup steps */
.allm-setup{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:20px;}
.allm-step-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px;}
.allm-step-header{display:flex;align-items:center;gap:10px;margin-bottom:12px;}
.allm-step-num{width:26px;height:26px;border-radius:50%;background:var(--primary-bg);color:var(--primary);border:1px solid color-mix(in oklch,var(--primary) 40%,transparent);font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.allm-step-title{font-size:13px;font-weight:600;}
.allm-step-desc{font-size:12px;color:var(--text-muted);line-height:1.6;margin-bottom:10px;}

/* Code blocks */
.allm-code-block{background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 14px;font-family:'JetBrains Mono',monospace;font-size:11px;color:var(--accent);white-space:pre;overflow-x:auto;position:relative;line-height:1.7;}
.allm-copy-btn{position:absolute;top:7px;right:8px;background:var(--surface-off);border:1px solid var(--border);border-radius:var(--radius-sm);padding:3px 9px;font-size:10.5px;font-weight:500;color:var(--text-muted);cursor:pointer;transition:all .15s;}
.allm-copy-btn:hover{border-color:var(--primary);color:var(--primary);}

/* Config card */
.allm-config-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;margin-bottom:20px;}
.allm-config-head{display:flex;align-items:center;justify-content:space-between;padding:13px 18px;border-bottom:1px solid var(--divider);cursor:pointer;user-select:none;}
.allm-config-head:hover{background:var(--surface-off);}
.allm-config-title{font-size:13px;font-weight:600;display:flex;align-items:center;gap:8px;}
.allm-config-body{padding:18px;display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.allm-config-body.hidden{display:none;}

/* Chat layout */
.allm-chat-layout{display:grid;grid-template-rows:1fr auto;height:calc(100vh - 240px);min-height:400px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;}
.allm-messages{overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:14px;overscroll-behavior:contain;}
.allm-msg{display:flex;flex-direction:column;gap:4px;max-width:82%;}
.allm-msg.user{align-self:flex-end;align-items:flex-end;}
.allm-msg.assistant{align-self:flex-start;align-items:flex-start;}
.allm-msg-bubble{padding:10px 14px;border-radius:var(--radius);font-size:13px;line-height:1.6;}
.allm-msg.user .allm-msg-bubble{background:var(--primary);color:#fff;border-bottom-right-radius:3px;}
.allm-msg.assistant .allm-msg-bubble{background:var(--surface-off);border:1px solid var(--border);border-bottom-left-radius:3px;color:var(--text);}
.allm-msg-time{font-size:10.5px;color:var(--text-faint);font-family:'JetBrains Mono',monospace;}

/* Typing indicator */
.allm-typing{display:flex;align-items:center;gap:5px;padding:10px 14px;background:var(--surface-off);border:1px solid var(--border);border-radius:var(--radius);border-bottom-left-radius:3px;width:fit-content;}
.allm-typing span{width:7px;height:7px;border-radius:50%;background:var(--text-faint);animation:allm-bounce .8s ease-in-out infinite;}
.allm-typing span:nth-child(2){animation-delay:.15s;}
.allm-typing span:nth-child(3){animation-delay:.3s;}
@keyframes allm-bounce{0%,80%,100%{transform:translateY(0)}40%{transform:translateY(-6px)}}

/* Input bar */
.allm-input-bar{border-top:1px solid var(--border);padding:14px 16px;background:var(--surface-off);display:flex;flex-direction:column;gap:10px;}
.allm-mode-row{display:flex;align-items:center;gap:8px;}
.allm-mode-btn{padding:4px 12px;border-radius:99px;font-size:11.5px;font-weight:500;border:1px solid var(--border);color:var(--text-muted);cursor:pointer;transition:all .15s;background:none;}
.allm-mode-btn:hover{border-color:var(--primary);color:var(--primary);}
.allm-mode-btn.active{background:var(--primary-bg);border-color:var(--primary);color:var(--primary);}
.allm-mode-hint{font-size:11px;color:var(--text-faint);margin-left:auto;}
.allm-input-row{display:flex;gap:10px;}
.allm-input{flex:1;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:9px 14px;font-size:13.5px;color:var(--text);outline:none;resize:none;font-family:'Inter',sans-serif;line-height:1.5;max-height:120px;transition:border-color .15s;}
.allm-input:focus{border-color:var(--primary);}
.allm-send-btn{padding:9px 18px;background:linear-gradient(135deg,var(--primary),var(--accent));color:#fff;border:none;border-radius:var(--radius-sm);font-size:13px;font-weight:600;cursor:pointer;transition:filter .15s;display:flex;align-items:center;gap:6px;flex-shrink:0;}
.allm-send-btn:hover:not(:disabled){filter:brightness(1.1);}
.allm-send-btn:disabled{opacity:.45;cursor:not-allowed;}
.allm-send-btn svg,.allm-send-btn i{width:14px;height:14px;}

/* Empty state */
.allm-empty-chat{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;gap:14px;text-align:center;padding:40px;color:var(--text-muted);}
.allm-empty-chat i,.allm-empty-chat svg{width:40px;height:40px;color:var(--text-faint);}
.allm-empty-chat h3{font-size:15px;font-weight:600;color:var(--text);}
.allm-empty-chat p{font-size:12.5px;max-width:38ch;}
.allm-suggestions{display:flex;flex-wrap:wrap;gap:7px;justify-content:center;margin-top:6px;}
.allm-suggestion{font-size:12px;padding:6px 13px;border-radius:99px;border:1px solid var(--border);color:var(--text-muted);cursor:pointer;transition:all .15s;background:var(--surface-off);}
.allm-suggestion:hover{border-color:var(--primary);color:var(--primary);background:var(--primary-bg);}

/* Not configured */
.allm-not-configured{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:60px 32px;text-align:center;background:var(--surface);border:1px dashed var(--border);border-radius:var(--radius-lg);}
.allm-not-configured i,.allm-not-configured svg{width:44px;height:44px;color:var(--text-faint);}

@media(max-width:768px){
  .allm-setup{grid-template-columns:1fr;}
  .allm-config-body{grid-template-columns:1fr;}
  .allm-chat-layout{height:calc(100vh - 280px);}
}
/* Export methods */
.allm-export-method{background:var(--surface-off);border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 12px;}

/* Test result */
.allm-test-row{display:flex;align-items:center;gap:8px;margin-top:4px;grid-column:1/-1;}
.allm-test-result{font-size:12px;color:var(--text-muted);}
.allm-test-result.ok{color:var(--success);}
.allm-test-result.err{color:var(--error);}

/* Sources */
.allm-sources{margin-top:6px;display:flex;flex-wrap:wrap;gap:5px;}
.allm-source-chip{font-size:10.5px;padding:2px 8px;border-radius:99px;background:var(--info-bg);color:var(--info);border:1px solid color-mix(in oklch,var(--info) 30%,transparent);display:flex;align-items:center;gap:4px;}
.allm-source-chip i,.allm-source-chip svg{width:10px;height:10px;}