/* nutrition.css — page-specific styles for #page-nutrition */

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.macro-legend {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.macro-legend span { display: flex; align-items: center; }

.meal-card .meal-entries {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.food-entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.food-entry-row:last-child { border-bottom: none; }

.food-entry-name {
  font-size: 14px;
  font-weight: 500;
}

.food-entry-meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}

.donut-ring { flex-shrink: 0; }

.macro-target-row + .macro-target-row { margin-top: 10px; }

.macro-target-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.macro-target-label span:first-child { color: var(--text-dim); }

.profile-prompt {
  text-align: center;
  padding: var(--space-2) var(--space-2) var(--space-3);
}

.profile-prompt p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

#nutrition-week-view .card-title { margin-bottom: var(--space-4); }

/* ---- Scan Food ---- */
.food-scan-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.food-scan-stage video,
.food-scan-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.food-scan-result {
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-3);
  background: rgba(15,15,15,0.85);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  z-index: 5;
}

/* ---- "What should I eat?" sheet ---- */
.suggest-needs {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  margin-bottom: var(--space-3);
}
.suggest-needs strong { color: var(--text); }

.suggest-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item-main { flex: 1; min-width: 0; }
.suggest-item .btn { flex-shrink: 0; }

.suggest-why {
  font-size: 12px;
  color: var(--accent);
  margin-top: 3px;
}

.suggest-empty { font-size: 13px; padding: var(--space-3) 0; }

.suggest-footnote {
  font-size: 11px;
  margin-top: var(--space-3);
}

/* Which calorie target is in use (js/targets.js) */
.target-note { font-size: 12px; line-height: 1.4; color: var(--text-faint); margin: -4px 0 10px; }
.target-note-adaptive { color: var(--accent); }

/* ---- Quick logging: recent foods, copy a meal ---- */
.food-recent { margin-bottom: var(--space-3); }
.food-recent-label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.food-recent-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.food-recent-item {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  max-width: 180px; padding: 8px 12px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated);
}
.food-recent-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.food-recent-meta { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.copy-meal-btn { margin-top: 6px; padding-left: 0; text-align: left; color: var(--accent); }

/* Added sugar: bar row on the day cards, "High sugar" pill on library foods, form hint */
.sugar-note {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  line-height: 1.35;
}
.sugar-over .sugar-note,
.sugar-over .macro-target-label span:last-child { color: var(--warning); }
.sugar-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--sugar);
  background: rgba(168, 85, 247, 0.15);
}
.sugar-field-hint {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  margin: 22px 0 0;
}
