/* Fuel redesign (FUEL_V3_LAYOUT_ENABLED). Loaded by /fuel-v3.js only while the flag is on.
   Uses the app's own theme tokens only (--glass, --glass-strong, --hair, --ink, --ink-2, --ink-3, --line,
   --sand, --sand-text, --sand-soft, --paper, --ivory, --espresso, --shadow, --shadow-sm, --primary falling back to --sand-deep), so
   all four themes (sunrise, day, sunset, night) and their glow come from app.css. No token, background or
   glow is defined here. While .fv3-page is in the view, the app's own Fuel content stays in the DOM (its
   handlers are used: quick log, capture, plans) but is hidden, including the inline food library. */
main#view:has(> .fv3-page) > :not(.fv3-page) { display: none !important; }
/* Popups: the app tab bar and the Atlas button step aside while one is open. */
body.fv3-sheet-open #tabs, body.fv3-sheet-open #atlas-member-entry { visibility: hidden !important; pointer-events: none !important; }
/* Toasts sit above the tab bar; the Atlas button yields while one shows (it covered Undo, audit P8). */
body.fv3-on .fq-toast, body.fv3-on .fp-toast { bottom: var(--fv3-toast-b, 150px) !important; z-index: 9200 !important; }
/* r4c (art review, Fuel "Log it" toast at night): every Fuel toast uses the app's glass (light glass by day, dark glass by
   night; the old var(--ink) fill turned into a light-grey pill at night). Fixed, 12 px above the tab bar (the orb sits in
   its own slot beside the bar), so it never moves the page. */
body.fv3-on .fq-toast, body.fv3-on .fp-toast { background: var(--glass-strong) !important; color: var(--ink) !important; border: 1px solid var(--hair) !important; -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); box-shadow: var(--shadow) !important; }
body.fv3-on .fq-toast .fq-text, body.fv3-on .fq-toast button, body.fv3-on .fp-toast button { color: var(--sand-text) !important; }
body.fv3-on:has(.fq-toast, .fp-toast:not([hidden]), .fv3-toast) #atlas-member-entry { visibility: hidden !important; pointer-events: none !important; }

.fv3 {
  --fv3-primary: var(--primary, var(--sand-deep));
  --fv3-on: var(--on-primary, var(--ivory));
  --fv3-track: var(--sand-soft);
  --fv3-display: var(--f-title, "Bebas Neue"), "Russo One", Impact, "Arial Narrow", sans-serif;
  --fv3-label: var(--f-logo, "Russo One"), "Arial Black", Arial, sans-serif;
  color: var(--ink); font: 17px/1.45 var(--font-body);
}
.fv3-page { display: flex; flex-direction: column; gap: 12px; padding-bottom: var(--fv3-safe, 0px); /* only what the view's shared bottom inset (app.css, docs/design/bottom-gap.md) does not cover */ overflow-anchor: none; min-width: 0; }
.fv3-page > *, .fv3-sheet > * { flex-shrink: 0; }
.fv3 h1, .fv3 h2, .fv3 h3 { font-family: var(--fv3-display); font-weight: 400; letter-spacing: .02em; margin: 0; text-wrap: balance; }
.fv3 h2 { font-size: 30px; line-height: 1; } .fv3 h3 { font-size: 22px; line-height: 1; }
.fv3 p { margin: 0; }
.fv3 button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.fv3 button:focus-visible { outline: 3px solid var(--fv3-primary); outline-offset: 3px; }
.fv3-eye { font: 11px/1.2 var(--fv3-label); letter-spacing: .14em; text-transform: uppercase; color: var(--sand-text); }
.fv3-muted { color: var(--ink-2); } .fv3-small { font-size: 15px; } .fv3-tiny { font-size: 13px; color: var(--ink-3); }
.fv3-num { font-variant-numeric: tabular-nums; }
.fv3-card { background: var(--glass); border: 1px solid var(--hair); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
button.fv3-card { text-align: left; cursor: pointer; width: 100%; }
.fv3-btn { min-height: 52px; border-radius: 999px; border: 0; background: var(--fv3-primary); color: var(--fv3-on) !important; font: 15px/1 var(--fv3-label) !important; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; padding: 0 22px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; }
.fv3-btn[disabled] { opacity: .6; cursor: default; }
.fv3-btn svg { width: 20px; height: 20px; }
.fv3-ghost { background: transparent; color: var(--ink) !important; border: 1px solid var(--line); }
.fv3-link { background: none; border: 0; color: var(--sand-text) !important; font: 15px var(--font-body); cursor: pointer; padding: 12px 0; min-height: 44px; text-align: left; }
.fv3-chev { color: var(--ink-3); font: 20px var(--fv3-label); }

/* Segments */
/* The tab title, for screen readers only (no header row: the segments sit at the top, Jake Nov 15). */
.fv3-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.fv3-seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--sand-soft); border-radius: 999px; padding: 4px; gap: 4px; }
.fv3-seg button { min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: 12px var(--fv3-label) !important; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.fv3-seg button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair), var(--shadow-sm); }

