.ai-agent-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.ai-agent-toggle {
  border: none;
  background: #fff;
  color: #333;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.ai-agent-toggle:hover {
  background: #f0f4ff;
}

.ai-agent-hint {
  font-size: 14px;
  color: #666;
}

.ai-agent-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  background: #fff;
  border: 1px solid #edf2f9;
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(360px, calc(100vw - 32px));
  max-height: 70vh;
  flex-direction: column;
  user-select: none;
}

.ai-agent-header {
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.ai-agent-close {
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 999px;
}

.ai-agent-close:hover {
  background: #f3f4f6;
}

.ai-agent-header {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.ai-agent-messages {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 16px;
}

.ai-agent-message {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-agent-system {
  background: #f4f7fb;
  border: 1px solid #e2e8f0;
  color: #444;
}

.ai-agent-user {
  background: #007bff;
  color: white;
  align-self: flex-end;
}

.ai-agent-assistant {
  background: #f1f5f9;
  color: #0f172a;
}

.ai-agent-loading {
  background: #fff7ed;
  color: #92400e;
}

.ai-agent-message code.ai-agent-inline-code {
  background: rgba(15, 23, 42, 0.08);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.ai-agent-code-block {
  background: #0f172a;
  color: #f8fafc;
  padding: 12px;
  border-radius: 14px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  margin: 10px 0;
}

.ai-agent-message a {
  color: #2563eb;
  text-decoration: underline;
}

.ai-agent-message ul,
.ai-agent-message ol {
  margin: 8px 0 8px 18px;
}

.ai-agent-message h1,
.ai-agent-message h2,
.ai-agent-message h3,
.ai-agent-message h4,
.ai-agent-message h5,
.ai-agent-message h6 {
  margin: 10px 0 8px;
}

.ai-agent-message blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 3px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

.ai-agent-input-area {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ai-agent-textarea {
  flex: 1;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  resize: both;
  min-height: 56px;
  max-height: 55vh;
}

.ai-agent-send-button {
  border: none;
  background: #111827;
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.ai-agent-send-button:hover {
  background: #1f2937;
}

.ai-agent-footer {
  margin-top: 12px;
  color: #6b7280;
  font-size: 12px;
}
