.food-entry-steps {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.food-entry-steps > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft, #6a7f7c);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.food-entry-steps > span b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #57716d;
  background: #e8f1ef;
}

.food-entry-steps > span.active { color: #087f77; }
.food-entry-steps > span.active b { color: #fff; background: #0b9288; }
.food-entry-steps > i { height: 1px; background: rgba(21, 94, 89, 0.16); }

.food-meal-type {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.food-meal-type legend {
  margin-bottom: 9px;
  color: var(--ink, #173f3c);
  font-size: 0.78rem;
  font-weight: 800;
}

.food-meal-type > div {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 5px;
  scrollbar-width: none;
}

.food-meal-type > div::-webkit-scrollbar { display: none; }

.food-meal-type button,
.food-portion-presets button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(20, 105, 98, 0.14);
  border-radius: 999px;
  color: var(--ink-soft, #617a76);
  background: rgba(247, 252, 251, 0.92);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
}

.food-meal-type button[aria-pressed="true"] {
  color: #fff;
  border-color: #0b9288;
  background: #0b9288;
  box-shadow: 0 8px 22px rgba(11, 146, 136, 0.2);
}

.food-calculate-action {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin: 14px 0 4px;
  padding: 14px 16px;
  text-align: left;
  color: #f2fffd;
  border: 1px solid #087f77;
  border-radius: 20px;
  background: linear-gradient(135deg, #0b8f86 0%, #076b67 100%);
  box-shadow: 0 15px 30px rgba(7, 107, 103, .22);
}

.food-calculate-action > svg:first-child {
  width: 25px;
  height: 25px;
  padding: 9px;
  overflow: visible;
  border-radius: 13px;
  color: #073e3b;
  background: #b7f2e9;
  box-sizing: content-box;
}

.food-calculate-action span { display: grid; gap: 3px; }
.food-calculate-action b { font-size: .98rem; line-height: 1.15; }
.food-calculate-action small { color: rgba(239,255,252,.78); font-size: .7rem; line-height: 1.35; }
.food-calculate-action__arrow { width: 19px; height: 19px; }
.food-calculate-action:disabled { opacity: .56; box-shadow: none; }

.food-input-tools {
  padding: 10px;
  border: 1px solid rgba(14, 127, 119, .1);
  border-radius: 24px;
  background: rgba(241, 249, 247, .66);
}

.food-input-tools::before {
  content: "Добавить данные";
  grid-column: 1 / -1;
  padding: 0 5px 2px;
  color: var(--ink-soft, #617a76);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.food-macro-grid[hidden] { display: none !important; }
.food-macro-grid:not([hidden]) { animation: food-results-in .24s ease-out both; }

@keyframes food-results-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.food-recognition-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.food-recognition-controls input[type="range"] {
  width: 100%;
  accent-color: #0b9288;
}

.food-portion-presets { display: flex; gap: 5px; }
.food-portion-presets button { min-height: 32px; padding: 5px 9px; font-size: 0.68rem; }
.food-portion-presets button:active { transform: scale(0.96); }

html[data-theme="dark"] .food-entry-steps > span b { color: #a9c9c5; background: #183f3c; }
html[data-theme="dark"] .food-entry-steps > span.active { color: #8af0e7; }
html[data-theme="dark"] .food-entry-steps > span.active b { color: #062c29; background: #77e4da; }
html[data-theme="dark"] .food-meal-type button,
html[data-theme="dark"] .food-portion-presets button {
  color: #b9d5d1;
  border-color: rgba(120, 229, 220, 0.18);
  background: #153b38;
}
html[data-theme="dark"] .food-meal-type button[aria-pressed="true"] { color: #062d2a; background: #7ce6dd; }
html[data-theme="dark"] .food-input-tools { border-color: rgba(120,229,220,.12); background: rgba(13,43,44,.72); }
html[data-theme="dark"] .food-calculate-action { color: #eafffc; border-color: #4fd6ca; background: linear-gradient(135deg, #126d68, #0b4b49); }
html[data-theme="dark"] .food-calculate-action small { color: #b8d8d4; }

@media (max-width: 360px) {
  .food-entry-steps > span { font-size: 0; }
  .food-entry-steps > span b { font-size: 0.7rem; }
  .food-recognition-controls { grid-template-columns: 1fr; }
  .food-calculate-action { min-height: 68px; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .food-meal-type button,
  .food-portion-presets button { transition: none; }
  .food-macro-grid:not([hidden]) { animation: none; }
}