/* Rows */
.fv3-rows { display: flex; flex-direction: column; gap: 8px; }
.fv3-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; border-radius: 18px; border: 1px solid var(--hair); background: var(--glass); padding: 10px 14px; cursor: pointer; text-align: left; width: 100%; box-shadow: var(--shadow); }
.fv3-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fv3-l b { font: 13px/1.2 var(--fv3-label); letter-spacing: .06em; text-transform: uppercase; font-weight: 400; }
.fv3-l span { font-size: 14px; color: var(--ink-2); }
.fv3-v { font-size: 14px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }

/* Photography (F5): every image sits in a box whose size is fixed before it loads (aspect-ratio plus the img
   width/height), so nothing moves when it arrives. Photos only from the repo; see build note F5. */
.fv3-bandimg, .fv3-thumb, .fv3-mimg, .fv3-timg { display: block; overflow: hidden; background: var(--sand-soft); }
.fv3-bandimg img, .fv3-thumb img, .fv3-mimg img, .fv3-timg img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fv3-bandimg img, .fv3-timg img, .fv3-mimg img { aspect-ratio: 800 / 533; }
.fv3-thumb img { aspect-ratio: 1 / 1; }
:root[data-theme="night"] .fv3-bandimg img, :root[data-theme="night"] .fv3-thumb img, :root[data-theme="night"] .fv3-mimg img, :root[data-theme="night"] .fv3-timg img { filter: brightness(.86); }
/* Hero band: the photo across the top of a card, fading into the card's glass (Pearl by day, Smoke by night),
   which keeps the eyebrow legible in every theme. */
.fv3-herocard, .fv3-weekcard { background: var(--glass-strong); overflow: hidden; }
.fv3-band { position: relative; margin: -16px -16px 0; height: 136px; flex: 0 0 auto; }
.fv3-band.fv3-band-s { height: 116px; }
.fv3-band .fv3-bandimg { position: absolute; inset: 0; }
.fv3-fade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--glass-strong) 72%, transparent) 74%, var(--glass-strong) 100%); }
.fv3-band > .fv3-chipline, .fv3-band > .fv3-sect { position: absolute; left: 16px; right: 16px; bottom: 4px; }
.fv3-band .fv3-tiny { color: var(--ink-2); }

