/* Nutrition tab. Loaded after styles.css so it can lean on the existing
   variables (--panel, --border, --accent, --text-dim) and card classes. */

.nutrition-datebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nutrition-datebar button {
  width: 2.5rem;
  padding: 0.5rem 0;
  font-size: 1.1rem;
  line-height: 1;
}
.nutrition-datebar label {
  flex: 1;
  margin-bottom: 0;
}

.nutrition-search {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.nutrition-search input {
  width: 100%;
}

.food-results {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 22rem;
  overflow-y: auto;
}

.food-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: 0.6rem 0.75rem;
}
.food-result:hover,
.food-result:focus-visible {
  border-color: var(--accent);
}
.food-result-name { font-weight: 600; font-size: 0.92rem; }
.food-result-meta { font-size: 0.78rem; color: var(--text-dim); }

.portion-form,
.manual-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.portion-form h3 { margin: 0; font-size: 1rem; }
.portion-form button,
.manual-form button { align-self: flex-start; }

.field-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0.15rem 0;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.hidden { display: none; }

.water-goal-row {
  margin: -0.25rem 0 0.75rem;
}
#waterGoalForm {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
#waterGoalForm label { margin-bottom: 0; font-size: 0.85rem; }
#waterGoalForm input { width: 6rem; }

.water-progress-track {
  width: 100%;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 0.4rem;
  overflow: hidden;
}
.water-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.supplement-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.supplement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: 0.6rem 0.75rem;
  flex-wrap: wrap;
}
.supplement-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 8rem;
}
.supplement-name { font-weight: 600; font-size: 0.9rem; }

.supplement-pills {
  display: flex;
  gap: 0.3rem;
}
.supplement-pill {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  font-size: 0.85rem;
  padding: 0;
}
.supplement-pill.taken {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

@media (min-width: 640px) {
  .manual-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    align-items: end;
  }
  .manual-form button { grid-column: 1 / -1; }
}
