/* Food screen (owner: Food). Scope: [data-screen="food"]; sheets (rendered outside #screen) use .fd- classes.
   v4: one column (max from .screen): title, what is left, Add food, today's one list, water. */

/* --fd-x: rows bleed this far past the column so their highlight has room; their text stays on the column edge */
[data-screen="food"] { --part: var(--c-food, var(--p4)); --fd-x: 12px; --fd-fold: cubic-bezier(0.33, 1, 0.68, 1); }   /* --fd-fold: heights close with a soft start */
/* the main-action colour (ui/look.js: the app colour, blue for Graphite) for the round + buttons too */
[data-screen="food"], .fd-sheet-panel { --fd-cta: var(--cta-rgb, var(--accent-rgb)); }

/* ---------- title ---------- */
[data-screen="food"] .fd-head { margin-bottom: 28px; }
[data-screen="food"] .fd-date { margin-top: 6px; color: var(--muted); font-size: var(--t-small); }

/* ---------- 1. what is left ---------- */
[data-screen="food"] .fd-left { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; color: var(--muted); overflow-wrap: break-word; }
[data-screen="food"] .fd-left__n { font-size: 40px; font-weight: 700; letter-spacing: -0.035em; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* over the target: said in words, the same calm colours (no penalty) */
[data-screen="food"] .fd-left__n--word { font-size: 26px; letter-spacing: -0.03em; white-space: normal; overflow-wrap: break-word; }
[data-screen="food"] .fd-kbar { height: 6px; margin-top: 14px; }
[data-screen="food"] .fd-kbar > i { background: var(--part); transition: width 600ms var(--ease-out), background-color var(--dur) var(--ease-out); }
/* over the target by more than 10% (settings.overRed): the calorie bar turns the over colour */
[data-screen="food"] .fd-kbar.is-over > i { background: var(--c-over, var(--red)); }
[data-screen="food"] .fd-macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
[data-screen="food"] .fd-macro { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
[data-screen="food"] .fd-macro__label { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
[data-screen="food"] .fd-macro__val { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-screen="food"] .fd-macro__val b { font-size: 16px; font-weight: 650; color: var(--fg); letter-spacing: -0.01em; }
[data-screen="food"] .fd-macro__bar { display: block; height: 3px; margin-top: 5px; border-radius: 3px; background: rgb(var(--fg-rgb) / 0.08); overflow: hidden; }
[data-screen="food"] .fd-macro__bar > i { display: block; height: 100%; border-radius: inherit; background: rgb(var(--fg-rgb) / 0.42); transform-origin: left; transition: transform 600ms var(--ease-out); }

/* ---------- 2. Add food (v8: the "What did you eat?" line is gone; the button opens the add sheet) ---------- */
[data-screen="food"] .fd-say { margin-top: 32px; }

/* the line's rows (gone in v8) — the round + below is still used in the add sheet */
/* what the line found (under the Add button): one row per item, each with its own round + */
/* while rows come and go the box eases to its new height, so the list below glides instead of snapping;
   the clip leaves room for the rows' bleed at the sides */
[data-screen="food"] .fd-say__found.is-gliding { transition: height 220ms var(--fd-fold); clip-path: inset(0 -24px); }
[data-screen="food"] .fd-preview { list-style: none; margin: 8px calc(-1 * var(--fd-x)) 0; }
[data-screen="food"] .fd-preview:empty { display: none; }
[data-screen="food"] .fd-pv {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px var(--fd-x);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
/* separators sit on the column, not under the bleed */
[data-screen="food"] .fd-pv + .fd-pv::before, [data-screen="food"] .fd-entry::after {
  content: ''; position: absolute; left: var(--fd-x); right: var(--fd-x); height: 1px; background: var(--line); pointer-events: none;
}
[data-screen="food"] .fd-pv + .fd-pv::before { top: 0; }
[data-screen="food"] .fd-entry::after { bottom: 0; }
/* only rows that just appeared slide in; rows already shown never move again */
[data-screen="food"] .fd-pv.is-in { animation: fd-in 240ms var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 6) * 28ms); }
/* added: the + turns into a check, then the row fades and its height closes (like a deleted entry), so what is below glides up */
[data-screen="food"] .fd-pv.is-added {
  opacity: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; pointer-events: none;
  transition: opacity 170ms var(--ease-out) 80ms, height 230ms var(--fd-fold) 70ms, padding 230ms var(--fd-fold) 70ms;
}
[data-screen="food"] .fd-pv.is-odd .fd-pv__sub { color: var(--fg); }
[data-screen="food"] .fd-pv__main { flex: 1; min-width: 0; }
[data-screen="food"] .fd-pv__name { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; overflow-wrap: break-word; hyphens: manual; }
[data-screen="food"] .fd-pv__sub { margin-top: 1px; font-size: 13px; color: var(--muted); overflow-wrap: break-word; font-variant-numeric: tabular-nums; }
[data-screen="food"] .fd-pv__kcal { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
[data-screen="food"] .fd-pv--miss .fd-pv__name { color: var(--muted); }
[data-screen="food"] .fd-pv__miss {
  display: inline-block; margin-top: 2px; padding: 2px 0; border: 0; background: none; cursor: pointer;
  font: 500 13px var(--f-sans); color: var(--fg); text-align: left;
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px;
}
@media (hover: hover) { [data-screen="food"] .fd-pv__miss:hover { text-decoration-color: currentColor; } }
[data-screen="food"] .fd-pv__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
[data-screen="food"] .fd-pv__chips .chip { min-height: 34px; padding: 0 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
[data-screen="food"] .fd-pv__chips .chip small { font-size: 12px; color: var(--muted); }
[data-screen="food"] .fd-pv__chips .chip[aria-pressed="true"] small { color: inherit; opacity: 0.75; }
[data-screen="food"] .fd-pv.is-unsure .fd-pv__sub { color: var(--fg); }
[data-screen="food"] .fd-pv__check { color: var(--orange); }
[data-screen="food"] .fd-pv.is-check .fd-pv__name { color: var(--muted); }

/* the round add button of a row (also used in the add sheet) */
.fd-pv__add, .fd-plus {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgb(var(--fd-cta) / 0.16); color: rgb(var(--fd-cta));
  box-shadow: inset 0 0 0 1px rgb(var(--fd-cta) / 0.24);
  transition: background var(--dur-ctl) var(--ease-ctl), color var(--dur-ctl) var(--ease-ctl), transform var(--dur-ctl) var(--ease-ctl), box-shadow var(--dur-ctl) var(--ease-ctl);
  -webkit-tap-highlight-color: transparent;
}
.fd-pv__add svg, .fd-plus svg { width: 19px; height: 19px; stroke-width: 2; }
@media (hover: hover) { .fd-pv__add:hover, .fd-plus:hover { background: rgb(var(--fd-cta)); color: var(--on-accent); box-shadow: none; } }
.fd-pv__add:active, .fd-plus:active { transform: scale(0.88); }
.fd-pv__add:focus-visible, .fd-plus:focus-visible { outline-offset: -2px; }
.is-added .fd-pv__add, .fd-plus.is-done { background: rgb(var(--fd-cta)); color: var(--on-accent); box-shadow: none; animation: fd-pop 260ms var(--ease-out); }
.fd-pv__add[aria-disabled="true"] { background: rgb(var(--fg-rgb) / 0.06); color: var(--faint); box-shadow: none; cursor: default; }
@media (hover: hover) { .fd-pv__add[aria-disabled="true"]:hover { background: rgb(var(--fg-rgb) / 0.06); color: var(--faint); } }
.fd-pv__add--ghost { background: none; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
@media (hover: hover) { .fd-pv__add--ghost:hover { background: var(--hover); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); } }
@keyframes fd-pop { 0% { transform: scale(0.8); } 60% { transform: scale(1.08); } 100% { transform: none; } }

[data-screen="food"] .fd-say__after { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 2px; margin-top: 10px; font-size: 13px; color: var(--muted); min-width: 0; font-variant-numeric: tabular-nums; }
[data-screen="food"] .fd-say__after[hidden] { display: none; }
[data-screen="food"] .fd-say__total { color: var(--fg); font-weight: 600; }
[data-screen="food"] .fd-say__skip { flex-basis: 100%; color: var(--faint); }
[data-screen="food"] .fd-say__ask { color: var(--fg); }

/* Add food: a filled accent pill (glass edge from glass.js), like the old Focus "Start focus" */
[data-screen="food"] .fd-go { width: 100%; min-height: 56px; margin-top: 0; gap: 10px; font-size: 17px; letter-spacing: -0.01em; }
[data-screen="food"] .fd-go svg { width: 19px; height: 19px; stroke-width: 2; }
[data-screen="food"] .fd-go__label { min-width: 0; }

/* ---------- 3. today's one list ---------- */
[data-screen="food"] .fd-day { margin-top: 36px; }
[data-screen="food"] .fd-day__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
[data-screen="food"] .fd-day__title { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
[data-screen="food"] .fd-day__meta { font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
[data-screen="food"] .fd-day__empty { padding: 14px 0 0; font-size: 14px; color: var(--muted); line-height: 1.45; }

[data-screen="food"] .fd-entries { list-style: none; margin: 0 calc(-1 * var(--fd-x)); }
[data-screen="food"] .fd-entry { position: relative; }
/* the row highlight stays inside the list: rows are inset by the same --fd-x as the heading */
[data-screen="food"] .fd-entry__btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 9px var(--fd-x); border: 0; border-radius: 14px; background: none;
  color: var(--fg); text-align: left; cursor: pointer; font: inherit; -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-fast);
}
@media (hover: hover) { [data-screen="food"] .fd-entry__btn:hover { background: var(--hover); } }
[data-screen="food"] .fd-entry__btn:active { background: var(--press); }
[data-screen="food"] .fd-entry__btn:focus-visible { outline-offset: -2px; border-radius: 14px; }
[data-screen="food"] .fd-entry.is-new { animation: fd-new 900ms var(--ease-out) both; }
@keyframes fd-new { 0% { opacity: 0; transform: translateY(-6px); background: rgb(var(--fg-rgb) / 0.08); } 30% { opacity: 1; transform: none; } 100% { background: transparent; } }
@keyframes fd-in { from { opacity: 0; transform: translateY(5px); } }
[data-screen="food"] .fd-entry.is-leaving { overflow: hidden; animation: fd-leave 220ms var(--ease-out) forwards; }
@keyframes fd-leave { to { opacity: 0; height: 0; min-height: 0; transform: translateX(-12px); } }
[data-screen="food"] .fd-entry__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
[data-screen="food"] .fd-entry__name { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; overflow-wrap: break-word; hyphens: manual; }
[data-screen="food"] .fd-entry__sub { margin-top: 2px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
[data-screen="food"] .fd-entry__kcal { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
[data-screen="food"] .fd-entry__chev { flex: none; display: grid; place-items: center; width: 18px; color: var(--faint); }
[data-screen="food"] .fd-entry__chev svg { width: 16px; height: 16px; }

/* ---------- 4. water ---------- */
[data-screen="food"] .fd-water { margin-top: 40px; }

/* ---------- food tracking off: a short screen, centred ---------- */
[data-screen="food"].fd-is-off { display: flex; flex-direction: column; min-height: calc(100dvh - var(--tabbar-h) - var(--tabbar-gap) - var(--safe-b) - 40px); }
[data-screen="food"].fd-is-off .fd-off { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-bottom: 72px; }
[data-screen="food"] .fd-off__text { color: var(--muted); font-size: 15px; }
[data-screen="food"] .fd-off .btn { margin-top: 16px; }

/* ================= sheets (outside #screen) ================= */
.fd-wide-btn { width: 100%; min-height: 54px; margin-top: 20px; font-size: 16px; }

/* Food sheets: keep the panel fixed (glass.css, later in the cascade, sets .glass { position: relative }). */
.sheet.fd-sheet-panel { position: fixed; }

/* add food sheet: the same height on every tab, so switching never jumps */
.fd-sheet-panel .sheet__body { padding-bottom: 20px; }
.fd-sheet { display: flex; flex-direction: column; min-height: min(560px, calc(100dvh - 180px)); }

.fd-tabs { position: relative; display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.fd-tab {
  position: relative; padding: 12px 0 11px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font: 600 15px/1 var(--f-sans); letter-spacing: -0.01em; color: var(--muted);
  transition: color var(--dur) var(--ease-out);
}
@media (hover: hover) { .fd-tab:hover { color: var(--fg); } }
.fd-tab[aria-selected="true"] { color: var(--fg); }
.fd-tab:focus-visible { outline-offset: -2px; }
.fd-tabs__ink { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; border-radius: 2px; background: var(--fg); transition: transform var(--dur-ctl) var(--ease-ctl), width var(--dur-ctl) var(--ease-ctl); }
.fd-sheet.is-picking .fd-tabs { display: none; }

.fd-panel { margin-top: 14px; flex: 1; display: flex; flex-direction: column; }
.fd-sheet.is-picking .fd-panel { margin-top: 0; }
.fd-panel.fd-swap { animation: fd-swap 220ms var(--ease-out) both; }
@keyframes fd-swap { from { opacity: 0; transform: translateY(6px); } }

.fd-search { position: relative; }
.fd-search > svg { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--muted); pointer-events: none; z-index: 1; }
.fd-search__input { padding-left: 44px; }
.fd-search__input::-webkit-search-cancel-button { filter: grayscale(1); opacity: 0.5; }

.fd-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 20px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.fd-list-head__m { font-weight: 500; color: var(--faint); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.fd-list { list-style: none; margin: 0 -10px; }
.fd-list > li { position: relative; }
.fd-list > li + li::before { content: ''; position: absolute; top: 0; left: 10px; right: 10px; height: 1px; background: var(--line); pointer-events: none; }
.fd-row { display: flex; align-items: center; gap: 4px; padding-right: 10px; }
.fd-res {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; margin: 0; padding: 11px 10px; min-height: 60px;   /* the highlight stays inside the list column */
  border: 0; border-radius: 14px; background: none; color: var(--fg); cursor: pointer; text-align: left;
  transition: background var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .fd-res:hover { background: var(--hover); } }
.fd-res:active { background: var(--press); }
.fd-res:focus-visible { outline-offset: -2px; border-radius: 14px; }
.fd-res__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fd-res__name { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; overflow-wrap: anywhere; }
.fd-res__sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fd-res__tag { margin-right: 6px; font-weight: 650; color: var(--fg); }

/* nothing found / not here: two quiet ways */
.fd-noresult { padding: 28px 10px 4px; text-align: center; }
.fd-noresult__t { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.fd-noresult__s { margin-top: 6px; font-size: 14px; color: var(--muted); }
.fd-more__q { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.fd-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.fd-more__btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; max-width: 100%; padding: 0 16px 0 12px;
  border: 0; border-radius: var(--r-pill); background: rgb(var(--fg-rgb) / 0.06); color: var(--fg); cursor: pointer;
  font: 600 14px/1.2 var(--f-sans); letter-spacing: -0.005em; text-align: left;
  transition: background var(--dur-fast), transform var(--dur-ctl) var(--ease-ctl);
  -webkit-tap-highlight-color: transparent;
}
.fd-more__btn svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
@media (hover: hover) { .fd-more__btn:hover { background: rgb(var(--fg-rgb) / 0.11); } }
.fd-more__btn:active { transform: scale(0.96); }
.fd-more__btn--solo { align-self: center; margin-top: 2px; }

/* my dishes */
.fd-create { width: 100%; min-height: 50px; gap: 8px; }
.fd-create svg { width: 18px; height: 18px; }
.fd-dish-empty { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 12px 32px; text-align: center; }   /* calm in the middle of the free space */
.fd-dish-empty__t { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.fd-dish-empty__s { max-width: 34ch; margin: 6px auto 0; font-size: 14px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.fd-share-line { display: flex; align-items: flex-start; gap: 8px; margin-top: auto; padding-top: 18px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.fd-share-line svg { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.fd-manual .fd-share-line { margin-top: 0; padding-top: 0; }

/* forms: manual entry and a new dish */
.fd-manual { display: flex; flex-direction: column; gap: 14px; }
.fd-manual[hidden] { display: none; }
.fd-mgrid { display: grid; gap: 10px; }
.fd-mgrid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fd-mgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fd-unit-field { position: relative; }
.fd-unit-field > i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--faint); pointer-events: none; }
.fd-num { padding-right: 42px; font-variant-numeric: tabular-nums; }
.fd-mgrid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .fd-mgrid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fd-mf > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }   /* short labels: the fields below stay level */
.fd-mset { min-width: 0; margin: 0; padding: 0; border: 0; }
.fd-mf__sub { display: block; padding: 0; margin: 2px 0 8px; font-size: 13px; font-weight: 650; letter-spacing: -0.01em; color: var(--fg); }
.fd-mf__aside { align-self: end; padding-bottom: 6px; font-size: 12.5px; line-height: 1.35; color: var(--muted); text-wrap: pretty; }
.fd-mf__hint { font-size: 13px; color: var(--muted); margin-top: -6px; }
.fd-mf__hint:empty, .fd-mf__ask:empty { display: none; }
.fd-mf__ask { font-size: 13px; font-weight: 600; color: var(--fg); margin-top: -6px; }
/* "Is that right?": a soft question in the normal text colour, not an error */
.fd-pick__err.is-ask { color: var(--fg); font-weight: 600; }
.fd-mf__note { font-size: 12.5px; color: var(--faint); }
.fd-manual .err { margin-top: -6px; }

.fd-add { width: 100%; min-height: 56px; height: auto; margin-top: 4px; gap: 10px; font-size: 16px; }
.fd-add__label { min-width: 0; white-space: normal; text-wrap: balance; line-height: 1.2; }
.fd-add svg { width: 19px; height: 19px; stroke-width: 2; }

/* the one-time note before the first dish */
.fd-dish { flex: 1; }
.fd-note { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px 6px 48px; animation: fd-swap 220ms var(--ease-out) both; }
.fd-note[hidden] { display: none; }
.fd-note__ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: rgb(var(--fd-cta) / 0.16); color: rgb(var(--fd-cta)); }
.fd-note__ic svg { width: 24px; height: 24px; }
.fd-note__t { margin-top: 14px; font-size: 20px; font-weight: 700; letter-spacing: -0.025em; }
.fd-note__s { max-width: 36ch; margin-top: 8px; font-size: 15px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.fd-note__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 22px; }
.fd-note__btns .btn { min-height: 52px; }

/* amount picker and new dish */
.fd-pick { display: flex; flex-direction: column; }
.fd-back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 12px 0 4px; margin-left: -6px;
  border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); cursor: pointer; font: 600 14px var(--f-sans);
  transition: background var(--dur-fast), color var(--dur-fast);
}
@media (hover: hover) { .fd-back:hover { background: var(--hover); color: var(--fg); } }
.fd-back svg { width: 18px; height: 18px; }
.fd-pick__head { margin-top: 6px; }
.fd-pick__name { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; }
.fd-pick__per { margin-top: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fd-dish .fd-manual { margin-top: 18px; }
.fd-pick__live { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fd-pick__kcal { display: flex; align-items: baseline; gap: 6px; }
.fd-pick__kcal-n { font-size: 46px; font-weight: 700; letter-spacing: -0.035em; line-height: 0.95; font-variant-numeric: tabular-nums; }
.fd-pick__kcal > span:last-child { font-size: 15px; color: var(--muted); }
.fd-pick__macros { display: flex; gap: 16px; padding-bottom: 2px; }
.fd-pick__m { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.fd-pick__m b { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fd-pick__m b small { font-size: 12px; font-weight: 500; color: var(--muted); }
.fd-pick__m span { font-size: 11.5px; color: var(--muted); }
.fd-pick__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fd-pick__chips .chip { font-variant-numeric: tabular-nums; }
.fd-pick__amount { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.fd-pick__amount .slider { flex: 1; min-width: 0; }
.fd-pick__gwrap { position: relative; flex: none; width: 128px; }
.fd-pick__g { text-align: right; padding-left: 10px; padding-right: 30px; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.fd-pick__gwrap > i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 14px; color: var(--muted); pointer-events: none; }
.fd-pick__info { min-height: 18px; margin-top: 6px; font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.fd-pick__left { margin: 6px 0 14px; font-size: 14px; color: var(--muted); }
.fd-pick__err { margin-top: 6px; }
.fd-pick__left b { color: var(--fg); font-weight: 650; font-variant-numeric: tabular-nums; }
.fd-pick__del { margin-top: 10px; }

/* amount editor (tap a row of the list): a free grams field first, quick steps under it */
.fd-ed__top { display: flex; align-items: center; gap: 16px; }
.fd-ed__live { flex: 1; min-width: 0; }
.fd-ed__amt { font-size: 14px; color: var(--muted); overflow-wrap: break-word; font-variant-numeric: tabular-nums; }
.fd-ed__amt:empty { display: none; }
.fd-ed__now { margin-top: 2px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
.fd-ed__now b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.025em; color: var(--fg); white-space: nowrap; }
.fd-ed__amount { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.fd-ed__amount .chip { font-variant-numeric: tabular-nums; }
.fd-ed__gwrap { position: relative; flex: 0 0 132px; }
.fd-ed__g { min-height: 56px; text-align: right; padding-right: 48px;   /* room for "мл" with a space */ font-size: 22px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fd-ed__gwrap > i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 15px; color: var(--muted); pointer-events: none; }
.fd-ed__note { margin-top: 12px; font-size: 14px; color: var(--red); }
.fd-ed__note.is-ask { color: var(--fg); font-weight: 600; }
/* Delete: a plain red text button, quieter than Save */
.fd-ed__remove {
  align-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin: 8px auto 0; padding: 0 16px;
  border: 0; border-radius: var(--r-pill); background: none; cursor: pointer;
  font: 500 15px var(--f-sans); color: var(--red); -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-fast);
}
.fd-ed__remove svg { width: 17px; height: 17px; }
.fd-ed { display: flex; flex-direction: column; }
@media (hover: hover) { .fd-ed__remove:hover { background: rgb(255 69 58 / 0.1); } }
.fd-ed__remove:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }

.fd-ed__later { display: grid; gap: 8px; margin-top: 16px; }
.fd-ed__later-l { font-size: 13px; color: var(--muted); }
.fd-ed__later-row { display: flex; gap: 10px; align-items: center; }
.fd-ed__later-row .fd-unit-field { flex: 1; min-width: 0; }

@media (max-width: 380px) {
  .fd-pick__live { flex-direction: column; align-items: flex-start; }
  .fd-pick__m { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  [data-screen="food"] .fd-entry.is-new, [data-screen="food"] .fd-pv.is-in, .fd-panel.fd-swap, .fd-note, .is-added .fd-pv__add, .fd-plus.is-done { animation: none; }
  [data-screen="food"] .fd-pv, [data-screen="food"] .fd-pv.is-added, [data-screen="food"] .fd-say__found.is-gliding, .fd-pv__add, .fd-plus, .fd-tabs__ink { transition: none; }
}
/* a narrow phone: "82 из 127 г" is never cut; the target goes under the number when there is no room beside it */
[data-screen="food"] .fd-macro__val { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
[data-screen="food"] .fd-macro__val b { white-space: nowrap; }
@media (max-width: 340px) { [data-screen="food"] .fd-macros { gap: 10px; } }
/* a narrow phone: each tab name on one line ("Мои блюда"), tighter gaps and a little smaller */
.fd-tab { white-space: nowrap; }
@media (max-width: 400px) { .fd-tabs { gap: 16px; } .fd-tab { font-size: 14px; } }
@media (max-width: 340px) { .fd-tabs { gap: 12px; } .fd-tab { font-size: 13px; letter-spacing: -0.02em; } }