/* Ring hero */
.fv3-chipline { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; }
.fv3-tag { font: 10px/1 var(--fv3-label) !important; letter-spacing: .1em; text-transform: uppercase; border-radius: 999px; padding: 7px 10px; background: var(--sand-soft); color: var(--sand-text) !important; white-space: nowrap; border: 0; }
button.fv3-tag { cursor: pointer; min-height: 32px; }
.fv3-hero { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; width: 100%; }
.fv3-hero .fv3-bars { gap: 14px; }
.fv3-ringwrap { position: relative; width: 150px; height: 150px; flex: 0 0 auto; }
.fv3-ringwrap svg { position: absolute; inset: 0; }
.fv3-ringc { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 18px; }
.fv3-ringc b { font: 44px/1 var(--fv3-display); font-weight: 400; font-variant-numeric: tabular-nums; }
.fv3-ringc span { font: 11px/1.25 var(--fv3-label); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.fv3-arc { animation: fv3-draw .6s ease-out; }
.fv3-bars { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fv3-bar { display: flex; flex-direction: column; gap: 5px; }
.fv3-bar .fv3-bl { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.fv3-bar .fv3-bl b { font: 11px var(--fv3-label); font-weight: 400; letter-spacing: .12em; text-transform: uppercase; }
.fv3-bar .fv3-bl span { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fv3-bar i { display: block; height: 8px; border-radius: 4px; background: var(--fv3-track); overflow: hidden; }
.fv3-bar i em { display: block; height: 100%; border-radius: 4px; background: var(--sand); transform-origin: left; animation: fv3-grow .5s ease-out; }
/* Over target (Jake picked option B, r3d): the part of the bar past the target position (--fv3-at) in the palette red,
   the theme's --red token (app.css; the same red by day and night, since night's --danger reads pink on Smoke), with a
   hairline in the card's own colour at the target so the split reads on every bar colour. One treatment for every
   Fuel macro bar (the meal planner's bars use it too). */
.fv3-bar i em.fv3-over { position: relative; }
.fv3-bar i em.fv3-over::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; left: var(--fv3-at, 100%); background: var(--red); box-shadow: inset 2px 0 0 var(--glass-strong, var(--paper)); }
/* One bronze family, mixed from the theme's own tokens (protein sand, carbs light sand, fat deep; water mongoose in its card). */
.fv3-bar.k-carbs i em { background: color-mix(in srgb, var(--sand) 55%, var(--paper)); } .fv3-bar.k-fat i em { background: color-mix(in srgb, var(--sand-deep) 45%, var(--ink)); }

/* Water: the one water on the page ("Water", "0 of 101 fl oz", its bar, +8 / +16). */
.fv3-water { gap: 10px; padding: 14px 14px 16px; }
.fv3-wrow { display: flex; align-items: center; gap: 8px; }
.fv3-water .fv3-grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.fv3-wv { font-size: 15px; line-height: 1; color: var(--ink-2); white-space: nowrap; }
.fv3-wv b { font: 26px/1 var(--fv3-display); font-weight: 400; color: var(--ink); margin-right: 1px; }
.fv3-wbar { display: block; height: 8px; border-radius: 4px; background: var(--fv3-track); overflow: hidden; }
.fv3-wset { align-self: flex-start; padding: 0; min-height: 24px; } /* hotfix r4hw: Set your water, in the bar's place */
.fv3-wbar em { display: block; height: 100%; border-radius: 4px; background: var(--sand-text); transform-origin: left; animation: fv3-grow .5s ease-out; }
.fv3-mini { min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass-strong); font: 12px var(--fv3-label) !important; letter-spacing: .06em; padding: 0 12px; cursor: pointer; white-space: nowrap; }

/* Training line */
.fv3-line { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-2) !important; background: none; border: 0; padding: 4px 2px; text-align: left; cursor: pointer; width: 100%; min-height: 44px; }
.fv3-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fv3-primary); flex: 0 0 auto; margin-top: 7px; }

/* Meals by slot */
.fv3-sect { display: flex; justify-content: space-between; align-items: center; min-height: 32px; gap: 8px; }
.fv3-slot { border-top: 1px solid var(--line); }
.fv3-slot:first-of-type { border-top: 0; }
.fv3-slothead { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 52px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.fv3-slothead .fv3-l { flex: 1; }
.fv3-slothead .fv3-v { min-width: 96px; }
.fv3-slothead .fv3-chv { transition: transform .18s ease-out; color: var(--ink-3); display: inline-grid; width: 20px; flex: 0 0 auto; }
.fv3-slothead[aria-expanded="true"] .fv3-chv { transform: rotate(180deg); }
.fv3-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 30px 10px 12px; border: 0; border-top: 1px solid var(--line); font-size: 16px; background: none; width: 100%; cursor: pointer; text-align: left; min-height: 52px; }
.fv3-item .fv3-in { flex: 1; min-width: 0; }
.fv3-thumb { width: 44px; height: 44px; aspect-ratio: 1 / 1; border-radius: 12px; flex: 0 0 auto; }
.fv3-item .fv3-ir { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; text-align: right; }
.fv3-est { font: 10px var(--fv3-label); letter-spacing: .08em; color: var(--sand-text); margin-left: 4px; }

