/* Food log page, Home card and sheets (food-ui.js). Sleek: 600/700 weights,
   neutral tiles, thin rings with a soft green glow, one dark hero per screen. */
:root {
  --fd-green: var(--acc-500); --fd-green-ink: var(--acc-700); --fd-glow: var(--acc-400);
  --fd-p: #ec4899; --fd-p-ink: #be185d; --fd-c: #f59e0b; --fd-c-ink: #b45309; --fd-f: #3b82f6; --fd-f-ink: #1d4ed8;
  --fd-tile: var(--n-tile); --fd-hair: var(--n-bg); --fd-dark: var(--n-hero);
  --fd-card-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.04), 0 8px 24px rgba(var(--n-ink-rgb), 0.07);
  --fd-dark-shadow: 0 16px 32px -16px rgba(var(--n-ink-rgb), 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --fd-green-shadow: 0 10px 24px -8px rgba(var(--acc-500-rgb), 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
:root[data-theme="dark"] {
  --fd-p-ink: #f9a8d4; --fd-c-ink: #fcd34d; --fd-f-ink: #93c5fd; --fd-green-ink: var(--acc-400);
  --fd-tile: var(--d-tile); --fd-hair: var(--d-hair); --fd-dark: #1c1f23;
  --fd-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
}
#view-food { max-width: 1040px; margin: 0 auto; }
.fd-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.fd-ico.muted { color: var(--muted); }
.fd-loading { padding: 32px 0; text-align: center; color: var(--muted); font-size: 14px; }
.fd-empty { text-align: center; color: var(--muted); }
.fd-center { text-align: center; justify-content: center; margin-left: auto; margin-right: auto; }
.fd-pad { padding: 8px 2px; line-height: 1.5; }
.fd-glow { color: var(--fd-glow) !important; text-shadow: 0 0 18px rgba(var(--acc-400-rgb), 0.45); }
.fd-amber { color: #fbbf24 !important; text-shadow: 0 0 18px rgba(251, 191, 36, 0.4); }
.fd-dim { color: var(--n-line); }
.fd-eyebrow { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.fd-eyebrow.green { color: var(--fd-green-ink); }

/* the dark hero style */
.fd-dark { background: var(--fd-dark) !important; color: #fff; box-shadow: var(--fd-dark-shadow) !important; border: 0; }
:root[data-theme="dark"] .fd-dark { border: 1px solid var(--d-line2); }
.fd-dark .muted { color: var(--n-line); }
/* Buttons and links don't inherit colour, so set it on everything inside. */
.fd-dark b, .fd-dark h2, .fd-dark span:not([class]), .fd-dark .fd-hard-text b { color: #fff; }
.fd-hard-text > span { color: var(--n-line) !important; }

/* header */
.fd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 16px; }
.fd-head-mid { display: flex; flex-direction: column; align-items: center; }
.fd-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.fd-head .muted { font-size: 13px; font-weight: 600; }
.fd-round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--panel); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; box-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.05), 0 4px 12px rgba(var(--n-ink-rgb), 0.06); text-decoration: none; }
.fd-round.sm { width: 38px; height: 38px; }
.fd-round.dark { background: var(--fd-dark); color: var(--fd-glow); box-shadow: 0 8px 20px -10px rgba(var(--n-ink-rgb), 0.6); }
.fd-sheet .fd-round:not(.dark) { background: var(--panel-2); box-shadow: none; }

/* first-run card */
.fd-setup-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; cursor: pointer; padding: 18px 20px !important; margin-bottom: 14px; }
.fd-setup-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fd-setup-text b { font-size: 17px; font-weight: 700; }
.fd-setup-text span:last-child { color: var(--n-line); font-size: 13px; }
.fd-setup-card .fd-eyebrow { color: var(--fd-glow); }

/* week strip */
.fd-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 14px; }
.fd-sday { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border-radius: 18px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; }
.fd-sday b { font-size: 13px; font-weight: 600; color: var(--text); }
.fd-sday.on { background: var(--panel); box-shadow: var(--fd-card-shadow); color: var(--text); }
.fd-sday[aria-disabled="true"] { pointer-events: none; opacity: 0.45; }
.fd-mini { width: 32px; height: 32px; }
.fd-mini circle { fill: none; stroke-width: 3.5; }
.fd-mini .t { stroke: var(--n-soft2); }
:root[data-theme="dark"] .fd-mini .t { stroke: var(--d-line2); }
.fd-mini .f { stroke: var(--fd-green); stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(var(--acc-500-rgb), 0.5)); }
.fd-mini.over .f { stroke: var(--fd-c); filter: none; }

