diff --git a/proiect-nutritie-java/src/main/webapp/index.html b/proiect-nutritie-java/src/main/webapp/index.html
index 333d75b..f7e38e4 100644
--- a/proiect-nutritie-java/src/main/webapp/index.html
+++ b/proiect-nutritie-java/src/main/webapp/index.html
@@ -194,14 +194,15 @@
const id = 'ai-'+Date.now(); box.innerHTML += `
Analyzing nutrition data...
`;
box.scrollTop = box.scrollHeight;
- const sysPrompt = {role:"system", content: `Expert Dietitian. Target: ${document.getElementById('kcal').innerText} kcal. SYSTEM: ${isMetric ? 'METRIC' : 'IMPERIAL'}.
+ const sysPrompt = {role:"system", content: `Expert Dietitian. TARGET: ${document.getElementById('kcal').innerText} kcal. SYSTEM: ${isMetric ? 'METRIC' : 'IMPERIAL'}.
+ CRITICAL MATH RULE: You MUST calculate the exact "Weight (RAW)" for every ingredient so that the sum of all meals equals precisely ${document.getElementById('kcal').innerText} kcal. The math in your tables MUST add up to this specific target.
HIERARCHY RULES:
- 1. Break down by DAY (e.g., ### Monday).
- 2. Break down each day by MEAL (e.g., #### Breakfast).
- 3. Every meal MUST have a table: | Ingredient | Weight (RAW) | Calories | P(g) | C(g) | F(g) |.
+ 1. Break down by DAY (### Monday).
+ 2. Break down each day by MEAL (#### Breakfast).
+ 3. Every meal MUST have a table: | Ingredient | Weight (RAW) | Calories | P(g) | C(g) | f(g) |.
4. After each meal table, provide "Meal Total: [Kcal] | [P] | [C] | [F]".
5. At the end of each DAY, provide a bold "Daily Total: [Kcal] | [P] | [C] | [F]".
- 6. MANDATORY: Use DRY/RAW weights only.
+ 6. MANDATORY: Use DRY/RAW weights only for all calories/macros.
7. Refer to previous messages for "GENERATE_SHOPPING_LIST" requests.`};
conversationHistory.push({role: "user", content: text});