/* ═══════════════════════════════════════════════════════════════════════
   FUEL (meal tracker) — styles. Loaded by ironlog.html as fuel.css?v=N.
   Colours: only theme variables. Fuel-specific tokens are defined below for
   each of the three themes (same unscoped [data-theme] selectors as
   ironlog.html, so Settings preview tiles would pick them up too).
   ═══════════════════════════════════════════════════════════════════════ */
:root, [data-theme="dark"] {
  /* Macro fills carry white letters (P/C/F badges): all three stay dark enough for 4.5:1.
     Protein is rose, not the accent, so orange only ever means calories / actions. */
  --protein: #c93a5c;
  --protein-soft: rgba(201,58,92,.2);
  --carbs: #2f74d0;
  --carbs-soft: rgba(47,116,208,.2);
  --fat: #b27a00;
  --fat-soft: rgba(178,122,0,.2);
  --on-macro: #fff;
  --fuel-warn: #f0a93b;
  --fuel-warn-soft: rgba(240,169,59,.16);
  --fuel-track: #2e2e2e;
  --fuel-scan-bg: #111;              /* camera view stays dark in every theme */
  --fuel-scan-fg: #f2f2f2;
  --fuel-scan-scrim: rgba(0,0,0,.55);
  --fuel-scan-soft: rgba(255,255,255,.14);
}
[data-theme="light"] {
  --protein: #c93a5c;
  --protein-soft: rgba(201,58,92,.12);
  --carbs: #1f6bc4;
  --carbs-soft: rgba(31,107,196,.12);
  --fat: #a86f00;
  --fat-soft: rgba(168,111,0,.14);
  --on-macro: #fff;
  --fuel-warn: #b86a00;
  --fuel-warn-soft: rgba(184,106,0,.12);
  --fuel-track: #e6e8ec;
  --fuel-scan-bg: #111;              /* camera view stays dark in every theme */
  --fuel-scan-fg: #f2f2f2;
  --fuel-scan-scrim: rgba(0,0,0,.55);
  --fuel-scan-soft: rgba(255,255,255,.14);
}
[data-theme="orchid"] {
  --protein: #c93a5c;
  --protein-soft: rgba(201,58,92,.12);
  --carbs: #1f6bc4;
  --carbs-soft: rgba(31,107,196,.12);
  --fat: #a86f00;
  --fat-soft: rgba(168,111,0,.14);
  --on-macro: #fff;
  --fuel-warn: #b86a00;
  --fuel-warn-soft: rgba(184,106,0,.12);
  --fuel-track: #eadcf4;
  --fuel-scan-bg: #111;              /* camera view stays dark in every theme */
  --fuel-scan-fg: #f2f2f2;
  --fuel-scan-scrim: rgba(0,0,0,.55);
  --fuel-scan-soft: rgba(255,255,255,.14);
}

