/* Базовая палитра = тема «Мятная» (светлая, зелёная) */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #7a8499;
  --line: #e6e9f0;
  --primary: #2f9e5f;
  --primary-dark: #24814c;
  --primary-soft: #e7f5ed;
  --accent-text: var(--primary);
  --danger: #d9534f;
  --danger-soft: #fdf1f0;
  --protein: #e0533d;
  --fat: #e2a700;
  --carbs: #3d7de0;
  --input-bg: #ffffff;
  --ghost-bg: #ffffff;
  --hover-bg: #fafbfe;
  --soft-bg: #fbfcfe;
  --chart-line: #c9cfda;
  --shadow: 0 6px 24px rgba(29, 36, 51, 0.06);
  --radius: 16px;
}

/* ---------- Темы оформления ---------- */
html[data-theme="blue"] {
  --bg: #eef3fb;
  --text: #172033;
  --muted: #6b7a91;
  --line: #dde6f3;
  --primary: #3d7de0;
  --primary-dark: #2f63b8;
  --primary-soft: #e7effc;
  --input-bg: #ffffff;
  --ghost-bg: #ffffff;
  --hover-bg: #f5f9ff;
  --soft-bg: #f5f9ff;
  --chart-line: #c3d2e8;
  --shadow: 0 6px 24px rgba(23, 32, 51, 0.07);
}
html[data-theme="warm"] {
  --bg: #fdf5ef;
  --text: #2b2018;
  --muted: #8a7a6c;
  --line: #f0e3d7;
  --primary: #e07a3d;
  --primary-dark: #c0632c;
  --primary-soft: #fdeee1;
  --input-bg: #ffffff;
  --ghost-bg: #ffffff;
  --hover-bg: #fdf7f2;
  --soft-bg: #fdf7f2;
  --chart-line: #e6d3c2;
  --shadow: 0 6px 24px rgba(43, 32, 24, 0.07);
}
html[data-theme="violet"] {
  --bg: #f6f3fb;
  --text: #241f33;
  --muted: #7d7593;
  --line: #e9e2f4;
  --primary: #7c5cd6;
  --primary-dark: #6647bd;
  --primary-soft: #efe9fb;
  --input-bg: #ffffff;
  --ghost-bg: #ffffff;
  --hover-bg: #faf7fe;
  --soft-bg: #faf7fe;
  --chart-line: #d9cdec;
  --shadow: 0 6px 24px rgba(36, 31, 51, 0.08);
}
html[data-theme="dark"] {
  --bg: #14181f;
  --card: #1e242e;
  --text: #ffffff;
  --muted: #b6c0d0;
  --line: #2b3340;
  --primary: #3fbf74;
  --primary-dark: #339e60;
  --primary-soft: #1d2c24;
  --danger: #e2685f;
  --danger-soft: #3a2323;
  --protein: #f0785f;
  --fat: #e9c04a;
  --carbs: #6aa0f0;
  --input-bg: #161b23;
  --ghost-bg: #232a35;
  --hover-bg: #232a35;
  --soft-bg: #1a2029;
  --chart-line: #3a4453;
  --shadow: 0 6px 26px rgba(0, 0, 0, 0.4);
}
html[data-theme="midnight"] {
  --bg: #0f1626;
  --card: #182135;
  --text: #ffffff;
  --muted: #b6c0d0;
  --line: #26334d;
  --primary: #4f8cf0;
  --primary-dark: #3f74cf;
  --primary-soft: #1a2a48;
  --danger: #e2685f;
  --danger-soft: #3a2323;
  --protein: #f0785f;
  --fat: #e9c04a;
  --carbs: #7ab0f5;
  --input-bg: #121b2d;
  --ghost-bg: #1e2a42;
  --hover-bg: #1e2a42;
  --soft-bg: #141d31;
  --chart-line: #33425f;
  --shadow: 0 6px 26px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  transition: background 0.25s ease, color 0.25s ease;
}

h1, h2, h3 { margin: 0; font-weight: 650; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; }

.muted { color: var(--muted); font-size: 0.88rem; }

/* ---------- Шапка ---------- */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px 0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 30px; }
.brand h1 { font-size: 1.25rem; }
.brand-sub { margin: 0; color: var(--muted); font-size: 0.8rem; }