/* dial */
.fd-dial-card { display: flex; flex-direction: column; align-items: center; padding: 24px 22px 20px !important; box-shadow: var(--fd-card-shadow); }
.fd-dial { width: 230px; filter: drop-shadow(0 0 6px rgba(var(--acc-500-rgb), 0.25)); }
.fd-dial .dr-in b { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.fd-dial .dr-in span { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.fd-dial-sub { margin: 10px 0 16px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fd-dial-sub b { color: var(--text); font-weight: 700; }
.fd-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--accent-soft); color: var(--fd-green-ink); font-size: 11px; font-weight: 700; }
.fd-pill.amber { background: #fef3c7; color: #92400e; }
.fd-pill.glow { background: rgba(var(--acc-400-rgb), 0.14); color: var(--acc-300); }
.fd-mbars { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fd-mbar-top { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; font-size: 12px; font-weight: 600; }
.fd-mbar-top b { font-size: 15px; font-weight: 700; }
.fd-mbar-top b .muted { font-size: 12px; font-weight: 600; }
.fd-mbar.p .fd-mbar-top > span { color: var(--fd-p-ink); }
.fd-mbar.c .fd-mbar-top > span { color: var(--fd-c-ink); }
.fd-mbar.f .fd-mbar-top > span { color: var(--fd-f-ink); }
.fd-mbar-track { height: 6px; border-radius: 3px; background: var(--n-soft); overflow: hidden; }
:root[data-theme="dark"] .fd-mbar-track { background: var(--d-line2); }
.fd-mbar-track i { display: block; height: 100%; border-radius: 3px; }
.p .fd-mbar-track i, .fd-hm.p i { background: var(--fd-p); box-shadow: 0 0 8px rgba(236, 72, 153, 0.45); }
.c .fd-mbar-track i, .fd-hm.c i { background: var(--fd-c); box-shadow: 0 0 8px rgba(245, 158, 11, 0.45); }
.f .fd-mbar-track i, .fd-hm.f i { background: var(--fd-f); box-shadow: 0 0 8px rgba(59, 130, 246, 0.45); }

/* quick actions */
.fd-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 16px; }
.fd-quick button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px 12px; border: 0; border-radius: 22px; background: var(--panel); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: var(--fd-card-shadow); }
.fd-qi { width: 42px; height: 42px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--fd-tile); border: 1px solid var(--fd-hair); color: var(--text); flex-shrink: 0; }
.fd-qi.dark { background: var(--fd-dark); color: var(--fd-glow); border: 0; box-shadow: 0 8px 20px -10px rgba(var(--n-ink-rgb), 0.6); }
.fd-qi.green { background: var(--fd-green); color: var(--acc-deep); border: 0; box-shadow: var(--fd-green-shadow); }
.fd-qi.blue { background: #dbeafe; color: #1d4ed8; border: 0; }

/* layout */
.fd-grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; align-items: start; }
@media (min-width: 900px) { .fd-grid { grid-template-columns: 1fr 1fr; } }
.fd-col > * { margin-bottom: 14px; }
.fd-card { display: block; width: 100%; text-align: left; font: inherit; color: inherit; padding: 18px 20px !important; box-shadow: var(--fd-card-shadow); text-decoration: none; }
button.fd-card { cursor: pointer; border: 0; }
.fd-card h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.fd-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.fd-card-head .small { font-size: 12px; }
.fd-link { border: 0; background: none; padding: 6px 2px; font: inherit; font-size: 14px; font-weight: 600; color: var(--fd-green-ink); cursor: pointer; display: inline-block; }
.fd-link.inline { padding: 0; font-size: inherit; }
.fd-link.danger, .danger { color: #b91c1c !important; }

/* energy */
.fd-energy-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.fd-energy-nums div { display: flex; flex-direction: column; }
.fd-energy-nums span { font-size: 12px; font-weight: 600; }
.fd-energy-nums b { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.good { color: var(--fd-green-ink); }
.warn { color: var(--fd-c-ink); }
.fd-ebar-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 6px; }

/* rows */
.fd-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--border); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fd-row.static { cursor: default; }
.fd-card-head + .fd-row, .fd-list > .fd-row:first-child, .fd-list > .fd-lrow:first-child { border-top: 0; }
.fd-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fd-row-main b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-row-main .muted { font-size: 12px; }
.fd-row-kcal { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fd-lrow { cursor: default; }
.fd-row-hit { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; font: inherit; color: inherit; text-align: left; padding: 0; cursor: pointer; }
.fd-lrow.planned { background: var(--accent-soft); border-radius: 18px; padding: 10px 12px; border: 0; margin-bottom: 6px; }
.fd-thumb { width: 40px; height: 40px; border-radius: 13px; background: var(--fd-tile); border: 1px solid var(--fd-hair); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: var(--muted); flex-shrink: 0; text-transform: uppercase; }
.fd-thumb.recipe { background: var(--fd-dark); border: 0; color: var(--fd-glow); }
.fd-thumb .fd-ico { width: 18px; height: 18px; }
.fd-thumb.warn { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.fd-est { color: var(--fd-c-ink); font-weight: 600; }
.fd-add { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fd-dark); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; box-shadow: 0 6px 14px -8px rgba(var(--n-ink-rgb), 0.7); }
.fd-add.sm { width: 32px; height: 32px; }
.fd-add .fd-ico { width: 18px; height: 18px; stroke-width: 2.4; }
.fd-ghost { border: 1px dashed #d4d7dc; border-radius: 18px; padding: 2px 12px 12px; margin-top: 8px; }
:root[data-theme="dark"] .fd-ghost { border-color: #3a3e44; }
.fd-ghost .fd-row { border-top: 0; cursor: default; opacity: 0.85; }
.fd-ghost-btns { display: flex; gap: 8px; }

/* chips */
.fd-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.fd-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fd-chip .muted { font-weight: 500; }
.fd-meals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fd-meals .fd-chip { padding: 0 6px; justify-content: center; font-size: 12.5px; }
.fd-chip .fd-ico { width: 15px; height: 15px; stroke-width: 2.6; }
.fd-chip.sel { background: var(--accent-soft); border-color: rgba(var(--acc-500-rgb), 0.5); color: var(--fd-green-ink); box-shadow: 0 0 0 3px rgba(var(--acc-500-rgb), 0.12); }
.fd-chip.dark, .fd-chip.sel.dark { background: var(--fd-dark); border-color: var(--fd-dark); color: #fff; box-shadow: 0 8px 20px -10px rgba(var(--n-ink-rgb), 0.6); }
.fd-chip.static { cursor: default; background: var(--panel-2); border-color: transparent; }

/* 75 Hard */
.fd-hard { display: flex !important; align-items: center; gap: 14px; }
.fd-hard-badge { width: 44px; height: 44px; border-radius: 14px; background: rgba(var(--acc-400-rgb), 0.12); border: 1px solid rgba(var(--acc-400-rgb), 0.25); color: var(--fd-glow); text-shadow: 0 0 12px rgba(var(--acc-400-rgb), 0.6); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.fd-hard-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fd-hard-text b { font-size: 15px; font-weight: 700; }
.fd-hard-text > span { font-size: 13px; color: var(--n-line); line-height: 1.45; }
.fd-hard > .fd-ico { color: var(--n-faint); }

/* groups */
.fd-grow { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.fd-card-head + .fd-grow { border-top: 0; }
.fd-grow b { font-weight: 700; font-size: 14px; }
.fd-grow b .muted { font-weight: 600; font-size: 12px; }
.fd-grow.warn span:first-child { color: var(--fd-c-ink); font-weight: 600; }
.fd-dots { display: flex; gap: 5px; }
.fd-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--n-soft2); }
:root[data-theme="dark"] .fd-dots i { background: var(--d-line2); }
.fd-dots i.on { background: var(--fd-green); box-shadow: 0 0 6px rgba(var(--acc-500-rgb), 0.55); }
.fd-dots i.half { background: linear-gradient(90deg, var(--fd-green) 50%, var(--n-soft2) 50%); }
.fd-gbar { height: 6px; border-radius: 3px; background: var(--n-soft); overflow: hidden; display: block; }
:root[data-theme="dark"] .fd-gbar { background: var(--d-line2); }
.fd-gbar i { display: block; height: 100%; background: var(--fd-green); border-radius: 3px; }
.fd-gbar.p i { background: var(--fd-p); }

/* trend */
.fd-bars { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 130px; padding-bottom: 20px; }
.fd-bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 110px; }
.fd-bar i { width: 100%; max-width: 26px; border-radius: 8px 8px 4px 4px; background: #d9f7e3; }
:root[data-theme="dark"] .fd-bar i { background: rgba(var(--acc-500-rgb), 0.25); }
.fd-bar i.on { background: var(--fd-green); box-shadow: 0 0 10px rgba(var(--acc-500-rgb), 0.45); }
.fd-bar i.over { background: #fde68a; }
.fd-bar span { position: absolute; bottom: -20px; font-size: 11px; font-weight: 600; color: var(--muted); }
.fd-tline { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--n-faint); z-index: 1; pointer-events: none; }

/* week plan card */
.fd-wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.fd-wkd { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); }
.fd-wkd i { width: 100%; height: 36px; border-radius: 10px; border: 1px dashed #d4d7dc; }
.fd-wkd i.full { border: 0; background: var(--fd-tile); box-shadow: inset 0 0 0 1px var(--fd-hair); }
.fd-wkd.on span { color: var(--fd-green-ink); }
.fd-wkd.on i.full { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(var(--acc-500-rgb), 0.4); }
.fd-wkd em { font-style: normal; font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* close the day */
.fd-close { max-width: 520px; margin: 4px auto 24px; display: flex; flex-direction: column; }

/* buttons */
.fd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 999px; border: 0; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%; text-decoration: none; }
.fd-btn.sm { min-height: 42px; width: auto; padding: 0 16px; font-size: 14px; flex-shrink: 0; }
.fd-btn .fd-ico { width: 18px; height: 18px; }
.fd-btn:disabled { opacity: 0.5; cursor: default; }
.fd-btn-green { background: var(--fd-green); color: var(--acc-deep); box-shadow: var(--fd-green-shadow); }
.fd-btn-dark { background: var(--fd-dark); color: #fff; box-shadow: 0 8px 20px -10px rgba(var(--n-ink-rgb), 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.fd-btn-soft { background: var(--panel-2); color: var(--text); }
.fd-btn-outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--text); }
.fd-btn-plain { background: none; color: var(--text); min-height: 44px; }
/* Text under a bottom button gets breathing room (Tom, 2026-11-12). */
.fd-foot { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; }
.fd-row-btns { display: flex; gap: 8px; }
/* Favourited state: a filled amber star, so it's clear at a glance (Tom, 2026-11-12). */
.fd-fav.on { color: #b45309; background: #fef3c7; box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35); }
.fd-fav.on .fd-ico { fill: #f59e0b; stroke: #f59e0b; filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.45)); }
.fd-btn-plain.fd-fav.on { background: rgba(245, 158, 11, 0.12); }
:root[data-theme="dark"] .fd-fav.on { color: #fbbf24; background: rgba(245, 158, 11, 0.16); }
.fd-favmark { width: 13px; height: 13px; margin-left: 5px; vertical-align: -1px; fill: #f59e0b; stroke: #f59e0b; stroke-width: 1.5; stroke-linejoin: round; flex-shrink: 0; }
.fd-done { color: var(--fd-green-ink, var(--acc-700)); cursor: default; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fd-done .fd-ico { stroke: currentColor; }
.fd-row-btns .fd-btn { flex: 1; white-space: nowrap; font-size: 14px; padding: 0 12px; }

/* toast */
.fd-toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--fd-dark); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 2000; box-shadow: 0 12px 30px -10px rgba(var(--n-ink-rgb), 0.6); max-width: calc(100vw - 32px); }
.fd-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- sheets ---------- */
.fd-sheet { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.fd-sheet > * { margin: 0; }
.fd-sh-head { display: flex; align-items: center; gap: 12px; padding-right: 48px; }
.fd-sh-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.fd-sh-head .muted { font-size: 13px; }
.fd-sh-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fd-sh-head.between { justify-content: space-between; padding-right: 48px; }
.fd-sh-head.between > div { align-items: center; }
.fd-err { margin: 0; padding: 10px 14px; border-radius: 14px; background: #fef3c7; color: #92400e; font-size: 13px; line-height: 1.5; }
:root[data-theme="dark"] .fd-err { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
.fd-sec { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.fd-sec .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.fd-sec.between { display: flex; justify-content: space-between; align-items: baseline; }
.fd-sec em { font-style: normal; text-transform: none; letter-spacing: 0; }
.fd-search { display: flex; gap: 8px; align-items: center; }
.fd-search-box { flex: 1; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.fd-search-box input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); outline: none; padding: 0; }
.fd-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: var(--panel-2); }
.fd-seg button { height: 36px; border-radius: 999px; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.fd-seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.08); }
.fd-list { display: flex; flex-direction: column; }
.fd-pop { border-radius: 18px; background: var(--panel-2); padding: 4px 12px; }
.fd-credit { font-size: 11px; color: var(--muted); text-align: center; margin: 6px 0 0; }
.fd-sheet-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.fd-sheet-foot.two { display: grid; grid-template-columns: 1fr 1fr; }
.fd-sheet-foot.two .fd-btn { font-size: 13px; padding: 0 12px; min-height: 48px; }
.fd-sheet-foot .fd-foot { margin-top: 6px; }

/* steppers and amounts */
.fd-stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 6px; }
.fd-stepper > div { display: flex; flex-direction: column; align-items: center; }
.fd-stepper b { font-size: 36px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.fd-stepper > div > span { font-size: 13px; font-weight: 600; }
.fd-stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--panel-2); color: var(--text); font: inherit; font-size: 20px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.fd-stepper.big { padding: 18px; border-radius: 24px; }
.fd-stepper.big b { font-size: 44px; }
.fd-stepper.fd-dark button { background: rgba(255, 255, 255, 0.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.fd-stepper.sm b { font-size: 26px; }
.fd-stepper.sm button { width: 38px; height: 38px; }
.fd-grams { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.fd-grams input { width: 180px; border: 0; border-bottom: 2px solid var(--border); background: none; font: inherit; font-size: 52px; font-weight: 700; letter-spacing: -0.03em; text-align: center; color: var(--text); padding: 0 0 4px; outline: none; -moz-appearance: textfield; }
.fd-grams input:focus { border-color: var(--fd-green); }
.fd-grams input::-webkit-outer-spin-button, .fd-grams input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fd-grams span { font-size: 18px; font-weight: 600; color: var(--muted); }
.fd-mtiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 14px 10px; border-radius: 20px; }
.fd-mtiles > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fd-mtiles b { font-size: 18px; font-weight: 700; }
.fd-mtiles span { font-size: 11px; font-weight: 600; }
.fd-mtiles .k { color: var(--acc-300); } .fd-mtiles .p { color: #f9a8d4; } .fd-mtiles .c { color: #fcd34d; } .fd-mtiles .f { color: #93c5fd; }
.fd-after { margin: 0; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.5; }
.fd-after b { color: var(--text); }
.fd-found { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--fd-green-ink); font-size: 13px; font-weight: 600; }
.fd-found .fd-ico { width: 16px; height: 16px; stroke-width: 2.6; }

/* scan */
.fd-cam { position: relative; aspect-ratio: 4 / 3; border-radius: 24px; overflow: hidden; background: var(--d-bg); }
.fd-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fd-cam-frame { position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%; border-radius: 18px; border: 2px solid rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35), 0 0 18px rgba(var(--acc-400-rgb), 0.5); }
.fd-cam-status { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); padding: 0 16px; }
.fd-type { display: flex; gap: 8px; align-items: center; }
.fd-type input { flex: 1; min-width: 0; height: 46px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel-2); padding: 0 14px; font: inherit; font-size: 16px; color: var(--text); }
.fd-ptarget { padding: 12px; border-radius: 18px; background: var(--panel-2); flex-wrap: wrap; }
.fd-ptarget > span { width: 100%; font-size: 13px; font-weight: 600; }
.fd-ptarget input { background: var(--panel); }

/* photo */
.fd-miss { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 22px; background: var(--fd-dark); color: #fff; box-shadow: var(--fd-dark-shadow); }
.fd-miss-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, 0.08); color: var(--fd-glow); flex-shrink: 0; }
.fd-miss-ico .fd-ico { width: 22px; height: 22px; filter: drop-shadow(0 0 8px rgba(var(--acc-400-rgb), 0.45)); }
.fd-miss div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fd-miss b { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.fd-miss span { font-size: 13px; color: var(--n-line); overflow-wrap: anywhere; }
.fd-miss-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.fd-photo-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; border-radius: 24px; border: 1.5px dashed #c3c7cd; text-align: center; cursor: pointer; }
.fd-photo-drop .fd-ico { width: 32px; height: 32px; color: var(--fd-green-ink); }
.fd-photo-drop b { font-size: 16px; font-weight: 700; }
.fd-photo-drop.busy { opacity: 0.6; cursor: progress; }
.fd-photo-mini { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; border: 1px dashed #c3c7cd; cursor: pointer; font-size: 14px; font-weight: 600; }

/* forms */
.fd-form { display: flex; flex-direction: column; gap: 12px; }
.fd-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fd-field input, .fd-field select, .fd-field textarea { height: 46px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel-2); padding: 0 14px; font: inherit; font-size: 16px; color: var(--text); font-weight: 500; }
.fd-field textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.fd-nut { display: flex; flex-direction: column; border-radius: 18px; background: var(--panel-2); padding: 4px 14px; }
.fd-nut label { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.fd-nut label:first-child { border-top: 0; }
.fd-nut label > span { flex: 1; }
.fd-nut label.sub > span { padding-left: 14px; color: var(--muted); font-weight: 500; }
.fd-nut input { width: 90px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); text-align: right; padding: 0 10px; font: inherit; font-size: 15px; color: var(--text); }
.fd-nut em { width: 28px; font-style: normal; color: var(--muted); font-size: 12px; }
.fd-nut.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; background: none; padding: 0; }
.fd-nut.three label { flex-direction: column; align-items: stretch; gap: 4px; border: 0; padding: 0; font-size: 12px; position: relative; }
.fd-nut.three input { width: 100%; }
.fd-nut.three em { position: absolute; right: 10px; bottom: 11px; width: auto; }
.fd-grams.big input { width: 150px; }
.fd-serv { display: grid; grid-template-columns: 1fr 100px 20px; gap: 8px; align-items: center; }
.fd-serv input { height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); padding: 0 12px; font: inherit; font-size: 15px; color: var(--text); min-width: 0; }
.fd-serv em { font-style: normal; color: var(--muted); font-size: 12px; }
.fd-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.fd-checks label { display: flex; align-items: center; gap: 8px; }
.fd-checks input { width: 18px; height: 18px; accent-color: var(--fd-green); }

/* estimate */
.fd-est-box { display: flex; flex-direction: column; border-radius: 20px; background: var(--panel-2); padding: 14px 16px; gap: 2px; }
.fd-est-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.fd-est-row { display: grid; grid-template-columns: 1fr auto 52px; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.fd-est-row b { text-align: right; }
.fd-est-row .muted { font-size: 12px; }
.fd-est-total { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 12px 14px; border-radius: 16px; font-size: 14px; }
.fd-est-total > span:first-child { flex: 1; font-weight: 700; }
.fd-est-total .fd-dim { font-size: 12px; }
.fd-est-total b { font-size: 18px; font-weight: 700; }

/* recipes */
.fd-rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fd-rcard { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 10px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--panel); font: inherit; color: inherit; cursor: pointer; box-shadow: var(--fd-card-shadow); }
.fd-rcard b { font-size: 14px; font-weight: 700; margin-top: 4px; }
.fd-rcard .small { font-size: 12px; }
.fd-rimg { height: 84px; border-radius: 14px; background: linear-gradient(135deg, var(--n-hair), #f7f8f9); display: flex; align-items: center; justify-content: center; color: var(--n-faint); }
:root[data-theme="dark"] .fd-rimg { background: linear-gradient(135deg, #22262b, #1a1d21); }
.fd-rimg .fd-ico { width: 26px; height: 26px; }
.fd-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 24px; }
.fd-hero > div:first-child { display: flex; flex-direction: column; }
.fd-hero b { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.fd-hero .fd-dim { font-size: 12px; font-weight: 600; margin-top: 4px; }
.fd-hero.col { flex-direction: column; align-items: stretch; gap: 12px; }
.fd-hero.col p { margin: 0; font-size: 13px; line-height: 1.5; color: #e4e6ea; }
.fd-hero.col p b { font-size: 13px; letter-spacing: 0; color: #fff; }
.fd-hero-line { display: flex; align-items: baseline; gap: 10px; flex-direction: row !important; width: 100%; }
.fd-hero-line .fd-pill { margin-left: auto; align-self: center; }
.fd-split { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.fd-splitbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }
.fd-splitbar.big { height: 12px; border-radius: 6px; gap: 3px; }
.fd-splitbar i.p { background: var(--fd-p); } .fd-splitbar i.c { background: var(--fd-c); } .fd-splitbar i.f { background: var(--fd-f); }
.fd-table { display: flex; flex-direction: column; border-radius: 18px; background: var(--panel-2); padding: 4px 14px; }
.fd-table div { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.fd-table div:first-child { border-top: 0; }
.fd-table div.sub span { padding-left: 14px; color: var(--muted); }
.fd-table b { font-weight: 600; }
.fd-ing { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.fd-list > .fd-ing:first-child { border-top: 0; }
.fd-ing.pick { background: #fffbeb; border-radius: 16px; padding: 8px 10px; border: 1px solid #fde68a; margin: 4px 0; }
:root[data-theme="dark"] .fd-ing.pick { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.35); }
.fd-ing .fd-row-main b { white-space: normal; font-size: 14px; }
.fd-ing-g { display: flex; align-items: center; gap: 4px; }
.fd-ing-g input { width: 72px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); text-align: right; padding: 0 8px; font: inherit; font-size: 15px; color: var(--text); }
.fd-ing-g em { font-style: normal; color: var(--muted); font-size: 12px; }
.fd-ing-step { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.fd-ing-step button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit; font-size: 16px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
.fd-ing-step button:disabled { opacity: .4; cursor: default; }
.fd-ing-step b { font-size: 13px; font-weight: 600; color: var(--text); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--panel-2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.fd-x .fd-ico { width: 14px; height: 14px; stroke-width: 2.6; }
.fd-x.sm { width: 24px; height: 24px; background: none; }
.fd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.fd-inline { display: flex; align-items: center; gap: 6px; }
.fd-inline input { flex: 1; min-width: 0; width: 100%; }
.fd-inline em { font-style: normal; color: var(--muted); font-size: 12px; }
.fd-pot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px 16px; border-radius: 20px; }
.fd-pot > div { display: flex; flex-direction: column; gap: 2px; }
.fd-pot span { font-size: 12px; font-weight: 600; }
.fd-pot b { font-size: 18px; font-weight: 700; }

/* plan */
.fd-pdays { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 760px) { .fd-pdays { grid-template-columns: 1fr 1fr; } }
.fd-pday { border-radius: 20px; background: var(--panel); border: 1px solid var(--border); padding: 14px 16px; box-shadow: var(--fd-card-shadow); display: flex; flex-direction: column; gap: 8px; }
.fd-pday.today { border-color: rgba(var(--acc-500-rgb), 0.5); box-shadow: 0 0 0 3px rgba(var(--acc-500-rgb), 0.12), var(--fd-card-shadow); }
.fd-pday.past { opacity: 0.75; box-shadow: none; }
.fd-pday.mini { padding: 10px 16px; background: var(--panel-2); border-color: transparent; }
.fd-pday.mini .fd-pday-head .muted { font-size: 13px; }
.fd-pday-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.fd-pday-head b { font-weight: 700; }
.fd-pday-head .fd-link { font-size: 13px; color: var(--muted); }
.fd-pbar { height: 5px; border-radius: 3px; background: var(--n-soft); overflow: hidden; }
:root[data-theme="dark"] .fd-pbar { background: var(--d-line2); }
.fd-pbar i { display: block; height: 100%; background: var(--fd-green); border-radius: 3px; }
.fd-pbar i.over { background: var(--fd-c); }
.fd-slot { display: flex; align-items: flex-start; gap: 10px; }
.fd-slot-l { width: 22px; height: 22px; border-radius: 7px; background: var(--fd-tile); border: 1px solid var(--fd-hair); font-size: 11px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 4px; }
.fd-slot-items { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.fd-pitem { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--panel-2); font-size: 13px; }
.fd-pitem b { font-weight: 600; }
.fd-pitem .muted { font-size: 12px; }
.fd-pitem.done { background: var(--accent-soft); }
.fd-pslot-add { min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px dashed #c3c7cd; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.fd-left { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--fd-hair); font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.fd-fit { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); flex-shrink: 0; }
.fd-fit.good { background: var(--accent-soft); color: var(--fd-green-ink); }
.fd-fit.over { background: #fef3c7; color: #92400e; }
.fd-tick { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 15px; cursor: pointer; }
.fd-sec + .fd-tick { border-top: 0; }
.fd-tick input { width: 22px; height: 22px; accent-color: var(--fd-green); flex-shrink: 0; }
.fd-tick span { flex: 1; }
.fd-tick b { font-weight: 600; color: var(--muted); font-size: 13px; }
.fd-tick.done span { text-decoration: line-through; color: var(--muted); }

/* goals */
.fd-mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fd-mtile { border-radius: 20px; background: var(--panel-2); padding: 12px 8px; display: flex; flex-direction: column; gap: 6px; }
.fd-mtile > span:first-child { font-size: 13px; font-weight: 600; }
.fd-mtile .p { color: var(--fd-p-ink); } .fd-mtile .c { color: var(--fd-c-ink); } .fd-mtile .f { color: var(--fd-f-ink); }
.fd-mstep { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.fd-mstep b { font-size: 15px; font-weight: 700; white-space: nowrap; }
.fd-mstep button { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 0; background: var(--panel); font: inherit; font-weight: 700; color: var(--text); cursor: pointer; box-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.08); flex-shrink: 0; }
.fd-toggle { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: var(--panel-2); cursor: pointer; }
.fd-toggle > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fd-toggle b { font-size: 15px; font-weight: 600; }
.fd-toggle .small { line-height: 1.45; }
.fd-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.fd-toggle i { width: 48px; height: 28px; border-radius: 999px; background: #d4d7dc; position: relative; flex-shrink: 0; transition: background 0.2s; }
.fd-toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.fd-toggle input:checked + i { background: var(--fd-green); box-shadow: 0 0 10px rgba(var(--acc-500-rgb), 0.45); }
.fd-toggle input:checked + i::after { transform: translateX(20px); }
.fd-toggle input:focus-visible + i { outline: 2px solid var(--fd-green); outline-offset: 2px; }

/* net energy */
.fd-lines { display: flex; flex-direction: column; }
.fd-lines div { display: grid; grid-template-columns: 10px 1fr auto 64px; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.fd-lines div:first-child { border-top: 0; }
.fd-lines i { width: 10px; height: 10px; border-radius: 50%; }
.fd-lines b { text-align: right; font-weight: 700; }
.fd-lines .total { border-top: 2px solid var(--text); font-weight: 700; }
.fd-pairs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 120px; }
.fd-pair { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fd-pair > div { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.fd-pair i { width: 40%; max-width: 12px; border-radius: 4px 4px 2px 2px; }
.fd-pair span { font-size: 11px; font-weight: 600; color: var(--muted); }
i.burn { background: linear-gradient(180deg, #fdba74, #fed7aa); } i.eat { background: linear-gradient(180deg, var(--fd-green), var(--acc-300)); }
.fd-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); font-weight: 600; }
.fd-legend span { display: flex; align-items: center; gap: 6px; }
.fd-legend i { width: 10px; height: 10px; border-radius: 3px; }
.fd-note { padding: 14px 16px; border-radius: 20px; background: var(--panel-2); font-size: 13px; line-height: 1.5; }

/* 75 Hard sheet */
.fd-hbar { position: relative; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.fd-hbar i { position: absolute; top: 0; bottom: 0; left: 0; }
.fd-hbar i.eat { background: var(--fd-green); box-shadow: 0 0 10px rgba(var(--acc-400-rgb), 0.7); }
.fd-hbar i.eat.over { background: #f59e0b; box-shadow: none; }
.fd-hbar i.plan { background: repeating-linear-gradient(45deg, rgba(var(--acc-400-rgb), 0.55) 0 4px, rgba(var(--acc-400-rgb), 0.2) 4px 8px); }
.fd-hdays { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 4px; }
.fd-hdays span { position: relative; aspect-ratio: 1; border-radius: 5px; background: none; box-shadow: inset 0 0 0 1px var(--fd-hair); }
.fd-hdays span.miss { background: var(--n-soft2); box-shadow: none; }
.fd-hdays span.ok { background: var(--fd-green); box-shadow: 0 0 5px rgba(var(--acc-500-rgb), 0.45); }
.fd-hdays span.bad { background: #fca5a5; box-shadow: none; }
.fd-hdays span.now { box-shadow: inset 0 0 0 2px var(--fd-green); }
.fd-hdays span i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 8px; font-weight: 700; color: var(--muted); }
.fd-hdays span.ok i { color: var(--acc-deep); }
.fd-hdays span.now i { color: var(--fd-green-ink); }
:root[data-theme="dark"] .fd-hdays span.miss { background: var(--d-line2); }
.fd-hgrid { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.fd-hlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.fd-hlegend span { display: inline-flex; align-items: center; gap: 6px; }
.fd-hlegend i { width: 10px; height: 10px; border-radius: 3px; }
.fd-hlegend i.ok { background: var(--fd-green); } .fd-hlegend i.bad { background: #fca5a5; }
.fd-hlegend i.miss { background: var(--n-soft2); } .fd-hlegend i.now { box-shadow: inset 0 0 0 2px var(--fd-green); }
:root[data-theme="dark"] .fd-hlegend i.miss { background: var(--d-line2); }
.fd-hnums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 0 2px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.fd-hnums div { display: flex; flex-direction: column; gap: 3px; }
.fd-hnums span { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--n-faint) !important; }
.fd-hero .fd-hnums b { font-size: 20px; letter-spacing: -0.02em; }
.fd-hmeals { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; border-radius: 20px; background: var(--panel); box-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.04), 0 8px 24px rgba(var(--n-ink-rgb), 0.07); }
.fd-hmeal { display: flex; flex-direction: column; gap: 6px; }
.fd-hmeal-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.fd-hmeal-top b { font-weight: 600; }
.fd-hmeal-top span { font-weight: 700; font-variant-numeric: tabular-nums; }
.fd-hmeal-top em { font-style: normal; font-weight: 500; color: var(--muted); }
.fd-hmeal-bar { display: flex; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.fd-hmeal-bar i { background: var(--fd-green); }
.fd-hmeal-bar i.plan { background: repeating-linear-gradient(45deg, rgba(var(--acc-500-rgb), 0.55) 0 4px, rgba(var(--acc-500-rgb), 0.18) 4px 8px); }
.fd-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fd-stats.three > div { padding: 12px; }
.fd-stats b small { font-size: 13px; font-weight: 600; color: var(--muted); }
.fd-hacts { margin-top: 4px; }

/* review */
.fd-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fd-stats > div { border-radius: 18px; background: var(--panel-2); border: 1px solid var(--fd-hair); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.fd-stats span { font-size: 12px; font-weight: 600; color: var(--muted); }
.fd-stats b { font-size: 20px; font-weight: 700; }
.fd-stats em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); }
.fd-stats em.good, .fd-sec em.good { color: var(--fd-green-ink); }
.fd-stats em.warn, .fd-sec em.warn { color: var(--fd-c-ink); }
.fd-wsvg { width: 100%; height: auto; }
.fd-wsvg .dot { fill: var(--fd-green); opacity: 0.4; }
.fd-wsvg .trend { stroke: var(--fd-green); stroke-width: 2.5; filter: drop-shadow(0 0 4px rgba(var(--acc-500-rgb), 0.45)); }
.fd-wsvg .pred { stroke: var(--n-faint); stroke-width: 1.5; stroke-dasharray: 4 4; }
.fd-wlegend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.fd-wlegend b { color: var(--text); font-weight: 600; }
.fd-pbar-row { display: grid; grid-template-columns: 1fr 90px 50px; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.fd-pbar-row span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-pbar-row b { text-align: right; font-weight: 500; }
.fd-tip { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 20px; font-size: 13px; line-height: 1.5; }
.fd-tip b { font-size: 14px; font-weight: 600; }
.fd-tip span { color: #e4e6ea; }

/* setup */
.fd-steps { display: flex; gap: 6px; padding-right: 48px; }
.fd-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--n-soft2); }
.fd-steps i.on { background: var(--fd-green); box-shadow: 0 0 6px rgba(var(--acc-500-rgb), 0.5); }
.fd-hello { display: flex; flex-direction: column; gap: 6px; }
.fd-hello h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.fd-hello > .muted { font-size: 14px; line-height: 1.5; }
.fd-ticks { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.fd-ticks li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.fd-ticks .fd-ico { width: 34px; height: 34px; padding: 8px; border-radius: 12px; background: var(--fd-tile); border: 1px solid var(--fd-hair); }
.fd-facts { display: flex; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--panel-2); font-size: 13px; }
.fd-facts div { flex: 1; display: flex; flex-direction: column; }
.fd-facts span { font-size: 11px; font-weight: 600; color: var(--muted); }
.fd-facts b { font-weight: 600; }
.fd-opts { display: flex; flex-direction: column; gap: 8px; }
.fd-opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: var(--panel); border: 1px solid var(--border); text-align: left; font: inherit; color: inherit; cursor: pointer; box-shadow: var(--fd-card-shadow); }
.fd-opt > span:last-child { display: flex; flex-direction: column; }
.fd-opt b { font-size: 15px; font-weight: 600; }
.fd-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c3c7cd; flex-shrink: 0; }
.fd-opt.on .fd-radio { border: 6px solid var(--fd-green); box-shadow: 0 0 0 4px rgba(var(--acc-500-rgb), 0.15); }
.fd-target { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-radius: 24px; }
.fd-target > div:first-child { display: flex; flex-direction: column; }
.fd-target .fd-dim { font-size: 12px; font-weight: 600; }
.fd-target b { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.fd-target-m { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; color: #e4e6ea; }

/* + menu */

/* Home card */
.fd-home { flex-direction: column; align-items: stretch !important; gap: 12px; }
.fd-home-top { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.fd-home-text { flex: 1; min-width: 0; }
.fd-home .hm-habit-ring b { font-size: 15px; font-weight: 700; }
.fd-home-m { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fd-hm { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; }
.fd-hm.p > span { color: var(--fd-p-ink); } .fd-hm.c > span { color: var(--fd-c-ink); } .fd-hm.f > span { color: var(--fd-f-ink); }
.fd-hm b { font-size: 13px; font-weight: 700; }
.fd-hm b .muted { font-weight: 500; }
.fd-home-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.fd-home-btns .fd-chip { min-height: 34px; }

@media (max-width: 420px) {
  .fd-dial { width: 210px; }
  .fd-mbars { gap: 10px; }
  .fd-quick { gap: 6px; }
  .fd-sheet-foot.two { grid-template-columns: 1fr; }
  .fd-two { grid-template-columns: 1fr; }
  .fd-grow { grid-template-columns: 96px 1fr auto; }
}
/* The shared sheet pads its first child to clear the close button. Food
   sheets wrap everything in .fd-sheet, so pad just the title instead. */
.view-sheet-body > .vs-content > .fd-sheet { padding-right: 0; }
.fd-sheet > .fd-sh-head:first-child { padding-right: 50px; }

/* Calorie dial: the Training load dial with a pace zone. */
.fd-pace-top { display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; margin-bottom: 4px; }
.fd-pace-k { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--muted); }
.fd-pace-s { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.fd-pace { max-width: 250px; cursor: pointer; }
.fd-pace-val { position: absolute; left: 0; right: 0; top: 56%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.fd-pace-val b { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.fd-pace-val span { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.fd-dial-card .fd-dial-sub { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin: 8px 0 16px; }
.fd-pace-opt { margin-top: 0; }
.fd-burn-key { display: flex; align-items: center; gap: 12px; width: 100%; margin: 6px 0 0; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.fd-burn-key b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.fd-burn-k { display: inline-flex; align-items: center; gap: 5px; }
.fd-burn-k i { width: 8px; height: 8px; border-radius: 50%; }
.fd-burn-k i.rest { background: linear-gradient(135deg, #fed7aa, #fdba74); }
.fd-burn-k i.act { background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 0 6px rgba(249, 115, 22, 0.45); }
.fd-burn-tot { margin-left: auto; }
:root[data-theme="dark"] .fd-burn-k i.rest { background: linear-gradient(135deg, rgba(254, 215, 170, 0.5), rgba(253, 186, 116, 0.7)); }
.fd-pace-opt i { background: rgba(111, 207, 151, 0.25); border-color: var(--acc-mint); }
.fd-pace-left { font-size: 13px; font-weight: 600; }
.fd-pace-legend i { border-radius: 50%; }
.fd-table small { font-size: 12px; font-weight: 500; }

/* Get started: dark card with a soft green glow and a setup progress ring. */
.fd-start { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 16px !important; margin-bottom: 14px; background: radial-gradient(120% 140% at 0% 0%, #1f3a2a 0%, var(--n-hero) 55%) !important; }
.fd-start-glow { position: absolute; width: 220px; height: 220px; right: -70px; top: -110px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--acc-400-rgb), 0.28), rgba(var(--acc-400-rgb), 0) 70%); pointer-events: none; animation: fd-start-drift 9s ease-in-out infinite alternate; }
@keyframes fd-start-drift { from { transform: translate(0, 0); } to { transform: translate(-40px, 30px); } }
@media (prefers-reduced-motion: reduce) { .fd-start-glow { animation: none; } }
.fd-start-main { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fd-start-main > .fd-ico { color: var(--n-faint); flex-shrink: 0; }
.fd-start-dial { position: relative; width: 64px; height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.fd-start-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.fd-start-ring circle { fill: none; stroke-width: 6; }
.fd-start-ring .trk { stroke: rgba(255, 255, 255, 0.1); }
.fd-start-ring .bar { stroke: var(--acc-400); stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(var(--acc-400-rgb), 0.7)); transition: stroke-dasharray 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.fd-start-dial b { position: relative; font-size: 19px; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.fd-start-dial small { font-size: 12px; color: var(--n-faint); font-weight: 600; }
.fd-start-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fd-start-text b { font-size: 17px; font-weight: 700; color: #fff; }
.fd-start-text > span:last-child { color: var(--n-line); font-size: 13px; line-height: 1.45; }
.fd-start .fd-eyebrow { color: var(--fd-glow); }
.fd-start-steps { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fd-start-steps span { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 7px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.06); font-size: 11px; font-weight: 600; color: var(--n-faint) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-start-steps i { width: 14px; height: 14px; flex-shrink: 0; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25); display: inline-flex; align-items: center; justify-content: center; }
.fd-start-steps i .fd-ico { width: 10px; height: 10px; stroke-width: 3; }
.fd-start-steps .done { color: #e4e6ea !important; }
.fd-start-steps .done i { background: var(--acc-400); box-shadow: 0 0 8px rgba(var(--acc-400-rgb), 0.6); color: var(--acc-deep); }
.fd-start-steps .next { border-color: rgba(var(--acc-400-rgb), 0.45); color: #fff !important; }
.fd-start-steps .next i { box-shadow: inset 0 0 0 1.5px var(--acc-400); }
.fd-start-hide { position: absolute; top: 12px; right: 14px; border: 0; background: none; color: var(--n-faint); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px; }
/* keep the eyebrow clear of Hide */
.fd-start:has(.fd-start-hide) .fd-start-text { padding-right: 34px; }
.fd-start-main > .fd-ico { align-self: center; }
/* Phones (incl. 430px Pro Max): steps as a roomy 2x2 grid, ring a touch smaller */
@media (max-width: 520px) {
  .fd-start { gap: 16px; padding: 18px 16px 16px !important; }
  .fd-start-main { gap: 14px; align-items: flex-start; }
  .fd-start-main > .fd-ico { align-self: center; }
  .fd-start-dial { width: 56px; height: 56px; }
  .fd-start-dial b { font-size: 17px; }
  .fd-start-text b { font-size: 16px; line-height: 1.3; }
  .fd-start-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fd-start-steps span { padding: 9px 10px; font-size: 12px; }
}

/* Net energy: burned vs eaten bars and a ticked balance scale. */
.fd-net-pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fd-net-pill.deficit { background: rgba(var(--acc-500-rgb), 0.12); color: var(--fd-green-ink); box-shadow: 0 0 14px rgba(var(--acc-500-rgb), 0.25); }
.fd-net-pill.surplus { background: rgba(245, 158, 11, 0.14); color: #92400e; box-shadow: 0 0 14px rgba(245, 158, 11, 0.22); }
.fd-ebal { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--fd-hair); }
.fd-ebal-row { display: grid; grid-template-columns: 58px 1fr 52px; align-items: center; gap: 10px; }
.fd-ebal-row span { font-size: 12px; font-weight: 600; color: var(--muted); }
.fd-ebal-row b { font-size: 16px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.fd-ebal-bar { display: flex; gap: 2px; height: 10px; border-radius: 5px; background: linear-gradient(180deg, rgba(var(--n-ink-rgb), 0.07), rgba(var(--n-ink-rgb), 0.03)); box-shadow: inset 0 1px 2px rgba(var(--n-ink-rgb), 0.06); overflow: hidden; }
.fd-ebal-bar i { height: 100%; border-radius: 5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45); }
/* Resting burn = soft peach, active burn = strong orange, so a rest-only day
   still reads as a full bar rather than an empty grey track. */
.fd-ebal-bar i.rest { background: linear-gradient(90deg, #fed7aa, #fdba74); }
.fd-ebal-bar i.act { background: linear-gradient(90deg, #fb923c, #ea580c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 8px rgba(249, 115, 22, 0.45); }
.fd-ebal-bar i.eat { background: linear-gradient(90deg, var(--acc-300), var(--fd-green)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 8px rgba(var(--acc-500-rgb), 0.4); }
.fd-ebal-key i.rest, .fd-lines i.rest { background: linear-gradient(135deg, #fed7aa, #fdba74); }
.fd-ebal-key i.act, .fd-lines i.act { background: linear-gradient(135deg, #fb923c, #ea580c); }
.fd-lines i.eat { background: linear-gradient(135deg, var(--acc-300), var(--fd-green)); }
.fd-ebal-key { display: flex; gap: 14px; padding-left: 68px; font-size: 11px; font-weight: 600; color: var(--muted); }
.fd-ebal-key span { display: inline-flex; align-items: center; gap: 5px; }
.fd-ebal-key i { width: 8px; height: 8px; border-radius: 2px; }
:root[data-theme="dark"] .fd-ebal-bar { background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .fd-ebal-bar i { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
:root[data-theme="dark"] .fd-ebal-bar i.rest, :root[data-theme="dark"] .fd-ebal-key i.rest, :root[data-theme="dark"] .fd-lines i.rest { background: linear-gradient(90deg, rgba(254, 215, 170, 0.5), rgba(253, 186, 116, 0.7)); }
.fd-ebar { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--acc-500), var(--n-soft2) 50%, #f59e0b); box-shadow: inset 0 1px 2px rgba(var(--n-ink-rgb), 0.08); }
.fd-eticks { position: absolute; left: 0; right: 0; top: 13px; display: flex; justify-content: space-between; }
.fd-eticks span { width: 1px; height: 4px; background: #d5d9de; }
.fd-eticks span.major { height: 7px; background: #b6bcc4; }
.fd-ebar i { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; border: 4px solid var(--fd-dark); box-shadow: 0 0 0 4px rgba(var(--acc-500-rgb), 0.14), 0 2px 8px rgba(var(--n-ink-rgb), 0.25); }
.fd-energy .fd-ebar-scale { margin-top: 16px; }

/* Meal cards: a small ring against a rough meal share, macro split, inset list. */
.fd-meal .fd-card-head { justify-content: flex-start; gap: 12px; margin-bottom: 0; }
.fd-meal.has .fd-card-head { margin-bottom: 12px; }
.fd-meal-ring { width: 44px; height: 44px; flex-shrink: 0; }
.fd-meal-ring .fd-mring { width: 44px; height: 44px; }
.fd-meal-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fd-meal-title b { color: var(--text); font-weight: 700; }
.fd-meal-split { display: flex; gap: 2px; height: 4px; width: 120px; max-width: 100%; border-radius: 2px; overflow: hidden; margin-top: 5px; }
.fd-meal-split i.p { background: var(--fd-p); } .fd-meal-split i.c { background: var(--fd-c); } .fd-meal-split i.f { background: var(--fd-f); }
.fd-meal.empty .fd-meal-title h2 { color: var(--text); }
.fd-meal.empty .fd-meal-ring { opacity: 0.75; }
.fd-meal-list { border-radius: 16px; background: var(--panel-2); border: 1px solid var(--fd-hair); padding: 2px 12px; }
.fd-meal-list .fd-row { border-top-color: var(--fd-hair); }
.fd-meal-list > .fd-row:first-child { border-top: 0; }
.fd-meal-list .fd-thumb { background: var(--panel); }
.fd-row-kcal small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 3px; }
/* Compact food items inside meal cards. */
.fd-meal-list { padding: 0 10px; border-radius: 14px; }
.fd-meal-list .fd-row { gap: 10px; padding: 7px 0; }
.fd-meal-list .fd-thumb { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.fd-meal-list .fd-thumb .fd-ico { width: 14px; height: 14px; }
.fd-meal-list .fd-row-main { gap: 0; }
.fd-meal-list .fd-row-main b { font-size: 14px; }
.fd-meal-list .fd-row-main .muted { font-size: 11px; }
.fd-meal-list .fd-row-kcal { font-size: 14px; }
.fd-meal.has .fd-card-head { margin-bottom: 10px; }
.fd-meal { padding: 14px 16px !important; }
.fd-meal-ring, .fd-meal-ring .fd-mring { width: 40px; height: 40px; }

/* Swipe to delete. */
.fd-swipe { position: relative; overflow: hidden; border-top: 1px solid var(--fd-hair); transition: height 0.22s ease, opacity 0.22s ease; }
.fd-meal-list > .fd-swipe:first-child { border-top: 0; }
.fd-swipe > .fd-row { position: relative; z-index: 1; background: var(--panel-2); border-top: 0 !important; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.fd-swipe-bin { position: absolute; right: 4px; top: 50%; transform: translateY(-50%) scale(0.6); width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fee2e2; color: #b91c1c; opacity: 0; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.fd-swipe-bin .fd-ico { width: 17px; height: 17px; }
.fd-swipe.armed .fd-swipe-bin { background: #ef4444; color: #fff; box-shadow: 0 0 14px rgba(239, 68, 68, 0.55); }
.fd-swipe.gone { height: 0 !important; opacity: 0; border-top-color: transparent; }
:root[data-theme="dark"] .fd-swipe-bin { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.fd-toast.act { display: flex; align-items: center; gap: 14px; pointer-events: auto; padding-right: 8px; }
.fd-toast.act:not(.show) { pointer-events: none; }
.fd-toast button { border: 0; background: rgba(var(--acc-400-rgb), 0.16); color: var(--acc-400); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; }

/* Morning brief (same shell as Get started). */
.fd-brief { text-decoration: none; color: #fff; }
.fd-start-glow.amber { background: radial-gradient(circle, rgba(245, 158, 11, 0.26), rgba(245, 158, 11, 0) 70%); }
.fd-start-ring.over .bar { stroke: #f59e0b; filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.7)); }
.fd-brief .fd-start-text b .fd-glow, .fd-brief .fd-start-text b .fd-amber { font-size: inherit; }
.fd-brief-stats { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fd-brief-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.06); }
.fd-brief-stat em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--n-faint); white-space: nowrap; }
.fd-brief-stat b { font-size: 16px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-brief-stat b small { font-size: 11px; font-weight: 600; color: var(--n-faint); }
.fd-brief-stat b.fd-glow { color: var(--acc-400); }
@media (max-width: 420px) { .fd-brief-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Previous / next day either side of the date. */
.fd-daynav { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.fd-daybtn { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text); background: var(--panel); box-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.06), 0 4px 10px rgba(var(--n-ink-rgb), 0.06); text-decoration: none; }
.fd-daybtn .fd-ico { width: 14px; height: 14px; stroke-width: 2.4; }
.fd-daybtn.off { opacity: 0.3; box-shadow: none; }

/* numbers that look off (portion sheet) */
.fd-warn { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: #fef3c7; color: #92400e; font-size: 13px; line-height: 1.5; }
.fd-warn b { font-weight: 700; }
.fd-warn .fd-link { color: #92400e; text-decoration: underline; text-underline-offset: 2px; }
:root[data-theme="dark"] .fd-warn { background: #3a2f12; color: #fcd34d; }
:root[data-theme="dark"] .fd-warn .fd-link { color: #fcd34d; }

/* add a portion size */
.fd-link .fd-ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
.fd-link.fd-center { display: block; }
.fd-addserv { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; gap: 8px; align-items: center; }
.fd-addserv input { height: 44px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel-2); padding: 0 12px; font: inherit; font-size: 16px; color: var(--text); min-width: 0; width: 100%; }
.fd-addserv label { position: relative; display: block; }
.fd-addserv label input { padding-right: 28px; }
.fd-addserv label span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); font-weight: 600; }

/* weekly check-in */
.panel.fd-ci-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px !important; margin-bottom: 14px; border: 1px solid rgba(var(--acc-500-rgb), 0.35); font: inherit; color: inherit; text-align: left; cursor: pointer; box-shadow: 0 0 0 4px rgba(var(--acc-500-rgb), 0.08), var(--fd-card-shadow); }
.fd-ci-card > .fd-ico:last-child { color: var(--muted); }
.fd-ci-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--fd-dark); color: var(--fd-glow); display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 8px 20px -10px rgba(var(--n-ink-rgb), 0.6); }
.fd-ci-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fd-ci-text b { font-size: 15px; font-weight: 700; }
.fd-ci-text .small { line-height: 1.45; }
.fd-ci-mini { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--fd-hair); font: inherit; color: inherit; text-align: left; }
.fd-ci-mini.link { cursor: pointer; width: 100%; }
.fd-ci-mini b { font-size: 14px; font-weight: 600; }
.fd-ci-mini .small { line-height: 1.45; }
.fd-ci-hero { flex-direction: column; align-items: stretch !important; gap: 8px !important; }
.fd-ci-hero b small { font-size: 16px; font-weight: 600; color: var(--n-line); text-shadow: none; }
.fd-ci-hero > .fd-dim.small { font-size: 13px; font-weight: 500; line-height: 1.5; margin: 0; }
.fd-ci-new { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 14px 16px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--fd-hair); text-align: center; }
.fd-ci-new > div { display: flex; flex-direction: column; gap: 2px; }
.fd-ci-new b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.fd-ci-new > .fd-ico { color: var(--muted); }
.fd-ci-new em { grid-column: 1 / -1; font-style: normal; font-size: 13px; font-weight: 700; color: var(--fd-green-ink); }
.fd-ci-up { color: var(--fd-green-ink); }
.fd-ci-note { margin: 0; line-height: 1.5; color: var(--muted); }
.fd-ci-need { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.fd-ci-need b { text-align: right; font-size: 13px; }

/* One-off ingredient tweaks on a recipe log ("Ingredients this time"). */
.fd-est.adj { color: var(--fd-green-ink); }
.fd-adj { border-radius: 20px; background: var(--panel-2); border: 1px solid var(--fd-hair); padding: 4px 14px; }
.fd-adj.has { box-shadow: inset 0 0 0 1px rgba(var(--acc-500-rgb), 0.35); }
.fd-adj-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fd-adj-head .fd-row-main b { font-size: 15px; }
.fd-adj-chev { transition: transform 0.2s ease; flex-shrink: 0; }
.fd-adj.open .fd-adj-chev { transform: rotate(90deg); }
.fd-adj-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--fd-green-ink); box-shadow: inset 0 0 0 1px rgba(var(--acc-500-rgb), 0.3); flex-shrink: 0; }
.fd-adj-pill .fd-ico { width: 13px; height: 13px; stroke: currentColor; }
.fd-adj-note { margin: 0 0 6px; line-height: 1.5; }
.fd-adj .fd-list { padding-bottom: 4px; }
.fd-adj-row .fd-thumb { width: 34px; height: 34px; border-radius: 11px; font-size: 13px; }
.fd-adj-row.changed .fd-ing-g input { border-color: var(--fd-green); box-shadow: 0 0 0 3px rgba(var(--acc-500-rgb), 0.15); color: var(--fd-green-ink); font-weight: 700; }
.fd-adj-undo { width: 32px; height: 32px; border-radius: 10px; border: 0; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.fd-adj-undo .fd-ico { width: 17px; height: 17px; stroke: currentColor; }
.fd-adj .fd-link.fd-center { margin: 2px auto 8px; }

/* Protein spread (own class: .fd-pace is the calorie gauge) */
.fd-pspread { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.fd-pace-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fd-pace-col b { font-size: 15px; font-weight: 700; }
.fd-pace-col b small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 1px; }
.fd-pace-bar { position: relative; width: 28px; height: 64px; border-radius: 9px; background: var(--u-tile, #f1f2f4); overflow: hidden; }
.fd-pace-bar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 9px; background: #f59e0b; }
.fd-pace-col.good .fd-pace-bar i { background: var(--accent); }
.fd-pace-bar em { position: absolute; left: -2px; right: -2px; height: 2px; background: var(--text); opacity: .35; }
.fd-pace-sn { margin: 10px 0 0; text-align: center; }
.fd-pace-tip { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--u-tile, #f4f5f7); }
:root[data-theme="dark"] .fd-pace-bar, :root[data-theme="dark"] .fd-pace-tip { background: rgba(255, 255, 255, .07); }
/* Review: day by day / weekly averages */
.fd-avg { display: grid; gap: 7px; margin: 4px 0 10px; }
.fd-avg-row { display: grid; grid-template-columns: 52px 1fr 46px 46px; align-items: center; gap: 8px; font-size: 12px; }
.fd-avg-l { color: var(--muted); white-space: nowrap; }
.fd-avg-row b { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.fd-avg-p { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.fd-avg-p.good { color: var(--accent-dark, var(--accent)); font-weight: 600; }
.fd-avg-bar { position: relative; height: 10px; border-radius: 99px; background: var(--u-tile, #f1f2f4); }
.fd-avg-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--accent); }
.fd-avg-bar i.over { background: #f59e0b; }
.fd-avg-bar em { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); opacity: .4; border-radius: 1px; }
:root[data-theme="dark"] .fd-avg-bar { background: rgba(255, 255, 255, .08); }
:root[data-theme="dark"] .fd-avg-p.good { color: var(--acc-400); }

.fd-plan-btns { flex-wrap: wrap; }
.fd-plan-btns .fd-btn:first-child { flex-basis: 100%; }
.fd-close .fd-btn + .fd-btn { margin-top: 8px; }

/* Calorie gauge: 0 / max labels sit under the arc ends, with breathing room below */
.fd-pace.tl-gauge { margin-bottom: 10px; }
.fd-pace .tl-g-lo, .fd-pace .tl-g-hi { bottom: -6px; transform: translateX(-50%); font-weight: 600; }
.fd-pace .tl-g-lo { left: 10%; }
.fd-pace .tl-g-hi { left: 90%; right: auto; }

/* Logged time on each entry, and the Time row in an entry's sheet. */
.fd-at { font-variant-numeric: tabular-nums; }
.fd-time { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); border-color: transparent; }
.fd-time > span { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.fd-time > span svg { width: 16px; height: 16px; opacity: .7; }
.fd-time input { font: inherit; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; border: 0; background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(var(--n-ink-rgb), 0.08); border-radius: 10px; padding: 6px 10px; min-width: 88px; }

/* Back on track: over today even after the margin and planned training */
.fd-ontrack { margin-bottom: 14px; border: 1px solid rgba(var(--acc-500-rgb), 0.3); box-shadow: 0 0 0 4px rgba(var(--acc-500-rgb), 0.06), var(--fd-card-shadow); }
.fd-ontrack .fd-card-head { margin-bottom: 4px; }
.fd-ontrack h2 { margin-bottom: 4px; }
.fd-ot-x { width: 28px; height: 28px; margin: -4px -6px -4px 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.fd-ot-x .fd-ico { width: 16px; height: 16px; }
.fd-ot-x:hover { background: rgba(var(--n-ink-rgb), 0.06); }
.fd-ot-sub { margin: 0 0 10px; line-height: 1.5; }
.fd-ot-list { border-radius: 14px; background: var(--fd-tile); padding: 2px 12px; }
.fd-ot-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.fd-ot-row + .fd-ot-row { border-top: 1px solid rgba(var(--n-ink-rgb), 0.07); }
.fd-ot-ic { width: 34px; height: 34px; border-radius: 11px; background: var(--fd-dark); color: var(--fd-glow); display: grid; place-items: center; flex-shrink: 0; }
.fd-ot-ic .fd-ico { width: 18px; height: 18px; }
.fd-ot-main { display: flex; flex-direction: column; min-width: 0; }
.fd-ot-main b { font-weight: 600; font-size: 15px; }
.fd-ot-foot { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
:root[data-theme="dark"] .fd-ot-list { background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .fd-ot-row + .fd-ot-row { border-top-color: rgba(255, 255, 255, .08); }
.fd-ot-own { margin-left: 8px; padding: 2px 7px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 600; vertical-align: 2px; color: var(--fd-green-ink); background: rgba(var(--acc-500-rgb), 0.12); }
:root[data-theme="dark"] .fd-ot-own { color: var(--fd-glow); background: rgba(var(--acc-400-rgb), 0.14); }

/* Typed calorie and macro targets (Goals sheet) */
.fd-goal-in { width: 100%; max-width: 5.2em; border: 0; border-bottom: 2px dashed rgba(127, 127, 127, 0.35); border-radius: 0; background: transparent; color: inherit; font: inherit; font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; text-align: center; padding: 0 0 2px; outline: none; }
.fd-goal-in:focus { border-bottom-color: currentColor; }
.fd-stepper.fd-dark .fd-goal-in { color: var(--fd-glow); }
.fd-goal-in.sm { font-size: 15px; letter-spacing: 0; max-width: 3.2em; border-bottom-width: 1.5px; padding: 0; color: var(--text); }
.fd-mval { display: inline-flex; align-items: baseline; gap: 1px; min-width: 0; }
.fd-mval i { font-style: normal; font-size: 15px; font-weight: 700; }