/* ─── shared ─────────────────────────────────────────────────────────── */
.fu-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.fu-head h1 { font-size: 20px; }
.fu-iconbtn { width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg2); color: var(--text2); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.fu-iconbtn:disabled { opacity: .35; cursor: default; }
.fu-link { background: none; border: none; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.fu-muted { font-size: 12px; color: var(--text3); }
.fu-lbl { font-size: 12px; font-weight: 600; color: var(--text2); }
.fu-note { font-size: 12px; color: var(--text2); background: var(--bg3); border-radius: var(--radius-sm); padding: 8px 10px; line-height: 1.45; }
.fu-btn-lg { height: 48px; font-size: 15px; }
.fu-first { cursor: pointer; border-color: var(--accent); background: var(--accent-faint); }
.fu-setup { border-color: var(--fuel-warn); background: var(--fuel-warn-soft); }

/* segmented control */
.fu-seg { display: flex; flex: 1; background: var(--bg3); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.fu-seg button { flex: 1; min-height: 34px; border: none; border-radius: 6px; background: none; color: var(--text2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0 8px; }
.fu-seg button.on { background: var(--bg4); color: var(--text); }
.fu-seg-primary { background: var(--bg2); border: 1px solid var(--border); margin-bottom: 12px; }
.fu-seg-primary button { min-height: 36px; }
.fu-seg-primary button.on { background: var(--primary); color: var(--on-accent); }
.fu-seg-choice button.on { background: var(--accent-faint); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fu-seg-sm { flex: none; padding: 2px; }
.fu-seg-sm button { min-height: 28px; font-size: 12px; padding: 0 12px; }

/* chips */
.fu-chips { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.fu-chip { flex: 1; min-height: 34px; border-radius: 20px; border: 1px solid var(--border); background: none; color: var(--text2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 0 10px; white-space: nowrap; }
.fu-chip.on { background: var(--primary); border-color: transparent; color: var(--on-accent); }

/* ─── targets ────────────────────────────────────────────────────────── */
.fu-form { display: flex; flex-direction: column; gap: 14px; }
.fu-line { display: flex; align-items: center; gap: 12px; }
.fu-line > .fu-lbl { width: 50px; flex-shrink: 0; }
.fu-grid3 { display: grid; grid-template-columns: 1fr 1.3fr 1.1fr; gap: 8px; }
.fu-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fu-field > span { font-size: 12px; font-weight: 600; color: var(--text2); white-space: nowrap; }
.fu-field input { height: 42px; padding: 0 10px; }
.fu-field > span.fu-mlbl, .fu-mlbl { display: inline-flex; align-items: center; gap: 5px; }
.fu-mtile { display: inline-flex; align-items: center; gap: 6px; }
.fu-ftin { display: flex; gap: 4px; }
.fu-ftin input { min-width: 0; padding: 0 6px; text-align: center; }
.fu-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fu-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg3); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.fu-opt.on { border-color: var(--accent); background: var(--accent-faint); }
.fu-opt-t { font-size: 13px; font-weight: 600; }
.fu-opt-d { font-size: 11px; color: var(--text2); }
.fu-hint { font-size: 11px; color: var(--text3); margin-top: 6px; }
.fu-reco { display: flex; flex-direction: column; gap: 10px; }
.fu-big { display: flex; align-items: baseline; gap: 6px; }
.fu-big b { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fu-big span { font-size: 13px; color: var(--text2); }
.fu-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fu-tile { background: var(--bg3); border-radius: var(--radius-sm); padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; }
.fu-tile b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fu-tile span { font-size: 11px; color: var(--text2); }
.fu-actions { display: flex; gap: 10px; margin-top: 4px; }
.fu-kcal-row { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.fu-kcal-row span { font-size: 14px; color: var(--text2); }
.fu-kcal-input { width: 150px; height: 52px; font-size: 26px; font-weight: 700; }
.fu-macro-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fu-macro-row label { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.fu-macro-row input { width: 80px; height: 42px; text-align: right; font-size: 16px; }
.fu-dot { width: 10px; height: 10px; border-radius: 5px; display: inline-block; flex-shrink: 0; }
.fu-other { width: 78px; font-size: 12px; color: var(--text2); }
.fu-split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 4px 0 10px; background: var(--fuel-track); }
.fu-split i { display: block; height: 100%; }
.fu-check { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.fu-check.ok { color: var(--green); }
.fu-check.warn { color: var(--fuel-warn); }
.fu-foot { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

/* ─── home ───────────────────────────────────────────────────────────── */
.fu-home-head { margin-bottom: 12px; }
.fu-home-head h1 { margin-bottom: 6px; }
.fu-daynav { display: flex; align-items: center; gap: 8px; }
.fu-iconbtn-sm { width: 30px; height: 30px; }
.fu-dateline { background: none; border: none; padding: 0; font: inherit; font-size: 13px; color: var(--text2); cursor: pointer; }
/* P / C / F badges: coloured circle, white letter. Sizes s (rows) · m (meal headers) · l (totals) · xl (amount tiles). */
.fu-b { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 50%; color: var(--on-macro); font-style: normal; font-weight: 800; line-height: 1; }
.fu-b-p { background: var(--protein); }
.fu-b-c { background: var(--carbs); }
.fu-b-f { background: var(--fat); }
.fu-b-s { width: 15px; height: 15px; font-size: 9px; }
.fu-b-m { width: 18px; height: 18px; font-size: 10px; }
.fu-b-l { width: 24px; height: 24px; font-size: 12px; }
.fu-b-xl { width: 28px; height: 28px; font-size: 13px; }
.fu-macs { display: inline-flex; align-items: center; gap: 9px; }
.fu-macs-m { gap: 11px; font-size: 13px; font-weight: 600; color: var(--text); }
.fu-macs .fu-mac { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.fu-macs-m .fu-mac { gap: 4px; }

.fu-sum { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.fu-sum-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.fu-sum-big { display: flex; align-items: baseline; gap: 8px; }
.fu-sum-big b { font-size: 42px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.fu-sum-big span { font-size: 15px; font-weight: 600; color: var(--text2); }
.fu-sum-big.over b { color: var(--red); }
.fu-sum-eaten { text-align: right; font-size: 12px; color: var(--text2); line-height: 1.4; font-variant-numeric: tabular-nums; }
.fu-sum .fu-bar-t.fu-sum-bar { height: 8px; border-radius: 4px; }
.fu-sum .fu-sum-bar i { height: 8px; border-radius: 4px; }
.fu-sum-macros { display: grid; gap: 12px; }
.fu-sm { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fu-sm-h { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.fu-sm-h b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fu-sm-h span { font-size: 12px; color: var(--text2); margin-left: -3px; }
.fu-sm-h.over span { color: var(--fuel-warn); font-weight: 600; }
.fu-sm .fu-bar-t { height: 5px; }
.fu-sm .fu-bar-t i { height: 5px; }
.fu-sm-s { font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; }
.fu-bar { display: flex; flex-direction: column; gap: 4px; }
.fu-bar-h { display: flex; justify-content: space-between; font-size: 12px; }
.fu-bar-h span:first-child { font-weight: 600; }
.fu-bar-h span:last-child { color: var(--text2); font-variant-numeric: tabular-nums; }
.fu-bar-t { height: 6px; border-radius: 3px; background: var(--fuel-track); overflow: hidden; }
.fu-bar-t i { display: block; height: 6px; border-radius: 3px; }
.fu-edit { align-self: flex-end; }

.fu-meal { padding: 12px 12px 12px 16px; overflow: hidden; } /* clips swipe rows to the rounded corners */
.fu-meal-head { display: flex; align-items: center; gap: 12px; }
.fu-meal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fu-meal-t { display: flex; align-items: baseline; gap: 8px; }
.fu-meal-t h2 { font-size: 17px; font-weight: 700; }
.fu-meal-t span { font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums; }
.fu-meal-t .fu-meal-k { margin-left: auto; white-space: nowrap; }
.fu-meal-k b { font-size: 15px; font-weight: 700; color: var(--text); }
.fu-meal-sub { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-meal-sub.empty { color: var(--text3); font-size: 13px; }
.fu-meal-sub b { color: var(--text); font-weight: 600; }
.fu-add { width: 40px; height: 40px; border-radius: 20px; border: none; background: var(--primary); color: var(--on-accent); box-shadow: var(--btn-shadow); display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; padding: 0; }
.fu-add:active { transform: scale(.95); }
/* Home food rows: tap → amount panel (remove lives there, not on the row). */
.fu-rows { margin: 12px -12px 0 -16px; }
.fu-rows:last-child { margin-bottom: -12px; }
.fu-row { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 9px 12px 9px 16px; background: none; border: none; border-top: 1px solid var(--border); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fu-row:active { background: var(--bg3); }
.fu-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fu-row-n { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-row-b { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--text2); }
.fu-swipe.fu-new .fu-row { animation: fu-new 1.6s ease-out; }
@keyframes fu-new { 0%, 35% { background: var(--green-soft); } 100% { background: var(--bg2); } }
.fu-row-a { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; }
.fu-row-a > b { color: var(--text); font-weight: 600; }
.fu-row-k { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fu-row > svg { color: var(--text3); flex-shrink: 0; }
.fu-meal-main { background: none; border: none; padding: 0; font: inherit; color: inherit; text-align: left; }
button.fu-meal-main { cursor: pointer; }
.fu-meal-chev { display: inline-flex; color: var(--text3); transition: transform .2s; align-self: center; }
.fu-meal.collapsed .fu-meal-chev { transform: rotate(-90deg); }
/* swipe-to-delete: the red Delete button sits under the row; the row slides left over it */
.fu-swipe { position: relative; overflow: hidden; border-top: 1px solid var(--border); }
.fu-swipe .fu-row { position: relative; z-index: 1; border-top: none; background: var(--bg2); transition: transform .2s ease; touch-action: pan-y; }
.fu-swipe .fu-row:active { background: var(--bg2); }
.fu-swipe.drag .fu-row { transition: none; }
.fu-swipe.open .fu-row { transform: translateX(-88px); }
.fu-swipe.gone .fu-row { transform: translateX(-100%); }
.fu-swipe-del { position: absolute; inset: 0; border: none; padding: 0; background: var(--red); color: var(--on-accent); font: inherit; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: flex-end; cursor: pointer; }
.fu-swipe-del span { width: 88px; text-align: center; transition: transform .15s; }
.fu-swipe.full .fu-swipe-del span, .fu-swipe.gone .fu-swipe-del span { transform: scale(1.12); }
.fu-rows + .fu-name-row { margin: 0 -12px 0 -16px; padding: 10px 12px 0 16px; border-top: 1px solid var(--border); }
.fu-name-row .fu-link { color: var(--text2); }
.fu-items { margin-top: 10px; border-top: 1px solid var(--border); }
.fu-item { border-bottom: 1px solid var(--border); }
.fu-item-row { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.fu-item-main { flex: 1; min-width: 0; background: none; border: none; padding: 6px 0; font: inherit; color: inherit; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.fu-item-n { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-item-a { font-size: 12px; color: var(--text2); }
.fu-item.edit .fu-item-a { color: var(--accent); }
.fu-item-k { font-size: 13px; color: var(--text2); font-variant-numeric: tabular-nums; }
.fu-x { width: 36px; height: 36px; border: none; background: none; color: var(--text3); display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px; padding: 0; flex-shrink: 0; }
.fu-x:active { color: var(--red); background: var(--bg3); }
.fu-portion { display: flex; align-items: center; gap: 6px; padding: 0 0 10px; flex-wrap: wrap; }
.fu-pchip { min-width: 40px; height: 34px; padding: 0 10px; border-radius: 17px; border: 1px solid var(--border); background: var(--bg3); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.fu-pchip.on { background: var(--primary); border-color: transparent; color: var(--on-accent); }
.fu-unit { width: auto; max-width: 150px; height: 34px; padding: 0 28px 0 10px; font-size: 13px; border-radius: 17px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text2) 50%), linear-gradient(135deg, var(--text2) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.fu-grams { width: 84px; height: 34px; padding: 0 10px; text-align: right; }
.fu-mac { white-space: nowrap; }
.fu-mac b { font-weight: 700; }
.fu-name-row { display: flex; align-items: center; gap: 8px; padding-top: 10px; }
.fu-name-row input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; font-size: 14px; }
.fu-meal-name { flex: 1; font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-planlink { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 4px; border: 1px dashed var(--border); border-radius: var(--radius); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.fu-planlink.on { border-style: solid; }
.fu-planlink > svg:first-child { color: var(--accent); flex-shrink: 0; }
.fu-planlink > svg:last-child { color: var(--text3); flex-shrink: 0; }
.fu-planlink-t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fu-planlink-t b { font-size: 13px; font-weight: 600; }
.fu-planlink-t span { font-size: 12px; color: var(--text2); }

/* ─── add sheet (in #modal-container, own classes) ───────────────────── */
.fu-sheet-backdrop { position: fixed; inset: 0; z-index: 100; background: var(--backdrop); display: flex; align-items: flex-end; }
.fu-sheet { width: 100%; height: calc(100% - 40px - env(safe-area-inset-top)); background: var(--bg2); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--pop-shadow); }
.fu-sh-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 10px auto 6px; flex-shrink: 0; }
#fu-sh-main { padding: 0 16px; flex-shrink: 0; }
.fu-sh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.fu-sh-head h1 { font-size: 19px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-sh-subhead { justify-content: flex-start; }
.fu-sh-close { width: 36px; height: 36px; border-radius: 18px; border: none; background: var(--bg3); color: var(--text2); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0; }
.fu-sh-tools { display: flex; gap: 8px; margin-bottom: 4px; }
.fu-sh-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 10px 0 12px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text2); }
.fu-sh-search:focus-within { border-color: var(--accent); }
.fu-sh-search input { flex: 1; min-width: 0; background: none; border: none; padding: 0; height: 100%; font-size: 16px; }
.fu-sh-search input::-webkit-search-cancel-button { display: none; }
.fu-sh-clear { width: 24px; height: 24px; border-radius: 12px; border: none; background: var(--bg4); color: var(--text2); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; flex-shrink: 0; }
.fu-sh-clear svg { width: 12px; height: 12px; }
.fu-sh-tool { width: 46px; height: 46px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg3); color: var(--text); display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; padding: 0; }
.fu-sh-kcal { font-size: 11px; font-weight: 800; letter-spacing: .02em; font-family: inherit; }
.fu-sh-scan { background: var(--primary); border-color: transparent; color: var(--on-accent); }
.fu-sh-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 16px; overscroll-behavior: contain; }
.fu-sh-bar { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--bg2); }
.fu-sh-bar-t { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 14px; }
.fu-sh-bar-t { min-width: 0; }
.fu-sh-bar-n { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.fu-sh-bar-n > svg { color: var(--green); flex-shrink: 0; }
.fu-sh-bar-n > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-sh-bar-t .fu-muted .fu-link { font-size: inherit; }
.fu-sh-done { height: 46px; padding: 0 28px; }
.fu-sh-loading, .fu-sh-empty { color: var(--text3); font-size: 13px; padding: 14px 0; }
.fu-sh-sec { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text3); padding: 14px 0 8px; }
.fu-sh-sec span:last-child:not(:first-child) { font-weight: 400; letter-spacing: 0; }
.fu-past-row { display: flex; gap: 8px; overflow-x: auto; margin-right: -16px; padding-right: 16px; scroll-snap-type: x proximity; }
.fu-past-row::-webkit-scrollbar { display: none; }
.fu-past { width: 146px; flex-shrink: 0; background: var(--bg3); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 4px; scroll-snap-align: start; }
.fu-past-l { font-size: 11px; font-weight: 700; color: var(--text2); }
.fu-past-l.hot { color: var(--accent); }
.fu-past-n { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fu-past-s { font-size: 12px; color: var(--text2); }
.fu-past-btn { margin-top: auto; height: 36px; border-radius: var(--radius-sm); border: none; background: var(--bg4); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; }
.fu-past-btn.ok { background: var(--green-soft); color: var(--green); }
.fu-list { display: flex; flex-direction: column; }
.fu-li { display: flex; align-items: center; flex-wrap: wrap; gap: 0 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.fu-li:last-child { border-bottom: none; }
.fu-li-row { width: 100%; display: flex; align-items: center; gap: 12px; }
.fu-li .fu-portion { width: 100%; padding: 8px 0 4px; }
.fu-li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; background: none; border: none; padding: 2px 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
div.fu-li-main { cursor: default; }
.fu-li-main:disabled { cursor: default; opacity: 1; color: inherit; }
.fu-li-n { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.fu-li-s { font-size: 12px; color: var(--text2); }
.fu-li-m { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--text); margin-top: 2px; flex-wrap: wrap; }
.fu-li-k { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fu-li-m .fu-li-k::before { content: '·'; color: var(--text3); margin-right: 9px; }
.fu-round { width: 40px; height: 40px; border-radius: 20px; border: 1.5px solid var(--accent); background: none; color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; padding: 0; }
.fu-round svg { width: 18px; height: 18px; }
.fu-round-ok { background: var(--green); border-color: transparent; color: var(--on-accent); }
.fu-sh-left { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--text2); margin: -6px 0 12px; }
.fu-sh-left:empty { display: none; }
.fu-sh-left > b { color: var(--text); font-weight: 700; }
.fu-pm { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg3); border-radius: var(--radius); margin-bottom: 8px; }
.fu-pm.open { flex-direction: column; align-items: stretch; gap: 6px; }
.fu-pm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.fu-pm-when { font-size: 11px; font-weight: 700; color: var(--text2); }
.fu-pm-item { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 5px 0; cursor: pointer; }
.fu-pm-item span:nth-of-type(1) { flex: 1; min-width: 0; }
.fu-pm-ok { width: 100%; border: none; font: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green); font-size: 14px; font-weight: 600; }
.fu-pm .btn { height: 40px; }
.fu-pm .btn:disabled { opacity: .5; }
.fu-sh-create { padding: 14px 0 4px; }
.fu-sub { padding-top: 6px; }
.fu-qa-kcal { height: 64px; font-size: 32px; font-weight: 700; }
.fu-grid3-eq { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fu-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fu-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fu-grid4 input { padding: 0 8px; }
.fu-remote-note { padding: 10px 0 2px; }
.fu-attrib { font-size: 11px; color: var(--text3); padding: 12px 0 0; }

/* ─── amount panel (one "how much" editor for home rows and the add sheet) ─── */
.fu-amt-backdrop { position: fixed; inset: 0; z-index: 120; background: var(--backdrop); display: flex; align-items: flex-end; }
.fu-amt { width: 100%; max-height: calc(100% - 40px - env(safe-area-inset-top)); overflow-y: auto; background: var(--bg2); border-radius: 22px 22px 0 0; box-shadow: var(--pop-shadow);
  padding: 0 16px max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.fu-amt .fu-sh-handle { margin-bottom: 0; }
.fu-amt-head { display: flex; align-items: flex-start; gap: 12px; }
.fu-amt-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fu-amt-head h2 { font-size: 18px; font-weight: 700; }
.fu-amt-head span { font-size: 12px; color: var(--text2); }
.fu-amt-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 60px; padding: 0 16px; border-radius: var(--radius); background: var(--bg); border: 2px solid var(--accent); }
.fu-amt-box input { flex: 1; min-width: 0; height: 100%; background: none; border: none; padding: 0; font-size: 28px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.fu-amt-box input:focus { outline: none; box-shadow: none; }
.fu-amt-box span { font-size: 15px; font-weight: 600; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.fu-amt-pills { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.fu-amt-pills::-webkit-scrollbar { display: none; }
.fu-upill { flex-shrink: 0; height: 38px; padding: 0 16px; border-radius: 19px; border: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fu-upill.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.fu-amt-chips { display: flex; gap: 8px; }
.fu-amt-chips .fu-pchip { flex: 1; height: 38px; border-radius: 19px; }
.fu-amt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fu-amt-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; border-radius: var(--radius); background: var(--bg3); }
.fu-amt-tile b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fu-amt-tile b small { font-size: 12px; font-weight: 600; color: var(--text2); }
.fu-amt-tile .fu-amt-kcal { height: 28px; display: flex; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: .05em; color: var(--accent); }
.fu-amt-after { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); }
.fu-amt-after > span { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text3); }
.fu-amt-after > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text2); }
.fu-amt-after b { color: var(--text); font-weight: 800; }
.fu-amt-after .fu-mac { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.fu-amt-after .over { color: var(--fuel-warn); font-weight: 600; }
.fu-amt-after .hit { color: var(--green); font-weight: 600; }
.fu-amt-go { height: 54px; font-size: 17px; font-weight: 800; }
.fu-amt-remove { align-self: center; background: none; border: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--red); padding: 6px 12px; cursor: pointer; }

/* ─── barcode scanner ─────────────────────────────────────────────────── */
.fu-scan { position: fixed; inset: 0; z-index: 150; background: var(--fuel-scan-bg); color: var(--fuel-scan-fg); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fu-scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fu-scan-top { position: absolute; left: 0; right: 0; top: 0; padding: max(16px, env(safe-area-inset-top)) 16px 0; display: flex; align-items: center; gap: 10px; z-index: 2; }
.fu-scan-title { flex: 1; text-align: center; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px var(--fuel-scan-scrim); }
.fu-scan-btn { width: 40px; height: 40px; border-radius: 20px; border: none; background: var(--fuel-scan-scrim); color: var(--fuel-scan-fg); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.fu-scan-btn.on { background: var(--fuel-scan-fg); color: var(--fuel-scan-bg); }
.fu-scan-reticle { position: relative; width: 250px; height: 140px; margin-top: -140px; z-index: 1; box-shadow: 0 0 0 100vmax var(--fuel-scan-scrim); border-radius: 8px; }
.fu-scan-reticle.off { visibility: hidden; }
.fu-scan-reticle i { position: absolute; width: 26px; height: 26px; border: 0 solid var(--accent); }
.fu-scan-reticle.ok i { border-color: var(--green); }
.fu-scan-reticle i:nth-child(1) { left: 0; top: 0; border-left-width: 4px; border-top-width: 4px; border-radius: 6px 0 0 0; }
.fu-scan-reticle i:nth-child(2) { right: 0; top: 0; border-right-width: 4px; border-top-width: 4px; border-radius: 0 6px 0 0; }
.fu-scan-reticle i:nth-child(3) { left: 0; bottom: 0; border-left-width: 4px; border-bottom-width: 4px; border-radius: 0 0 0 6px; }
.fu-scan-reticle i:nth-child(4) { right: 0; bottom: 0; border-right-width: 4px; border-bottom-width: 4px; border-radius: 0 0 6px 0; }
.fu-scan-hint { position: relative; z-index: 1; margin-top: 14px; font-size: 13px; color: var(--fuel-scan-fg); opacity: .8; min-height: 18px; }
.fu-scan-panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; }
.fu-scan-panel.added { left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); background: var(--bg2); color: var(--text); border: 1px solid var(--green); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.fu-scan-panel.added .fu-portion { padding: 0; }
.fu-scan-added { display: flex; align-items: center; gap: 10px; }
.fu-scan-added .fu-round { width: 32px; height: 32px; }
.fu-scan-actions { display: flex; gap: 8px; }
.fu-scan-soft { flex: 1; height: 40px; border-radius: var(--radius-sm); border: none; background: var(--bg3); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fu-scan-product { height: auto; max-height: 75vh; overflow-y: auto; color: var(--text); padding: 0 16px max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.fu-scan-product h1 { font-size: 19px; }
.fu-scan-found { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 600; }
.fu-scan-amount { display: flex; align-items: center; gap: 10px; }
.fu-stepper { display: flex; align-items: center; gap: 4px; }
.fu-stepper button { width: 40px; height: 44px; border-radius: var(--radius-sm); border: none; background: var(--bg3); color: var(--text); font: inherit; font-size: 18px; cursor: pointer; }
.fu-stepper b { min-width: 32px; text-align: center; font-size: 17px; }
.fu-stepper input { width: 90px; height: 44px; text-align: right; }
.fu-tiles4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fu-tiles4 .fu-tile { align-items: center; padding: 10px 6px; }
.fu-scan-alt { align-self: center; font-size: 13px; }
.fu-scan-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); background: var(--bg2); color: var(--text); border-top: 1px solid var(--border); }

/* ─── one-tap suggestions ────────────────────────────────────────────── */
.fu-sugg { display: flex; flex-direction: column; gap: 8px; margin: 12px 4px 0 0; }
.fu-sugg-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: var(--radius-sm); background: var(--bg3); min-width: 0; }
.fu-sugg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fu-sugg-l { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--text2); }
.fu-sugg-l.hot { color: var(--accent); }
.fu-sugg-n { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-sugg-s { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); white-space: nowrap; }
.fu-sugg-log { flex-shrink: 0; height: 36px; padding: 0 16px; border-radius: 18px; border: 1.5px solid var(--accent); background: none; color: var(--accent); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.fu-sugg-log:active { transform: scale(.96); }
.fu-toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 12px); z-index: 300; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  background: var(--toast-bg); color: var(--fuel-scan-fg); padding: 8px 8px 8px 16px; border-radius: 22px; font-size: 13px; box-shadow: var(--pop-shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.fu-toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.fu-toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-toast button { flex-shrink: 0; height: 30px; padding: 0 14px; border-radius: 15px; border: none; background: var(--fuel-scan-soft); color: var(--accent2); font: inherit; font-weight: 700; cursor: pointer; }

/* ─── plan ───────────────────────────────────────────────────────────── */
.fu-daychip-wrap { position: relative; margin-left: 2px; }
.fu-daychip { background: var(--accent-soft); color: var(--accent); border: none; border-radius: 20px; padding: 2px 9px; font: inherit; font-size: 11px; font-weight: 700; line-height: 1.6; cursor: pointer; white-space: nowrap; }
.fu-daymenu { width: 200px; padding: 6px; display: flex; flex-direction: column; }
.fu-daymenu-i { display: flex; align-items: center; gap: 8px; background: none; border: none; border-radius: 8px; padding: 9px 8px; font: inherit; font-size: 13px; color: var(--text); text-align: left; cursor: pointer; }
.fu-daymenu-i.on { background: var(--accent-faint); color: var(--accent); font-weight: 600; }
.fu-divider { width: 100%; display: flex; align-items: center; gap: 8px; padding: 2px 16px 12px; background: none; border: none; font: inherit; font-size: 12px; color: var(--text2); text-align: left; }
button.fu-divider { cursor: pointer; }
.fu-divider svg { color: var(--accent); flex-shrink: 0; }
.fu-divider b { color: var(--text); font-weight: 600; white-space: nowrap; }
.fu-divider span { white-space: nowrap; }
.fu-divider i { flex: 1; height: 1px; background: var(--border); min-width: 12px; }
.fu-meal.hot { border-color: var(--accent); }
.fu-meal-note { font-size: 12px; color: var(--text2); }
.fu-meal-note.hot { color: var(--accent); font-weight: 600; }
.fu-plan-line { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.fu-plan-line span { flex: 1; min-width: 0; font-size: 12px; color: var(--text3); font-style: italic; }
.fu-logplan { flex-shrink: 0; height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fu-logplan.hot { background: var(--primary); border-color: transparent; color: var(--on-accent); }
.fu-plan-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; cursor: pointer; }
.fu-switch { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--bg4); display: inline-block; transition: background .2s; flex-shrink: 0; }
.fu-switch.on { background: var(--primary); }
.fu-switch input { position: absolute; inset: 0; width: 44px; height: 26px; margin: 0; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.fu-switch i { position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 10px; background: var(--bg2); box-shadow: var(--card-shadow); transition: left .2s; pointer-events: none; }
.fu-switch.on i { left: 21px; }
.fu-plan-card { display: flex; flex-direction: column; gap: 12px; }
.fu-dt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fu-dt { background: var(--bg3); border-radius: var(--radius-sm); padding: 10px 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fu-dt-h { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text2); white-space: nowrap; }
.fu-dt-h .fu-dot { width: 8px; height: 8px; }
.fu-dt b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fu-dt > span { font-size: 11px; color: var(--text2); }
.fu-dt-step { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.fu-dt-step button { width: 28px; height: 28px; border-radius: 6px; border: none; background: var(--bg4); color: var(--text); font: inherit; font-size: 16px; cursor: pointer; padding: 0; }
.fu-dt-step em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--text2); font-variant-numeric: tabular-nums; }
.fu-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.fu-week-d { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; border-radius: 8px; background: var(--bg3); border: 1px solid transparent; min-width: 0; }
.fu-week-d b { font-size: 11px; font-weight: 700; color: var(--text2); }
.fu-week-d span { font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.fu-week-d .fu-dot { width: 8px; height: 8px; }
.fu-week-d.today { background: var(--accent-faint); border-color: var(--accent); }
.fu-week-d.today b { color: var(--accent); }
.fu-tpl-row { width: 100%; background: none; border-left: none; border-right: none; border-top: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.fu-tpl-row > svg { color: var(--text3); flex-shrink: 0; }
.fu-tag { font-size: 10px; font-weight: 700; border-radius: 20px; padding: 1px 7px; white-space: nowrap; }
.fu-tag.carbs { color: var(--carbs); background: var(--carbs-soft); }
.fu-tag.protein { color: var(--protein); background: var(--protein-soft); }
.fu-today-strip { width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; font: inherit; color: var(--text); text-align: left; cursor: pointer; margin-bottom: 14px; }
.fu-ts-head { display: flex; align-items: center; gap: 8px; }
.fu-ts-head svg:first-child { color: var(--accent); flex-shrink: 0; }
.fu-ts-head b { font-size: 13px; font-weight: 600; }
.fu-ts-head span { flex: 1; min-width: 0; font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-ts-head svg:last-child { color: var(--text3); flex-shrink: 0; }
.fu-ts-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fu-ts-bar .fu-bar-h { font-size: 11px; color: var(--text2); }
.fu-ts-bar .fu-bar-h span:first-child { font-weight: 400; }
.fu-ts-bar .fu-bar-t { height: 5px; }
.fu-post-prompt { display: flex; align-items: center; gap: 10px; background: var(--accent-faint); border: 1px solid var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.fu-post-prompt > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fu-post-prompt b { font-size: 13px; }
.fu-post-prompt span { font-size: 12px; color: var(--text2); }

/* ─── Progress › Nutrition ────────────────────────────────────────────── */
.fu-bars7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; }
.fu-b7 { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.fu-b7-bar { display: block; width: 22px; max-width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; }
.fu-b7-tick { position: absolute; left: 2px; right: 2px; height: 2px; background: var(--text); border-radius: 1px; }
.fu-b7-labels { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; text-align: center; font-size: 11px; color: var(--text2); margin-top: 8px; line-height: 1.35; }
.fu-b7-labels div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-b7-labels .today { color: var(--accent); font-weight: 700; }
.fu-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11px; color: var(--text2); margin-top: 12px; }
.fu-legend span { display: inline-flex; align-items: center; gap: 5px; }
.fu-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.fu-legend i.tick { width: 12px; height: 2px; background: var(--text); }
.fu-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.fu-stat { margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 3px; }
.fu-stat span { font-size: 11px; color: var(--text2); }
.fu-stat b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fu-stat em { font-style: normal; font-size: 11px; color: var(--text2); }
.fu-fxt { display: flex; flex-direction: column; gap: 10px; }
.fu-fxt b { font-variant-numeric: tabular-nums; }