/* Log */
.fv3-modes { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: var(--sand-soft); border-radius: 999px; padding: 4px; }
.fv3-modes button { min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: 11px var(--fv3-label) !important; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; }
.fv3-modes button svg { width: 18px; height: 18px; color: var(--sand-text); flex: 0 0 auto; }
.fv3-modes button:disabled { opacity: .45; cursor: not-allowed; }
.fv3-search { display: flex; align-items: center; gap: 10px; min-height: 52px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass-strong); padding: 0 18px; }
.fv3-search input { flex: 1; border: 0; background: transparent; color: var(--ink); font: 16px var(--font-body); outline: none; min-width: 0; padding: 0; -webkit-appearance: none; appearance: none; }
.fv3-search input::placeholder { color: var(--ink-3); }
.fv3-search input::-webkit-search-cancel-button, .fv3-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.fv3-results { padding: 4px 16px; gap: 0; }
.fv3-results .fv3-item { padding-left: 0; padding-right: 0; }
.fv3-results .fv3-item:first-child { border-top: 0; }
.fv3-hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 4px 16px 18px; margin: -4px -16px -14px; scroll-padding-inline: 16px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.fv3-hscroll > * { scroll-snap-align: start; }
.fv3-hscroll::-webkit-scrollbar { display: none; }
.fv3-meal { display: flex; flex-direction: column; gap: 6px; min-height: 112px; border-radius: 20px; border: 1px solid var(--hair); background: var(--glass); padding: 12px; cursor: pointer; text-align: left; box-shadow: var(--shadow); min-width: 0; }
.fv3-meal b { font: 15px/1.25 var(--font-body); font-weight: 400; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fv3-meal .fv3-n { font: 22px/1 var(--fv3-display); font-variant-numeric: tabular-nums; }
.fv3-meal .fv3-n small { font: 10px var(--fv3-label); letter-spacing: .1em; color: var(--ink-3); margin-left: 3px; text-transform: uppercase; }
.fv3-meal .fv3-ns { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.fv3-meal { overflow: hidden; }
.fv3-mimg { margin: -12px -12px 2px; aspect-ratio: 16 / 10; height: auto; flex: 0 0 auto; }
.fv3-meal.fv3-add { align-items: flex-start; justify-content: center; border: 1.5px dashed var(--sand); box-shadow: none; background: transparent; color: var(--sand-text) !important; }

/* Plan */
.fv3-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.fv3-week div { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.fv3-week i { width: 100%; max-width: 34px; height: 34px; border-radius: 12px; border: 1px solid var(--line); display: block; background: var(--glass); }
.fv3-week i.on { background: var(--fv3-primary); border-color: var(--fv3-primary); }
.fv3-week i.today { box-shadow: 0 0 0 3px var(--sand-soft), 0 0 0 4px var(--fv3-primary); }
.fv3-week i.past { opacity: .55; }
.fv3-week span { font: 10px var(--fv3-label); letter-spacing: .08em; color: var(--ink-3); }
.fv3-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fv3-tile { min-height: 96px; overflow: hidden; }
.fv3-timg { margin: -16px -16px 2px; aspect-ratio: 16 / 10; height: auto; flex: 0 0 auto; }
.fv3-tile b { font: 13px/1.15 var(--fv3-label); font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.fv3-tile span { font-size: 14px; color: var(--ink-2); }
.fv3-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fv3-stat { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 18px; background: var(--glass-strong); border: 1px solid var(--line); }
.fv3-stat b { font: 30px/1 var(--fv3-display); font-weight: 400; font-variant-numeric: tabular-nums; }
.fv3-stat b small { font: 11px var(--fv3-label); letter-spacing: .1em; color: var(--ink-3); margin-left: 3px; text-transform: uppercase; }
.fv3-stat span { font: 10px/1.3 var(--fv3-label); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

/* Skeleton */
.fv3-sk { background: var(--sand-soft); border-radius: 18px; opacity: .7; }

/* Today's meals header: the eyebrow left; the total and Log a meal right-aligned in the same row (wraps under
   the eyebrow only on very narrow phones). */
.fv3-mealshead { flex-wrap: wrap; row-gap: 6px; }
.fv3-mealsr { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
/* Log a meal (Jake, Nov 15: "log a meal button on desktop distracting"): a quiet outlined action in the page flow,
   styled like the water buttons, never a filled slab and never fixed or absolute over the meal rows. 44 px on touch. */
.fv3-logmeal { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 10px; color: var(--ink) !important; }
.fv3-logmeal svg { width: 16px; height: 16px; color: var(--sand-text); flex: 0 0 auto; }
.fv3 .fv3-logmeal:focus-visible { outline: 3px solid var(--fv3-primary); outline-offset: 2px; }
@media (hover: hover) { .fv3-logmeal:hover { background: var(--sand-soft); } }
/* Desktop (1024 px and up): smaller still, sized for a pointer, inline in the header row. */
@media (min-width: 1024px) { .fv3-logmeal { position: static; min-height: 36px; padding: 0 12px 0 9px; font-size: 11px !important; } .fv3-logmeal svg { width: 14px; height: 14px; } }

/* Popups: one bottom-sheet pattern, fixed (never moves the page). */
.fv3-scrim { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: flex-end; justify-content: center; background: color-mix(in srgb, var(--espresso) 45%, transparent); overscroll-behavior: contain; }
.fv3-sheet { width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; background: var(--glass-strong); border-radius: 28px 28px 0 0; padding: 10px 16px max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border-top: 1px solid var(--hair); overscroll-behavior: contain; animation: fv3-up .22s ease-out; box-sizing: border-box; }
.fv3-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; }
.fv3-x { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fv3-field { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 56px; border-top: 1px solid var(--line); }
.fv3-toast { position: fixed; left: 16px; right: 16px; bottom: var(--fv3-toast-b, 150px); z-index: 9200; max-width: 528px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--glass-strong); color: var(--ink); border: 1px solid var(--hair); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); border-radius: 18px; padding: 6px 8px 6px 16px; min-height: 52px; font: 15px var(--font-body); box-shadow: var(--shadow); animation: fv3-up .2s ease-out; }
.fv3-toast button { min-height: 44px; border: 0; background: transparent; color: var(--sand-text); font: 12px var(--fv3-label); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; padding: 0 12px; }

@keyframes fv3-up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fv3-draw { from { stroke-dasharray: 0 999; } }
@keyframes fv3-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .fv3-arc, .fv3-bar i em, .fv3-wbar em, .fv3-sheet, .fv3-toast { animation: none; } .fv3-slothead .fv3-chv { transition: none; } }
/* Rings and bars animate once (first paint only); later repaints draw in place. */
.fv3-page[data-drawn] .fv3-arc, .fv3-page[data-drawn] .fv3-bar i em, .fv3-page[data-drawn] .fv3-wbar em { animation: none; }

/* ---- Hotfix r3c (Jake's live desktop screenshots, Nov 16) ---- */
/* A meal card with no exact photo: a monogram in the photo's own box (same size, reserved before load), never a
   blank panel. */
.fv3-mono { display: grid; place-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--sand) 70%, var(--paper)), var(--sand-soft)); }
.fv3-mono { color: var(--sand-text); } .fv3-mono svg { display: block; opacity: .9; } /* a category icon, never a letter (r4b) */
/* Log: the page title clears the segments like the other page headers; the mode bar, its note and "Scan the label"
   are one group with standard spacing. */
