#ai-chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 9998;
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
  background: #76b900; color: #0a0a1a; border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  transition: transform .15s ease;
}
#ai-chat-fab:hover { transform: scale(1.08); }

#ai-chat-panel {
  position: fixed; right: 22px; bottom: 86px; z-index: 9999;
  width: 380px; max-width: calc(100vw - 32px); height: 540px; max-height: calc(100vh - 120px);
  background: #0f0f23; color: #e0e0e0; border: 1px solid #2a2a40; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); display: none; flex-direction: column; overflow: hidden;
  font-size: 14px;
}
#ai-chat-panel.open { display: flex; }

#ai-chat-header {
  padding: 10px 14px; background: #1e1e1e; border-bottom: 1px solid #2a2a40;
  display: flex; align-items: center; justify-content: space-between;
}
#ai-chat-header .title { color: #76b900; font-weight: 600; }
#ai-chat-header button { background: none; border: none; color: #888; cursor: pointer; font-size: 16px; }
#ai-chat-header button:hover { color: #e0e0e0; }

#ai-chat-messages { flex: 1; overflow-y: auto; padding: 12px; }
.ai-msg { margin-bottom: 12px; line-height: 1.5; }
.ai-msg .role { font-size: 11px; color: #608b4e; margin-bottom: 3px; }
.ai-msg.user .bubble { background: #252526; }
.ai-msg.assistant .bubble { background: #16213e; }
.ai-msg .bubble { padding: 8px 10px; border-radius: 6px; white-space: pre-wrap; word-break: break-word; }
.ai-msg .bubble pre { background: #0a0a1a; padding: 8px; border-radius: 4px; overflow-x: auto; }
.ai-msg .bubble code { background: #0a0a1a; padding: 1px 4px; border-radius: 3px; }
.ai-sources { margin-top: 6px; font-size: 12px; }
.ai-sources a { color: #569cd6; text-decoration: none; display: block; }
.ai-sources a:hover { text-decoration: underline; }
.ai-error { color: #ff6b6b; }

#ai-chat-input-row { display: flex; padding: 10px; border-top: 1px solid #2a2a40; gap: 8px; }
#ai-chat-input {
  flex: 1; resize: none; height: 38px; background: #1e1e1e; color: #e0e0e0;
  border: 1px solid #2a2a40; border-radius: 6px; padding: 8px; font-family: inherit; font-size: 14px;
}
#ai-chat-send { background: #76b900; color: #0a0a1a; border: none; border-radius: 6px; padding: 0 14px; cursor: pointer; }
#ai-chat-send:disabled { opacity: .5; cursor: default; }

#ai-chat-settings { padding: 12px; border-top: 1px solid #2a2a40; background: #16213e; }
#ai-chat-settings input { width: 100%; box-sizing: border-box; background: #1e1e1e; color: #e0e0e0;
  border: 1px solid #2a2a40; border-radius: 6px; padding: 8px; margin: 6px 0; }
#ai-chat-settings .hint { font-size: 11px; color: #888; }
#ai-chat-settings button { background: #00d4aa; color: #0a0a1a; border: none; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