.tabs { display: flex; gap: 4px; margin-top: 12px; }
.tab {
  border: none;
  background: transparent;
  padding: 10px 16px;
  border-radius: 10px 10px 0 0;
  font: inherit;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tab:hover { color: var(--text); background: var(--bg); }
.tab.active { color: var(--accent-text); border-bottom-color: var(--accent-text); }

/* ---------- Контент ---------- */
.content { max-width: 1060px; margin: 0 auto; padding: 22px 20px 60px; }
.view { display: none; }
.view.active { display: block; animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Кнопки ---------- */
.btn {
  font: inherit;
  font-weight: 550;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 15px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-ghost { background: var(--ghost-bg); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--hover-bg); }
.btn-danger { background: var(--ghost-bg); border-color: var(--line); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.icon-btn {
  border: 1px solid var(--line);
  background: var(--ghost-bg);
  border-radius: 10px;
  width: 34px; height: 34px;
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
  line-height: 1;
}
.icon-btn:hover { background: var(--bg); }

/* ---------- Дневник ---------- */
.date-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.date-block { display: flex; flex-direction: column; }
#day-picker { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; background: var(--input-bg); color: var(--text); }
.date-label { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.summary { display: flex; align-items: center; gap: 30px; margin-top: 18px; flex-wrap: wrap; }
.ring-wrap { position: relative; width: 150px; height: 150px; flex: none; }
.ring { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 11; }
.ring-fg {
  fill: none; stroke: var(--primary); stroke-width: 11; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s;
}
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.ring-eaten { font-size: 1.9rem; font-weight: 700; }
.ring-of { font-size: 0.75rem; color: var(--muted); }

.summary-numbers { display: grid; grid-template-columns: repeat(2, minmax(90px, 1fr)); gap: 14px 30px; }
.sum-item { display: flex; flex-direction: column; }
.sum-val { font-size: 1.4rem; font-weight: 700; }
.sum-lbl { font-size: 0.78rem; color: var(--muted); }

.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.macro-top { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 5px; }
.macro-bar { height: 8px; background: var(--line); border-radius: 5px; overflow: hidden; }
.fill { display: block; height: 100%; width: 0; border-radius: 5px; transition: width 0.4s ease; }
.fill.p { background: var(--protein); }
.fill.f { background: var(--fat); }
.fill.c { background: var(--carbs); }

/* Приёмы пищи */
.meals { display: flex; flex-direction: column; gap: 14px; }
.meal-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.meal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.meal-title { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.meal-emoji { font-size: 1.2rem; }
.meal-kcal { color: var(--muted); font-size: 0.85rem; }
.meal-items { list-style: none; margin: 0; padding: 0; }
.meal-items li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px;
  align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line);
}
.meal-items li:last-child { border-bottom: none; }
.meal-items li:hover { background: var(--hover-bg); }
.item-name { min-width: 0; cursor: pointer; }
.item-name small { display: block; color: var(--muted); font-size: 0.76rem; }
.item-kcal { font-weight: 600; white-space: nowrap; }
.item-del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 18px; padding: 0 4px; border-radius: 6px; }
.item-del:hover { color: var(--danger); background: var(--danger-soft); }
.meal-empty { padding: 14px 20px; color: var(--muted); font-size: 0.86rem; }
.meal-add {
  margin: 12px 20px 16px; border: 1px dashed var(--line); background: var(--soft-bg);
  border-radius: 10px; width: calc(100% - 40px); padding: 10px; cursor: pointer;
  color: var(--accent-text); font: inherit; font-weight: 550;
}
.meal-add:hover { background: var(--primary-soft); border-color: var(--accent-text); }

/* ---------- Фильтры и таблица ---------- */
.filters { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.filters input:not([type="checkbox"]), .filters select {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; background: var(--input-bg); color: var(--text);
}
.filters input[type="search"] { flex: 1; min-width: 200px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: var(--hover-bg); }
.table tbody tr.is-hidden { opacity: 0.55; }
.check-inline { display: flex; flex-direction: row; align-items: center; gap: 7px; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.check-inline input { width: auto; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; background: var(--primary-soft); background: color-mix(in srgb, var(--primary) 20%, transparent); color: var(--text); font-size: 0.74rem; }
.badge.custom { background: #fdf0e5; color: #c06a1a; }
.badge.state { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.badge.name { font-size: 0.9rem; padding: 5px 12px; font-weight: 550; }
.link-danger { border: none; background: none; color: var(--danger); cursor: pointer; font: inherit; padding: 0; }

/* ---------- Статистика ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; margin: 0; }
.stat-lbl { font-size: 0.76rem; color: var(--muted); }
.stat-val { font-size: 1.7rem; font-weight: 700; }
.stat-sub { font-size: 0.74rem; color: var(--muted); }

.range-switch { display: flex; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: 0.83rem; }
.chip.active { background: var(--primary); color: #fff; border-color: var(--accent-text); }

.chart { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding: 16px 4px 0; overflow-x: auto; }
.bar-col { flex: 1; min-width: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-stack { position: relative; width: 100%; max-width: 42px; height: 100%; display: flex; align-items: flex-end; }
.bar-goal { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--chart-line); }
.bar-eaten { width: 100%; background: linear-gradient(180deg, var(--primary), var(--primary-dark)); border-radius: 6px 6px 0 0; min-height: 2px; transition: height 0.4s; }
.bar-eaten.over { background: var(--danger); }
.bar-lbl { font-size: 0.68rem; color: var(--muted); white-space: nowrap; }
.bar-val { font-size: 0.7rem; font-weight: 600; }
.chart-legend { display: flex; gap: 18px; margin-top: 10px; font-size: 0.8rem; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.dot.goal { background: transparent; border-top: 2px dashed var(--chart-line); height: 0; }
.dot.eaten { background: var(--primary); }

.meal-avg { display: grid; gap: 12px; margin-top: 8px; }
.avg-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: center; }
.avg-bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.avg-bar i { display: block; height: 100%; background: var(--primary); }

/* ---------- Формы ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 12px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.field-label { font-size: 0.85rem; color: var(--muted); }
.mode-switch { display: inline-flex; background: var(--soft-bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.mode-btn { border: none; background: transparent; color: var(--muted); font: inherit; font-size: 0.83rem; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.mode-btn.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.meal-create-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -4px; }
.meal-create { align-self: flex-start; margin-top: -4px; }
#dish-diary-block { display: flex; flex-direction: column; gap: 12px; border-top: 1px dashed var(--line); padding-top: 14px; }
#dish-diary-block[hidden] { display: none; }
.np-preview { background: var(--soft-bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 0.85rem; }
.np-preview b { font-variant-numeric: tabular-nums; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; color: var(--muted); }
label input:not([type="checkbox"]), label select {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; color: var(--text); background: var(--input-bg);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
label input:focus, label select:focus, .filters input:focus { outline: 2px solid var(--primary-soft); border-color: var(--accent-text); }

/* ---------- Выбор темы ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.theme-option {
  display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left;
  border: 2px solid var(--line); border-radius: 12px; padding: 9px 12px;
  background: var(--card); font: inherit; color: var(--text);
  transition: border-color 0.15s, transform 0.05s;
}
.theme-option:hover { border-color: var(--muted); }
.theme-option:active { transform: translateY(1px); }
.theme-option.active { border-color: var(--accent-text); }
.theme-preview {
  width: 34px; height: 34px; border-radius: 9px; flex: none; position: relative;
  border: 1px solid rgba(128, 128, 128, 0.3); overflow: hidden;
}
.theme-preview i { position: absolute; top: 50%; left: 50%; width: 15px; height: 15px; border-radius: 50%; transform: translate(-50%, -50%); }
.theme-name { font-size: 0.85rem; font-weight: 550; }
.theme-check { margin-left: auto; color: var(--accent-text); font-weight: 700; }

/* ---------- Фон карточек ---------- */
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; margin-top: 12px; }
.bg-swatch {
  position: relative; height: 56px; border-radius: 12px; cursor: pointer; padding: 0;
  border: 2px solid var(--line); overflow: hidden; background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bg-swatch:hover { border-color: var(--muted); }
.bg-swatch.active { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--primary-soft); }
.bg-swatch.theme-swatch { background: var(--bg); }
.bg-swatch .bg-check {
  position: absolute; right: 4px; bottom: 4px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px;
  line-height: 18px; text-align: center;
}
.bg-tools { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.inline-label { display: flex; align-items: center; gap: 9px; font-size: 0.85rem; color: var(--muted); }
.inline-label input[type="color"] {
  width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--input-bg); cursor: pointer;
}

/* ---------- Под-вкладки «Продукты / Блюда» ---------- */
.subtabs { display: flex; gap: 6px; margin-bottom: 14px; }
.subtab {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 10px; padding: 8px 16px; cursor: pointer; font: inherit; font-weight: 550;
}
.subtab:hover { color: var(--text); }
.subtab.active { background: var(--primary); color: #fff; border-color: var(--accent-text); }
.ptab-panel { display: none; }
.ptab-panel.active { display: block; }

/* ---------- Редактор блюда ---------- */
.modal-wide { max-width: 680px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 2px; }
.section-title { font-weight: 600; font-size: 0.9rem; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.ingredients { display: flex; flex-direction: column; gap: 8px; }
.ing-row { display: grid; grid-template-columns: 1fr 110px 34px; gap: 8px; align-items: start; }
.ing-picker { position: relative; }
.ing-search {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font: inherit; background: var(--input-bg); color: var(--text);
}
.ing-drop {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 5; margin-top: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  max-height: 220px; overflow-y: auto; box-shadow: var(--shadow);
}
.ing-drop:empty { display: none; }
.ing-drop .sr-item { padding: 8px 12px; }
.ing-grams {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  font: inherit; background: var(--input-bg); color: var(--text);
}
.ing-remove {
  border: 1px solid var(--line); background: var(--ghost-bg); color: var(--muted);
  border-radius: 10px; height: 38px; cursor: pointer; font-size: 18px;
}
.ing-remove:hover { color: var(--danger); background: var(--danger-soft); }
.ing-ref { grid-column: 1 / -1; font-size: 0.78rem; color: var(--muted); margin-top: -3px; }
.ing-fry { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: -2px; }
.fry-toggle { border: 1px solid var(--line); background: var(--ghost-bg); color: var(--muted); border-radius: 20px; padding: 4px 12px; font: inherit; font-size: 0.8rem; cursor: pointer; }
.fry-toggle:hover { border-color: var(--accent-text); }
.fry-toggle.on { border-color: var(--accent-text); background: var(--primary-soft); color: var(--accent-text); }
.fry-oil { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.fry-oil-input { width: 72px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font: inherit; background: var(--input-bg); color: var(--text); }
.oil-note { color: var(--accent-text); }

.dish-summary {
  background: var(--soft-bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 0.86rem; display: flex; flex-wrap: wrap; gap: 6px 22px;
}
.dish-summary b { font-variant-numeric: tabular-nums; }

.portions-edit { display: flex; flex-direction: column; gap: 8px; }
.portion-row { display: grid; grid-template-columns: 1fr 110px 34px; gap: 8px; }
.portion-name, .portion-grams {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  font: inherit; background: var(--input-bg); color: var(--text);
}
.link-btn { border: none; background: none; color: var(--accent-text); cursor: pointer; font: inherit; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Порции при добавлении в дневник ---------- */
.portions { display: flex; flex-wrap: wrap; gap: 8px; }
.portion-btn {
  border: 1px dashed var(--line); background: var(--soft-bg); color: var(--accent-text);
  border-radius: 20px; padding: 7px 14px; cursor: pointer; font: inherit; font-size: 0.85rem;
}
.portion-btn:hover { border-color: var(--accent-text); background: var(--primary-soft); }

/* ---------- Модалки ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 26, 38, 0.45);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border-radius: 18px; width: 100%; max-width: 480px;
  max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: pop 0.16s ease;
}
@keyframes pop { from { transform: scale(0.97); opacity: 0.6; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

.search-results { max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.search-results:empty { display: none; }
.sr-item { padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--primary-soft); }
.sr-item small { color: var(--muted); }

.chosen { background: var(--primary-soft); background: color-mix(in srgb, var(--primary) 14%, transparent); border-radius: 10px; padding: 10px 14px; }
.chosen-name { font-weight: 600; }
.chosen-kcal { font-size: 0.8rem; color: var(--muted); }
.computed { font-size: 1.15rem; font-weight: 700; color: var(--accent-text); text-align: right; }

/* ---------- Тост ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 100; font-size: 0.9rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Адаптив ---------- */
@media (max-width: 760px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .macros { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .summary { gap: 18px; }
  .content { padding: 16px 12px 50px; }
  .avg-row { grid-template-columns: 90px 1fr auto; }
}