.fv3 h2.fv3-ph { margin-top: 8px; }
.fv3-modeset { display: flex; flex-direction: column; gap: 4px; }
.fv3-modeset > p { margin-top: 4px; }
.fv3-modeset > .fv3-link { align-self: flex-start; padding: 0 2px; }

@media (min-width: 1024px) {
  /* Popups are centred modals on desktop: fully in view, internal scroll, backdrop kept (phone: bottom sheet). */
  .fv3-scrim { align-items: center; padding: 24px; }
  .fv3-sheet { width: min(560px, 100%); max-height: min(88dvh, 820px); border-radius: 28px; border: 1px solid var(--hair); padding: 18px 20px 22px; box-shadow: var(--shadow); }
  .fv3-sheet > .fv3-grab { display: none; }

  /* ONE desktop photo-card rule for every Fuel photo-card surface (Plan tiles, Log it again and Saved meals, the
     meal plan day cards): images capped at --fv3-card-img, 3-4 columns, text and numbers in view. */
  .fv3-page, .mp2 { --fv3-card-img: 200px; }
  .fv3-tiles { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .fv3-timg, html .mp2 .mp2-mimg { aspect-ratio: auto; height: var(--fv3-card-img, 200px); }
  .fv3-timg img, html .mp2 .mp2-mimg img { aspect-ratio: auto; height: 100%; }
  /* Log it again / Saved meals: a grid of compact cards (square thumbnail, name, protein and kcal), never a
     carousel with a clipped card. */
  .fv3-hscroll { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-auto-columns: auto; overflow: visible; padding: 0; margin: 0; scroll-snap-type: none; }
  .fv3-meal { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-content: start; min-height: 88px; }
  .fv3-meal > .fv3-mimg { grid-row: 1 / span 3; width: 64px; height: 64px; aspect-ratio: 1 / 1; margin: 0; border-radius: 12px; }
  .fv3-meal > .fv3-mimg img { aspect-ratio: 1 / 1; }
  .fv3-meal > .fv3-mono i { font-size: 26px; }
  .fv3-meal > :not(.fv3-mimg) { grid-column: 2; }
  /* r3c2 (art review r3c, advisory 2): the macro line is one baseline across the whole card under the thumbnail:
     each stat stays whole (number and unit never split) and kcal never meets the card edge. */
  .fv3-meal > .fv3-ns { grid-column: 1 / -1; grid-row: 4; flex-direction: row; flex-wrap: nowrap; align-items: baseline; gap: 14px; margin-top: 6px; min-width: 0; }
  .fv3-meal .fv3-ns .fv3-n { white-space: nowrap; flex: none; }
  .fv3-meal.fv3-add { display: flex; }
  /* The mode bar and search sit in a readable column, not the full width. */
  .fv3-modes { max-width: 560px; }
  /* Plan week card: the day strip close together, Fill my week at its own width with the secondary actions beside
     it in one row, each note directly under the actions, lines at a readable length. */
  .fv3-weekcard { display: grid; grid-template-columns: repeat(3, auto) 1fr; grid-auto-flow: row dense; column-gap: 10px; }
  .fv3-weekcard > * { grid-column: 1 / -1; }
  .fv3-weekcard > .fv3-btn { grid-column: auto; width: auto; justify-self: start; padding: 0 28px; }
  .fv3-weekcard > .fv3-btn:not(.fv3-ghost) { min-width: 240px; }
  .fv3-weekcard > p { max-width: 70ch; }
  .fv3-weekcard > .fv3-week { width: 100%; max-width: 420px; justify-self: start; }
  /* Ask Atlas chips: in the card's own box (no negative-margin bleed), all chips visible; a long chip shortens. */
  .fv3-page .ask-chips { margin: 0; padding: 0; overflow: hidden; }
  .fv3-page .ask-chip { display: block; line-height: 38px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
