body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #121212;
  color: #fff;
}

.container {
  max-width: 520px;
  margin: auto;
  padding: 16px;
}

h1, h2 {
  text-align: center;
  margin-bottom: 6px;
}

.streak {
  text-align: center;
  font-weight: bold;
  color: #4caf50;
  margin-bottom: 10px;
}

input, textarea, button, select {
  width: 100%;
  padding: 8px;
  background: #1e1e1e;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  box-sizing: border-box;
}

textarea {
  resize: vertical;
}

.tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}

.tabs button {
  flex: 1;
}

.tabs .active {
  background: #4caf50;
}

.category {
  background: #1e1e1e;
  padding: 6px;
  border-radius: 6px;
  margin-top: 6px;
}

.category.hit {
  border: 1px solid #4caf50;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

}

.category-left {
  width: 90px;
  font-weight: bold;
}

.progress {
  background: #333;
  height: 8px;
  border-radius: 4px;
  flex: 1;
  overflow: hidden;
}

.bar {
  height: 100%;
  background: #888;
}

.bar.hit {
  background: #4caf50;
}

.controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.controls button {
  width: 32px;
}

.food-section {
  margin-top: 16px;
  padding: 10px;
  background: #1e1e1e;
  border-radius: 6px;
}

.fp-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}
.app-version {
  position: fixed;
  bottom: 6px;
  left: 8px;
  font-size: 11px;
  color: #777;
  opacity: 0.8;
  pointer-events: none;
}

#mealSelector .meal-btn.active {
  background: #2196f3; /* blue */
  color: #000;
}

#mealSelector {
  display: flex;
  align-items: center;
  gap: 8px;
}

#mealSelector {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #121212;
  padding: 8px 0;
  border-bottom: 1px solid #333;
}

#mealSelector .meal-btn {
  background: #1e1e1e;
  color: #ccc;
}

#snackToggle {
  margin-left: auto;
  padding: 10px 14px;
  font-weight: bold;
}

#snackToggle.active {
  background: #ff9800;
  color: #000;
}

#snackbar {
  visibility: hidden;
  min-width: 200px;
  background: #333;
  color: #fff;
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

#snackbar.show {
  visibility: visible;
}

#mealSelector .meal-btn,
#snackToggle {
  height: 44px;
  padding: 0 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mealSelector button {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
}

#mealSelector .icon {
  font-size: 20px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

/* animate active meal */
#mealSelector .meal-btn.active .icon {
  transform: scale(1.25) rotate(-5deg);
  filter: brightness(1.2);
}

/* animate snack toggle */
#snackToggle.active .icon {
  transform: scale(1.3) rotate(10deg);
}

/* smooth tap feedback */
#mealSelector button:active .icon {
  transform: scale(0.9);
}

/* auto hide text on smaller screens */
@media (max-width: 420px) {
  #mealSelector .label {
    display: none;
  }

  #mealSelector button {
    padding: 0 10px;
  }
}

.cat-box {
  border-radius: 3px;
}
.cat-box:empty {
  opacity: 0.35;
}

.food-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.food-actions button {
  flex: 1;
  height: 44px;          /* match meal buttons */
  font-weight: bold;
}

/* optional: visual differentiation */
#deleteFoodBtn {
  background: #c62828;
  color: #fff;
}

.food-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.food-row select {
  flex: 1;
}

.qty-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-inline button {
  width: 44px;
  height: 44px;
  font-weight: bold;
}

#qtyDisplay {
  min-width: 24px;
  text-align: center;
  font-weight: bold;
}

#saveFoodBtn {
  background: #4caf50;
  color: #000;
  font-weight: bold;
}

/* Make "Use for" a compact action button */
#addFoodBtn {
  width: 100%;
  max-width: 320px;
  height: 48px;
  background: #4caf50;
  color: #000;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 10px;
}

.use-food-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* Extra vertical spacing below +/- buttons to prevent mis-taps */
.qty-inline {
  margin-bottom: 12px;
}

/* Force select to visually match +/- buttons */
.food-row select {
  height: 44px;
  padding: 0 10px;
  box-sizing: border-box;

  /* critical */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  display: flex;
  align-items: center;
}

.qty-inline button {
  height: 44px;
}

.food-row select {
  height: 44px !important;
  min-height: 44px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.qty-inline button {
  height: 44px;
}

/* Force perfect vertical alignment of qty controls */
.food-row {
  display: flex;
  align-items: center;
}

.qty-inline {
  display: flex;
  align-items: center;
}

.qty-inline button,
#qtyDisplay {
  display: flex;
  align-items: center;
  justify-content: center;
}

#qtyDisplay {
  height: 44px;
}

textarea {
  overflow-y: hidden;
  resize: none;
}

