/* ──────────────────────────────────────────────────────────────────────
   GetFit Nutrition (V2) — stylesheet. The only Nutrition stylesheet in the app.

   Reuses the
   house color/spacing tokens already defined in css/style.css's
   "Champion Color System" (--gold/--green/--red/--bg/--bg-card/--text/
   --border/--radius-*) and the house fonts (Inter body, Space Grotesk
   display, Tabler Icons webfont via `ti ti-*` classes) — this file does
   not redefine those, it only adds Nutrition-V2-specific rules on top of
   them, layering onto css/style.css.

   Scope: everything here is prefixed `.nv2-`. nutrition.html loads this
   file on top of css/style.css.

   Layout model (owner decision #4 / #16):
     - Mobile  (<900px): bottom tab bar Today|Pantry|(+)|Kitchen|Meals,
       content below the shared global app header.
     - Desktop (>=900px): a real top sub-nav row Today|Pantry|Kitchen|Meals
       (not a stretched phone layout) plus a visible "+" action button in
       the same row.
   ────────────────────────────────────────────────────────────────────── */

.nv2-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px 16px 48px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    /* A lighter, higher-contrast hint color scoped to Nutrition V2 only
       (never touches the shared --text-hint token V1 also relies on) —
       Concept C parity bug #22's "contrast" requirement for the small
       metadata/caption text that leans on a hint color throughout. */
    --nv2-hint: #9b9b9b;
}
/* This app toggles theme with [data-theme="light"] on an ancestor (see
   css/style.css's "Light theme overrides") rather than prefers-color-
   scheme, so --nv2-hint follows that same convention. */
[data-theme="light"] .nv2-page { --nv2-hint: #767672; }

.nv2-page * { box-sizing: border-box; }

.nv2-page h1, .nv2-page h2, .nv2-page h3 {
    font-family: 'Space Grotesk', sans-serif;
    margin: 0;
}

/* ── Demo-mode banner ────────────────────────────────────────────── */
.nv2-demo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--gold-dim);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14.5px;
    color: var(--text);
}
.nv2-demo-banner strong { color: var(--gold); }
.nv2-demo-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; max-width: 100%; }
.nv2-demo-banner button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 13.5px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.nv2-demo-banner button:hover { color: var(--text); border-color: var(--border-hover); }

/* ── Top header row (title + subtitle on desktop) ───────────────── */
.nv2-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}
.nv2-header h1 { font-size: 26px; }
.nv2-header-sub { color: var(--text-muted); font-size: 14.5px; }

/* ── Primary nav: Today | Pantry | Kitchen | Meals ───────────────── */
/* Desktop: real inline sub-nav row with a trailing "+" button.        */
.nv2-tabs {
    display: none;
}
@media (min-width: 900px) {
    .nv2-tabs {
        display: flex;
        align-items: center;
        gap: 4px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 20px;
        position: relative;
    }
    .nv2-tab {
        appearance: none;
        background: none;
        border: none;
        color: var(--text-muted);
        font-family: 'Space Grotesk', sans-serif;
        font-size: 15px;
        font-weight: 500;
        padding: 12px 18px;
        cursor: pointer;
        border-bottom: 2px solid transparent;
        display: flex;
        align-items: center;
        gap: 7px;
    }
    .nv2-tab i { font-size: 17px; }
    .nv2-tab:hover { color: var(--text); }
    .nv2-tab.is-active { color: var(--gold); border-bottom-color: var(--gold); }
    .nv2-tabs-spacer { flex: 1; }
    .nv2-tab-plus {
        appearance: none;
        background: var(--gold);
        color: #1a1200;
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        margin-bottom: 8px;
        flex-shrink: 0;
    }
    .nv2-tab-plus:hover { opacity: 0.88; }
}

/* Mobile bottom nav: Today | Pantry | (+) | Kitchen | Meals.           */
/* Contextually replaces the global 5-item .mobile-bottom-nav while     */
/* this page is open (see nutrition-v2.js swapMobileNav()) — the        */
/* global nav element itself is untouched, just hidden, so leaving this  */
/* page restores it automatically with zero extra code. */
.nv2-bottom-nav {
    display: none;
}
@media (max-width: 899px) {
    .nv2-bottom-nav {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        height: calc(var(--mobile-bottom-nav-height) + var(--mobile-bottom-nav-safe-area));
        padding-bottom: var(--mobile-bottom-nav-safe-area);
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        z-index: 500;
    }
    .nv2-bottom-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: none;
        border: none;
        color: var(--nv2-hint);
        font-family: 'Inter', sans-serif;
        font-size: 12.5px;
        cursor: pointer;
    }
    .nv2-bottom-item i { font-size: 20px; }
    .nv2-bottom-item.is-active { color: var(--gold); }
    .nv2-bottom-item--fab {
        position: relative;
    }
    .nv2-bottom-item--fab .nv2-fab-circle {
        width: 46px;
        height: 46px;
        border-radius: 50%;
        background: var(--gold);
        color: #1a1200;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        margin-top: -22px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    }
    .nv2-page { padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--mobile-bottom-nav-safe-area) + 24px); }

    /* Exit Nutrition: a slim strip right above the bottom nav (thumb zone). It sits in the same fixed stack, so it inherits the nav's
       safe-area offset, never covers the five Nutrition actions, and the page gets matching bottom padding. Root screens only. */
    .nv2-exit-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        left: 0; right: 0;
        bottom: calc(var(--mobile-bottom-nav-height) + var(--mobile-bottom-nav-safe-area));
        height: var(--nv2-exit-bar-height, 40px);
        padding: 0 16px;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        color: var(--text-muted);
        font-family: 'Inter', sans-serif;
        font-size: 13.5px;
        text-decoration: none;
        z-index: 499;
        -webkit-tap-highlight-color: transparent;
    }
    .nv2-exit-bar[hidden] { display: none; }
    .nv2-exit-bar i { font-size: 16px; }
    .nv2-exit-bar:hover, .nv2-exit-bar:active { color: var(--text); background: var(--bg-hover); }
    .nv2-exit-bar:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
    body.nv2-has-exit .nv2-page { padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--mobile-bottom-nav-safe-area) + var(--nv2-exit-bar-height, 40px) + 24px); }
    body.nv2-has-exit .nv2-toast { bottom: calc(var(--mobile-bottom-nav-height) + var(--mobile-bottom-nav-safe-area) + var(--nv2-exit-bar-height, 40px) + 12px); }
}
/* Desktop: the exit strip never shows (the app's top navigation is always visible there). */
@media (min-width: 900px) {
    .nv2-exit-bar { display: none !important; }
}

/* ── Action-launcher bottom sheet (Eat / Cook / Restock / Create Food / Scan) ── */
.nv2-sheet-dim {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 600;
}
.nv2-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    padding: 10px 16px calc(24px + var(--mobile-bottom-nav-safe-area));
    z-index: 601;
    max-width: 480px;
    margin: 0 auto;
}
@media (min-width: 900px) {
    .nv2-sheet { border-radius: 18px; bottom: auto; top: 50%; transform: translateY(-50%); padding-bottom: 20px; }
}
.nv2-sheet-handle {
    width: 36px; height: 4px; border-radius: 2px;
    background: var(--border-hover);
    margin: 6px auto 14px;
}
.nv2-sheet-title { font-size: 14.5px; color: var(--text-muted); padding: 0 6px 10px; }
.nv2-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.nv2-sheet-tile {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text);
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
}
.nv2-sheet-tile { width: 100%; }
.nv2-sheet-tile i { font-size: 24px; color: var(--gold); }
.nv2-sheet-tile:hover { border-color: var(--border-hover); }
.nv2-sheet-tile[disabled], .nv2-sheet-tile.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.nv2-sheet-tile.is-disabled i { color: var(--nv2-hint); }
.nv2-sheet-footer-btn {
    width: 100%;
    margin-top: 12px;
    background: none;
    border: 1px dashed var(--border-hover);
    color: var(--text-muted);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 14.5px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

/* ── Generic cards / sections used across every V2 screen ──────────── */
.nv2-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 14px;
}
.nv2-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nv2-card-title small {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 13.5px;
}
.nv2-section-label {
    font-size: 13.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nv2-hint);
    margin: 22px 0 10px;
}

/* ── Today screen ────────────────────────────────────────────────── */
.nv2-today-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 760px) {
    .nv2-today-grid { grid-template-columns: 1.1fr 1fr; align-items: start; }
}
.nv2-ring-row { display: flex; align-items: center; gap: 20px; }
.nv2-ring {
    width: 96px; height: 96px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: conic-gradient(var(--gold) calc(var(--pct, 0) * 1%), var(--bg-input) 0);
    flex-shrink: 0;
    position: relative;
}
.nv2-ring::before {
    content: '';
    position: absolute; inset: 8px;
    border-radius: 50%;
    background: var(--bg-card);
}
.nv2-ring-label { position: relative; text-align: center; font-size: 14.5px; z-index: 1; }
.nv2-ring-label strong { display: block; font-size: 18px; font-family: 'Space Grotesk', sans-serif; }
.nv2-macro-bars { flex: 1; display: flex; flex-direction: column; gap: 8px; }
/* Part 18A (consolidated pass): every nutrient row — macros AND the
   Sugars secondary row below them — must stay one responsive line: a
   fixed-width label, a flexible/shrinking progress bar, and a fixed-width
   current/target value that never wraps. flex-shrink:0 + white-space:nowrap
   on the label/value spans make that hold even when the card itself gets
   squeezed narrower than its content would prefer — only .nv2-macro-track
   (flex:1, no fixed basis) is allowed to give up width first. */
.nv2-macro-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.nv2-macro-row span:first-child { width: 48px; flex-shrink: 0; white-space: nowrap; color: var(--text-muted); }
.nv2-macro-row span:last-child { width: 72px; flex-shrink: 0; white-space: nowrap; text-align: right; color: var(--text-muted); }
.nv2-macro-row.nv2-macro-row--secondary { opacity: .85; }
/* Track R (History pass): Sugars / Added sugars are CONSUMPTION-ONLY rows —
   label + the eaten amount, no bar, no goal/limit text. The label may be
   wider than a macro label ("Added sugars") but never shrinks below its text,
   and the value wraps rather than clipping at 320px (it must be allowed to shrink: the generic
   value rule above sets flex-shrink:0, which let a long "At least … g consumed" line spill past its card). */
.nv2-macro-row--consumption { flex-wrap: wrap; justify-content: space-between; }
.nv2-macro-row--consumption span:first-child { width: auto; min-width: 48px; }
.nv2-macro-row--consumption span.nv2-macro-consumption-value { width: auto; flex: 0 1 auto; max-width: 100%; white-space: normal; text-align: right; overflow-wrap: anywhere; color: var(--text); flex-shrink: 1; min-width: 0; } /* 320px fix: resets the generic span:last-child { flex-shrink: 0 } above. Windows 777f3da (flex: 0 1 auto; max-width: 100%) + Mac Batch 2 (flex-shrink: 1; min-width: 0) -- same intent, one rule */
.nv2-macro-helper { margin-top: 2px; font-size: 12px; }
.nv2-ing-next-steps { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.nv2-ing-next-steps .nv2-link-btn { min-height: 32px; padding: 4px 0; text-align: left; }
.nv2-bought-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.nv2-macro-track { flex: 1; min-width: 0; height: 6px; border-radius: 3px; background: var(--bg-input); overflow: hidden; }
.nv2-macro-fill { height: 100%; border-radius: 3px; }
.nv2-macro-fill.protein { background: var(--green); }
.nv2-macro-fill.carbs { background: var(--gold); }
.nv2-macro-fill.fat { background: #e07a3f; }
.nv2-macro-fill.sugars { background: #9b7fd4; }

.nv2-log-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}
.nv2-log-row:last-child { border-bottom: none; }
.nv2-log-main { display: flex; flex-direction: column; }
.nv2-log-main strong { font-size: 15px; }
.nv2-log-main span { font-size: 13.5px; color: var(--text-muted); }
/* Track Q11: a "Completed" Shopping List row reads as settled/past, not
   another actionable item competing with the Active section above it. */
.nv2-log-row.is-muted { opacity: 0.55; }
.nv2-log-cal { font-size: 14.5px; color: var(--text); font-family: 'Space Grotesk', sans-serif; white-space: nowrap; }
.nv2-log-slot-badge {
    font-size: 11.5px;
    text-transform: uppercase;
    color: var(--nv2-hint);
    background: var(--bg-input);
    border-radius: 4px;
    padding: 2px 6px;
}

/* ── Quick-access tiles: Ready to Eat / Kitchen Ready / Recent ──────── */
/* Netflix/Prime-style draggable rail (draggable-rails pass — supersedes
   the previous pass's scroll-snap + "switch to a grid at 760px" design,
   per this pass's explicit instruction that these are media-style rails
   on every screen width, not a browser-overflow list that becomes a grid
   once there's room). No scroll-snap (free, continuous movement — a card
   can rest at any offset, never forced to the nearest edge), no visible
   scrollbar track, momentum scrolling on touch, and a subtle right-edge
   fade hinting there's more to scroll. nutrition-v2.js's
   wireDraggableRails() adds click-and-hold drag for a mouse/pen pointer
   only — touch is left to the browser's own native swipe, untouched. */
.nv2-rail-wrap { position: relative; }
.nv2-tile-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scroll-padding-left: 2px;
    /* Hide the scrollbar TRACK only — the scrolling itself (including
       keyboard Left/Right once a tile inside is focused, and touch/trackpad
       swipe) is untouched; this is a cosmetic chrome change, not a
       behavior change (B1). */
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
    cursor: grab;
}
.nv2-tile-row::-webkit-scrollbar { display: none; height: 0; }
/* Only while an actual drag (past the small threshold) is in progress —
   never on hover alone (B2: hovering must never move or visually suggest
   moving the rail by itself). */
.nv2-tile-row.is-dragging { cursor: grabbing; user-select: none; }
.nv2-tile {
    position: relative;
    flex: 0 0 auto;
    width: 148px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
}
.nv2-tile i { font-size: 20px; color: var(--gold); }
.nv2-tile strong { display: block; font-size: 14.5px; margin: 8px 0 2px; }
.nv2-tile span { font-size: 13px; color: var(--text-muted); }
.nv2-tile:hover { border-color: var(--border-hover); }
.nv2-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* B5: optional arrow controls. Hidden entirely on a coarse/no-hover
   pointer (touch) regardless of overflow — those devices get native
   swipe only. On a fine/hover-capable pointer (desktop), JS toggles
   .is-visible per-rail based on whether it actually overflows and how
   far it has already scrolled. */
.nv2-rail-arrow { display: none; }
@media (hover: hover) and (pointer: fine) {
    .nv2-rail-arrow.is-visible {
        display: flex; align-items: center; justify-content: center;
        position: absolute; top: 50%; transform: translateY(-50%);
        width: 32px; height: 32px; border-radius: 50%;
        background: var(--bg-input); border: 1px solid var(--border-hover);
        color: var(--gold); cursor: pointer; z-index: 2;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    .nv2-rail-arrow--left { left: -4px; }
    .nv2-rail-arrow--right { right: -4px; }
    .nv2-rail-arrow:hover { border-color: var(--gold-border); }
}
.nv2-tile-quicklog {
    position: absolute; top: 8px; right: 8px;
    /* B4: 24px was below a practical mobile touch-target minimum */
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--gold-dim); border: 1px solid var(--gold-border); color: var(--gold);
    display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14.5px;
}
.nv2-remaining-cal { text-align: center; font-size: 14px; color: var(--text-muted); margin-top: 10px; }

/* ── Buttons (match house .btn look without depending on style.css's
      exact class, since this file must stand alone from V1's CSS) ────── */
.nv2-btn {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    border-radius: var(--radius-md);
    padding: 10px 16px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nv2-btn:hover { border-color: var(--border-hover); }
.nv2-btn--primary { background: var(--gold); border-color: var(--gold); color: #1a1200; font-weight: 600; }
.nv2-btn--primary:hover { opacity: 0.9; }
.nv2-btn--danger { color: var(--red); border-color: var(--red-border); background: var(--red-dim); }
.nv2-btn--block { width: 100%; justify-content: center; }
.nv2-btn--ghost { background: none; }
.nv2-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.nv2-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Pantry screen ───────────────────────────────────────────────── */
.nv2-filter-row { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.nv2-search-row { margin-bottom: 14px; }
.nv2-search-row .nv2-input { width: 100%; }
.nv2-filter-chip {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.nv2-filter-chip.is-active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); }

/* Pantry filters (Food groups + Your categories): swipeable rails on a phone so 10 groups never wrap into a wall of
   chips; they wrap normally on wide screens. "Low stock" is a STATE chip, visibly distinct from a group. */
.nv2-filter-block { margin-bottom: 14px; min-width: 0; }
.nv2-filter-rail { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px 0 6px; max-width: 100%; }
.nv2-filter-rail::-webkit-scrollbar { display: none; }
.nv2-filter-rail .nv2-filter-chip { flex: 0 0 auto; white-space: nowrap; }
.nv2-filter-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 6px 0 2px; }
.nv2-filter-chip--state { border-style: dashed; }
.nv2-filter-chip--manage { border-style: dashed; }
.nv2-chip--quiet { background: transparent; border-style: dashed; }
.nv2-cat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-width: 0; }
.nv2-cat-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 140px; }
.nv2-cat-main strong { overflow-wrap: anywhere; }
.nv2-cat-row .nv2-input-group { flex: 1 1 100%; min-width: 0; }
.nv2-cat-row .nv2-input-group .nv2-input { min-width: 0; }
.nv2-pantry-main span { overflow-wrap: anywhere; }
@media (min-width: 900px) { .nv2-filter-rail { flex-wrap: wrap; overflow-x: visible; } }
/* Batch 5: Pantry filter rails on phones. Presentation only -- filtering,
   categories and pantry data are untouched.
   - 44px touch targets; selected chip gets weight + a full gold ring, and a
     darker gold in light theme (gold on the gold tint measured ~2:1).
   - Edge fades (classes set by enhanceFilterRails() in nutrition-v2.js
     from the rail's real scroll position) signal more chips off-screen. */
.nv2-filter-rail { position: relative; scroll-padding-inline: 28px; }
.nv2-filter-chip.is-active { font-weight: 600; box-shadow: inset 0 0 0 1px var(--gold); }
[data-theme="light"] .nv2-filter-chip.is-active { color: #7a5c00; }
.nv2-filter-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
@media (max-width: 899px) {
    .nv2-filter-rail .nv2-filter-chip { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; }
    .nv2-filter-rail.nv2-rail--more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
    .nv2-filter-rail.nv2-rail--more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); }
    .nv2-filter-rail.nv2-rail--more-left.nv2-rail--more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
}

.nv2-pantry-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 10px;
}
.nv2-pantry-state { color: var(--text-muted); font-weight: 400; font-size: 0.9em; }
.nv2-stock-track { height: 6px; border-radius: 3px; background: var(--bg-input); overflow: hidden; margin: 10px 0; }
.nv2-stock-fill { height: 100%; background: var(--green); border-radius: 3px; }
.nv2-stock-fill.is-low { background: var(--red); }
.nv2-pantry-actions { display: flex; gap: 8px; flex-wrap: wrap; } /* wrap: 4-5 actions overflowed the page at 320-390px */
.nv2-pantry-actions .nv2-btn { flex: 1 1 auto; justify-content: center; font-size: 14px; padding: 8px 10px; }
/* Windows campaign Batch 6: secondary pantry actions (Adjust, Details) behind "More" */
.nv2-pantry-more { flex: 1 1 auto; min-width: 0; }
.nv2-pantry-more > summary { list-style: none; justify-content: center; font-size: 14px; padding: 8px 10px; }
.nv2-pantry-more > summary::-webkit-details-marker { display: none; }
.nv2-pantry-more[open] { flex-basis: 100%; }
.nv2-pantry-more[open] > summary { margin-bottom: 8px; border-color: var(--gold-border, var(--border-hover)); }
.nv2-pantry-more-body { display: flex; gap: 8px; flex-wrap: wrap; }
.nv2-pantry-more-body .nv2-btn { flex: 1 1 auto; justify-content: center; font-size: 14px; padding: 8px 10px; }
.nv2-caption { font-size: 13px; color: var(--nv2-hint); margin-top: 4px; }

.nv2-pantry-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 12px;
    cursor: pointer;
}
.nv2-pantry-row:last-child { border-bottom: none; }
.nv2-pantry-icon {
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    background: var(--bg-input);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--gold);
}
.nv2-pantry-main { flex: 1; min-width: 0; }
.nv2-pantry-main strong { font-size: 15px; display: block; }
.nv2-pantry-main span { font-size: 13.5px; color: var(--text-muted); }
.nv2-badge {
    font-size: 12px;
    border-radius: 5px;
    padding: 2px 7px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.nv2-badge--low { background: var(--red-dim); color: var(--red); border: 1px solid var(--red-border); }
.nv2-badge--ok { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-border); }
.nv2-badge--state { background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border); }
.nv2-badge--status-private { background: var(--bg-input); color: var(--text-muted); }
.nv2-badge--status-submitted { background: var(--gold-dim); color: var(--gold); }
.nv2-badge--status-verified { background: var(--green-dim); color: var(--green); }
.nv2-badge--water { background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border); text-transform: none; letter-spacing: 0; }
.nv2-badge--sub { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); }
/* Track Q8: a Cook-screen ingredient that's in Pantry but short of what
   this step needs — distinct from both "From Pantry" (green) and "Not in
   Pantry" (neutral), never color-only (the text itself says Partially
   available). */
.nv2-badge--partial { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); }

/* ── Recipe Pantry readiness icons (Track C/D, Track Q1/Q3) — one of six
   states per ingredient line, never a plain boolean. Each state pairs a
   distinct glyph (check / exchange / alert-triangle / help-circle /
   droplet / x) with its color, so the state is never communicated by
   color alone (Track Q15 accessibility) ── */
.nv2-readiness-row { display: flex; align-items: flex-start; gap: 10px; }
.nv2-readiness-icon { font-size: 18px; margin-top: 2px; flex-shrink: 0; }
.nv2-readiness-icon.is-ready { color: var(--green); }
.nv2-readiness-icon.is-missing { color: var(--red); }
.nv2-readiness-icon.is-partial { color: var(--gold); }
.nv2-readiness-icon.is-substitute { color: var(--gold); }
.nv2-readiness-icon.is-unknown { color: var(--text-muted); }
/* Track Q1: cooking water is a locked special case — never ready/missing/
   substitute, always available, shown in its own neutral "informational"
   blue so it reads as a different KIND of state, not a severity level. */
.nv2-readiness-icon.is-special { color: #4a9fd8; }

/* ── Track Q10: Recipe Detail action hierarchy — primary actions stack
   (one clear action at a time on a phone width), secondary actions are
   visually quieter and grouped under their own label, and Sharing is
   kept clearly separated below everything else rather than blending
   into the action list. ── */
.nv2-recipe-primary-actions { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.nv2-recipe-secondary-actions .nv2-btn { font-size: 13.5px; padding: 7px 10px; }
.nv2-recipe-sharing-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
@media (min-width: 900px) {
    /* Desktop has room for Cook + Add-missing side by side — mobile never
       does, so the single-column stack above is the default. */
    .nv2-recipe-primary-actions { flex-direction: row; }
    .nv2-recipe-primary-actions .nv2-btn { flex: 1; }
}

/* ── Substitute status banner (shown on a Meal item that has an active,
   session-only substitute override) — must be visually obvious, not a
   tiny gray caption (Track A / A7) ── */
.nv2-sub-status {
    background: var(--gold-dim);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
}
.nv2-sub-status-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.nv2-sub-status-top strong { font-size: 14.5px; }
.nv2-sub-status-detail {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 3px;
}
.nv2-sub-replace-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.nv2-sub-replace-row:last-of-type { border-bottom: none; }
.nv2-sub-replace-row .nv2-caption { font-size: 12px; color: var(--text-muted); }

/* ── Kitchen screen: sub-tabs for Current/Ready, Recipes, Saved, Recent ── */
.nv2-subtabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.nv2-subtab {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 14px;
    cursor: pointer;
}
.nv2-subtab.is-active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); }

.nv2-batch-card, .nv2-recipe-card, .nv2-saved-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    background: var(--bg-input);
}
.nv2-batch-card:hover, .nv2-recipe-card:hover, .nv2-saved-card:hover { border-color: var(--border-hover); }
.nv2-kcard-top { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.nv2-batch-icon {
    width: 42px; height: 42px; border-radius: var(--radius-sm);
    background: var(--bg-card); display: flex; align-items: center; justify-content: center;
    color: var(--gold); flex-shrink: 0;
}
.nv2-batch-main { flex: 1; min-width: 0; }
.nv2-batch-main strong { font-size: 15.5px; display: block; }
.nv2-batch-main span { font-size: 13.5px; color: var(--text-muted); }
.nv2-batch-pct { font-size: 14px; color: var(--text-muted); font-weight: 600; flex-shrink: 0; white-space: nowrap; }
.nv2-remaining-track {
    width: 100%; height: 7px; border-radius: 4px; background: var(--bg-card); margin-top: 8px; overflow: hidden;
}
.nv2-remaining-fill { height: 100%; background: var(--green); border-radius: 4px; }
.nv2-remaining-fill.is-low { background: var(--red); }
.nv2-fav-star { color: var(--nv2-hint); cursor: pointer; font-size: 17px; flex-shrink: 0; background: none; border: none; padding: 4px; }
.nv2-fav-star.is-fav { color: var(--gold); }
.nv2-kcard-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.nv2-kcard-actions .nv2-btn { flex: 1; justify-content: center; font-size: 14px; padding: 7px 8px; }
.nv2-kcard-meta { font-size: 13px; color: var(--nv2-hint); margin-top: 2px; }

/* ── Desktop visual hierarchy (Concept C parity bug #23): a list of
   Pantry/Kitchen/Meal cards becomes a real multi-column grid on desktop
   instead of one long stretched-mobile column, and each card gets a
   little more breathing room at that width. */
.nv2-list-grid > .nv2-pantry-card,
.nv2-list-grid > .nv2-batch-card,
.nv2-list-grid > .nv2-recipe-card,
.nv2-list-grid > .nv2-saved-card,
.nv2-list-grid > .nv2-meal-card {
    margin-bottom: 10px;
}
@media (min-width: 900px) {
    .nv2-list-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 16px;
        align-items: start;
    }
    .nv2-list-grid > .nv2-pantry-card,
    .nv2-list-grid > .nv2-batch-card,
    .nv2-list-grid > .nv2-recipe-card,
    .nv2-list-grid > .nv2-saved-card,
    .nv2-list-grid > .nv2-meal-card {
        margin-bottom: 0;
        padding: 16px;
    }
    .nv2-list-grid > .nv2-empty {
        grid-column: 1 / -1;
    }
}

/* ── Batch / item detail screens ────────────────────────────────── */
.nv2-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.nv2-back-btn {
    background: none; border: none; color: var(--text-muted);
    font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    /* B4: a practical minimum touch target, not just an icon-sized hitbox */
    padding: 9px;
    min-width: 40px;
    min-height: 40px;
    margin: -9px;
}
.nv2-back-btn:hover { color: var(--text); }
.nv2-detail-head h2 { font-size: 21px; flex: 1; }
.nv2-detail-sub { font-size: 14px; color: var(--text-muted); margin-top: -12px; margin-bottom: 16px; }

.nv2-action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
@media (min-width: 540px) { .nv2-action-grid { grid-template-columns: repeat(3, 1fr); } }

.nv2-nutrient-core { display: flex; gap: 10px; margin: 6px 0 4px; }
.nv2-nutrient-core-item { flex: 1; text-align: center; background: var(--bg-input); border-radius: var(--radius-md); padding: 10px 4px; }
.nv2-nutrient-core-item strong { display: block; font-size: 15px; font-family: 'Space Grotesk', sans-serif; }
.nv2-nutrient-core-item span { font-size: 12.5px; color: var(--text-muted); }

.nv2-expand-link {
    font-size: 14px;
    color: var(--gold);
    cursor: pointer;
    display: inline-block;
    margin-top: 10px;
    text-decoration: underline;
}
.nv2-link-btn {
    font-size: 12.5px;
    color: var(--gold);
    cursor: pointer;
    display: block;
    margin-top: 4px;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
}
.nv2-nutrient-table { margin-top: 10px; }
.nv2-nutrient-group-label {
    font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--nv2-hint);
    margin: 14px 0 6px;
}
.nv2-nutrient-row {
    display: flex; justify-content: space-between; font-size: 14.5px;
    padding: 6px 0; border-bottom: 1px solid var(--border);
}
.nv2-nutrient-row span:last-child { color: var(--text-muted); }
.nv2-nutrient-row.is-unavailable span:last-child { color: var(--nv2-hint); font-style: italic; }
.nv2-nutrient-row.is-partial span:last-child::after { content: ' ≥'; color: var(--nv2-hint); }
.nv2-nutrient-note {
    font-size: 13px; color: var(--nv2-hint); margin-top: 10px; line-height: 1.5;
}

/* ── Provenance / "what this represents" expandable breakdown ──────── */
.nv2-provenance {
    font-size: 13.5px;
    color: var(--text-muted);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-top: 10px;
}
.nv2-provenance summary { cursor: pointer; color: var(--gold); outline: none; }
.nv2-provenance ul { margin: 8px 0 0; padding-left: 18px; }
.nv2-provenance li { margin-bottom: 3px; }

/* ── Eat panel: live-updating portion controls ──────────────────── */
.nv2-mode-row { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.nv2-mode-btn {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 8px 6px;
    font-size: 14px;
    cursor: pointer;
    min-width: 70px;
}
.nv2-mode-btn.is-active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); }
.nv2-chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.nv2-chip {
    background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
    border-radius: 999px; padding: 6px 13px; font-size: 14px; cursor: pointer;
}
.nv2-chip.is-active { background: var(--gold); border-color: var(--gold); color: #1a1200; font-weight: 600; }
.nv2-slider-wrap { margin-bottom: 14px; }
.nv2-slider-wrap input[type=range] { width: 100%; }
.nv2-slider-value { font-family: 'Space Grotesk', sans-serif; font-size: 20px; margin-bottom: 4px; }
.nv2-field-row { margin-bottom: 14px; }
.nv2-field-row label { font-size: 13.5px; color: var(--text-muted); display: block; margin-bottom: 5px; }
.nv2-input, select.nv2-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 15.5px;
    font-family: 'Inter', sans-serif;
}
.nv2-input:focus { border-color: var(--gold-border); outline: none; }
.nv2-input-group { display: flex; gap: 8px; }
.nv2-input-group .nv2-input:first-child { flex: 2; }
.nv2-input-group select.nv2-input { flex: 1; }
/* Shopping List manual form: labelled Reason selector with a readable
   width. Presentation only -- no ids, options or saved values change. The
   brand field wraps onto its own row when the card is too narrow for both. */
.nv2-shop-reason-group { flex-wrap: wrap; align-items: flex-end; }
.nv2-shop-reason-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 9rem; min-width: 9rem; }
.nv2-shop-reason-group .nv2-shop-reason-field select.nv2-input { flex: none; width: 100%; } /* outranks .nv2-input-group .nv2-input:first-child */
.nv2-shop-reason-label { font-size: 12px; color: var(--text-muted); }
.nv2-shop-reason-group > .nv2-input { flex: 2 1 12rem; min-width: 0; }
.nv2-warning-box {
    background: var(--red-dim);
    border: 1px solid var(--red-border);
    color: var(--red);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 12px;
}
.nv2-info-box {
    background: var(--gold-dim);
    border: 1px solid var(--gold-border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 12px;
}

/* ── Cook flow: "What came out" summary + dynamic tare breakdown ────── */
.nv2-whatcameout { text-align: center; }
/* Track Q9: a small uppercase label above each half ("What went in" /
   "What came out") so the two are read as distinct sections, not one
   undifferentiated block. */
.nv2-wco-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.nv2-wco-ingredients { font-size: 14.5px; color: var(--text-muted); line-height: 1.5; }
.nv2-wco-input-weight { font-size: 13px; color: var(--nv2-hint); margin-top: 4px; }
.nv2-wco-arrow { color: var(--nv2-hint); font-size: 18px; margin: 8px 0; }
.nv2-wco-result { font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.nv2-wco-result i { color: var(--gold); font-size: 20px; }
.nv2-wco-ratio { font-size: 13px; color: var(--nv2-hint); margin-top: 6px; }

.nv2-tare-breakdown { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.nv2-tare-row { display: flex; justify-content: space-between; font-size: 14.5px; color: var(--text-muted); padding: 3px 0; }
.nv2-tare-row strong { color: var(--text); font-weight: 500; }
.nv2-tare-row--total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 7px; }
.nv2-tare-row--total span, .nv2-tare-row--total strong { color: var(--gold); font-weight: 700; font-size: 15.5px; }

/* ── Cook flow: ingredient list, running total, yield step ─────────── */
.nv2-ing-row {
    display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border);
}
.nv2-ing-main { flex: 1; font-size: 15px; }
.nv2-ing-main small { display: block; color: var(--text-muted); font-size: 13px; }
.nv2-ing-remove { background: none; border: none; color: var(--nv2-hint); cursor: pointer; font-size: 16px; padding: 8px; margin: -8px; }
.nv2-ing-remove:hover { color: var(--red); }
.nv2-running-total {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-input); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px; font-size: 14.5px;
}
.nv2-running-total strong { font-family: 'Space Grotesk', sans-serif; font-size: 15px; }
.nv2-step-indicator { display: flex; gap: 6px; margin-bottom: 16px; font-size: 13.5px; color: var(--nv2-hint); }
.nv2-step-indicator strong { color: var(--gold); }

/* ── Meals screen ────────────────────────────────────────────────── */
.nv2-meal-card { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 10px; background: var(--bg-input); }
.nv2-meal-card:hover { border-color: var(--border-hover); }
.nv2-meal-card strong { font-size: 15.5px; display: block; }
.nv2-meal-card .nv2-meal-slot { font-size: 12.5px; color: var(--nv2-hint); text-transform: uppercase; }
.nv2-meal-items { margin-top: 6px; font-size: 13.5px; color: var(--text-muted); }
.nv2-issue-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--red); margin-top: 6px; }

/* ── Meal multi-batch allocation confirm UI ─────────────────────── */
.nv2-alloc-card { background: var(--bg-input); }
.nv2-alloc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.nv2-alloc-row:last-of-type { border-bottom: none; }
.nv2-alloc-row small { color: var(--nv2-hint); font-size: 12.5px; }
.nv2-alloc-row input.nv2-input { width: 90px; flex-shrink: 0; }
.nv2-alloc-total { font-size: 14px; color: var(--text-muted); margin: 8px 0 12px; text-align: right; }
.nv2-alloc-total.is-bad { color: var(--red); font-weight: 600; }

/* ── Saved Foods / review pipeline stepper ──────────────────────── */
.nv2-pipe { display: flex; align-items: center; gap: 4px; margin: 10px 0; }
.nv2-pipe-step {
    flex: 1; text-align: center; font-size: 12px; color: var(--nv2-hint);
    border-bottom: 3px solid var(--border); padding-bottom: 8px; text-transform: uppercase;
}
.nv2-pipe-step.is-done { color: var(--green); border-bottom-color: var(--green); }
.nv2-pipe-step.is-current { color: var(--gold); border-bottom-color: var(--gold); }

.nv2-completeness { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 3px 9px; border-radius: 999px; }
.nv2-completeness--basic { background: var(--bg-input); color: var(--text-muted); }
.nv2-completeness--good { background: var(--gold-dim); color: var(--gold); }
.nv2-completeness--complete { background: var(--green-dim); color: var(--green); }

/* ── Custom food wizard ──────────────────────────────────────────── */
.nv2-wizard-progress { display: flex; gap: 4px; margin-bottom: 18px; }
.nv2-wizard-dot { flex: 1; height: 3px; border-radius: 2px; background: var(--border); }
.nv2-wizard-dot.is-done { background: var(--gold); }

/* ── Empty states ───────────────────────────────────────────────── */
.nv2-empty { text-align: center; color: var(--text-muted); padding: 30px 10px; font-size: 14.5px; }
.nv2-empty i { font-size: 30px; color: var(--nv2-hint); display: block; margin-bottom: 10px; }

/* ── Cook Step 1: ingredient cards + "From your pantry" picker ───── */
.nv2-ing-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--bg-input);
}
.nv2-ing-card-top { display: flex; align-items: flex-start; gap: 8px; }
.nv2-ing-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nv2-ing-main strong { font-size: 15.5px; }
.nv2-ing-main small { color: var(--nv2-hint); font-weight: 400; }
.nv2-ing-kcal { font-size: 15.5px; font-weight: 600; color: var(--gold); text-align: right; white-space: nowrap; }
.nv2-ing-kcal small { display: block; font-size: 11.5px; color: var(--nv2-hint); font-weight: 400; text-transform: uppercase; }
.nv2-ing-remove {
    background: none; border: none; color: var(--nv2-hint); cursor: pointer;
    padding: 9px; flex-shrink: 0; font-size: 15px; margin: -9px;
}
.nv2-ing-remove:hover { color: var(--red); }
.nv2-ing-card-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.nv2-ing-card-controls .nv2-input { flex: 1; min-width: 0; }
.nv2-ing-grams-eq { font-size: 13px; color: var(--nv2-hint); white-space: nowrap; }

.nv2-picker-panel { margin-top: -4px; margin-bottom: 14px; }
.nv2-picker-chip {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg-card); color: var(--text);
    padding: 7px 13px; font-size: 14px; cursor: pointer;
}
.nv2-picker-chip:hover { border-color: var(--gold); color: var(--gold); }
.nv2-picker-chip i { font-size: 15.5px; }

.nv2-whole-batch-card { background: var(--bg-input); }
.nv2-whole-batch-label { font-size: 13.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }
.nv2-whole-batch-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.nv2-whole-batch-row span { font-size: 14.5px; color: var(--text-muted); }
.nv2-whole-batch-row strong { font-size: 22px; }
.nv2-whole-batch-macros { display: flex; gap: 16px; font-size: 14.5px; color: var(--text-muted); }
.nv2-gd { color: var(--gold); }

/* ── Toast ──────────────────────────────────────────────────────── */
.nv2-toast {
    position: fixed; bottom: calc(var(--mobile-bottom-nav-height) + 16px); left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card); border: 1px solid var(--border-hover);
    color: var(--text); padding: 10px 18px; border-radius: 999px;
    font-size: 14.5px; z-index: 900; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
@media (min-width: 900px) {
    .nv2-toast { bottom: 24px; }
}

/* ── Water / hydration card (Today + dedicated Water screen) ───────── */
.nv2-water-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 14px;
}
.nv2-water-card .nv2-water-total { font-family: 'Space Grotesk', sans-serif; font-size: 22px; }
.nv2-water-card .nv2-water-goal { color: var(--text-muted); font-size: 14.5px; }
.nv2-water-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.nv2-water-actions .nv2-btn { flex: 1; min-width: 86px; }

/* ── Log Food / Substitute: shared "pick an item" row list ─────────── */
.nv2-pick-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    /* B2: this is a native <button> — without an explicit reset it renders
       with the browser's own default button chrome (gray face, inset
       border, system font), which read as a disabled/default control
       rather than a GetFit surface. Reset it to a plain full-width row. */
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: inherit;
}
.nv2-pick-row:last-child { border-bottom: none; }
.nv2-pick-row:hover { background: var(--bg-input); }
.nv2-pick-row .nv2-log-main strong { font-size: 14.5px; }
/* Track Q2: a row shown for context (e.g. a Saved Food/Catalog entry in
   the ingredient-correction picker) that cannot actually be chosen — kept
   visible rather than hidden, but visually and semantically non-pickable. */
.nv2-pick-row.is-disabled { cursor: default; opacity: 0.6; }
.nv2-pick-row.is-disabled:hover { background: none; }

/* B2: Log Food / From your kitchen results — each its own refined GetFit
   card (dark surface, gold-accented icon chip, source badge, chevron)
   instead of a flat list of unstyled rows sharing one outer box. */
.nv2-food-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.nv2-food-row {
    background: var(--bg-card);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md);
    padding: 10px 12px;
}
.nv2-food-row:hover { background: var(--bg-input); border-color: var(--border-hover) !important; }
.nv2-pick-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold-dim);
    display: flex;
    align-items: center;
    justify-content: center;
}
.nv2-pick-icon i { color: var(--gold); font-size: 17px; }
.nv2-pick-chevron { color: var(--text-muted); flex-shrink: 0; font-size: 15px; }
.nv2-badge--restaurant { background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Quick Add: confirmation preview (B3) ───────────────────────────── */
.nv2-quickadd-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-muted);
}
.nv2-quickadd-preview-kcal { font-weight: 600; color: var(--gold); font-size: 15px; }

/* ── Inline Meal-item substitute panel ──────────────────────────────── */
.nv2-sub-panel {
    background: var(--bg-input);
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 8px 0 14px;
}
.nv2-sub-panel .nv2-pick-row:last-child { border-bottom: none; }

.nv2-link {
    color: var(--gold);
    cursor: pointer;
    text-decoration: underline;
}
.nv2-link:hover { color: var(--gold-border); }


/* ── Nutrition menu ───────────────────────────────────────────────────
   Nutrition shows the SAME shared account menu as every other page (Profile, Theme, Help, Sign out ...). JS only ADDS
   History and the Nutrition Tour next to Theme; nothing is hidden any more (Nutrition UX polish). */

/* ── Log rows with actions + batch provenance ─────────────────────────── */
.nv2-log-row--has-actions { flex-wrap: wrap; }
.nv2-log-row--has-actions .nv2-log-main { flex: 1 1 140px; min-width: 0; }
.nv2-log-prov { display: block; font-size: 12.5px; color: var(--gold); margin-top: 2px; overflow-wrap: anywhere; }
.nv2-log-prov i { font-size: 13px; }
.nv2-row-actions { flex: 1 0 100%; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.nv2-row-btn {
    background: transparent; border: 1px solid var(--border); color: var(--text-muted);
    border-radius: var(--radius-sm); padding: 5px 10px; min-height: 32px; font-size: 12.5px; cursor: pointer;
    font-family: inherit;
}
.nv2-row-btn:hover { border-color: var(--border-hover); color: var(--text); }

/* ── Nutrition History ────────────────────────────────────────────────
   Mobile: stacked date cards, one column, filters wrap (never a horizontal
   scrollbar). Desktop: the SAME markup/data in a two-column grid of cards. */
.nv2-hist-intro { margin: -4px 0 12px; }
.nv2-hist-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.nv2-hist-filter { cursor: pointer; font-family: inherit; }
.nv2-hist-pickers { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.nv2-hist-pickers label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-muted); min-width: 0; }
.nv2-hist-pickers .nv2-input { min-width: 0; max-width: 100%; }
.nv2-hist-window { font-size: 13px; color: var(--text-muted); margin: 2px 0 10px; }
.nv2-hist-days { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.nv2-hist-day { min-width: 0; }
.nv2-hist-day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.nv2-hist-day-head h3 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 18px; display: inline; }
.nv2-hist-rel { margin-left: 8px; font-size: 12px; color: var(--gold); text-transform: uppercase; letter-spacing: .04em; }
.nv2-hist-day-total { text-align: right; display: flex; flex-direction: column; }
.nv2-hist-day-total strong { font-family: 'Space Grotesk', sans-serif; font-size: 17px; }
.nv2-hist-day-total span { font-size: 11.5px; color: var(--text-muted); }
.nv2-hist-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.nv2-hist-stat { background: var(--bg-input); border-radius: var(--radius-sm); padding: 6px 8px; min-width: 0; display: flex; flex-direction: column; }
.nv2-hist-stat span { font-size: 11.5px; color: var(--text-muted); }
.nv2-hist-stat strong { font-size: 14px; font-family: 'Space Grotesk', sans-serif; overflow-wrap: anywhere; }
.nv2-hist-stat small { font-size: 10.5px; color: var(--text-muted); }
.nv2-hist-add-btn { margin-bottom: 8px; }
.nv2-hist-add-row { flex-wrap: wrap; }
.nv2-hist-add-row .nv2-btn { flex: 1 1 120px; }
.nv2-hist-add-row .nv2-btn.is-active { border-color: var(--gold); color: var(--gold); }
.nv2-hist-slot { margin-top: 6px; }
.nv2-hist-slot-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.nv2-hist-slot-head strong { font-weight: 600; }
.nv2-hist-more { margin-top: 12px; }
.nv2-hist-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.nv2-hist-empty-actions { justify-content: center; flex-wrap: wrap; }
.nv2-date-banner { display: flex; align-items: center; gap: 6px; }
@media (min-width: 900px) {
    .nv2-hist-days { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .nv2-hist-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
    .nv2-hist-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Recently Finished (Kitchen) ──────────────────────────────────────── */
.nv2-batch-card--finished { opacity: .92; }
.nv2-batch-card--finished .nv2-batch-main span { display: block; }

/* ── Live (real account) mode ─────────────────────────────────────────── */
.nv2-live-banner { border-color: var(--border); }
.nv2-busy { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, .35); }
.nv2-busy-card { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(0, 0, 0, .35); font-size: 14px; }
.nv2-busy-card .ti { animation: nv2-spin 1s linear infinite; }
@keyframes nv2-spin { to { transform: rotate(360deg); } }
.nv2-live-error { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid #c0392b; background: rgba(192, 57, 43, .12); color: var(--text); min-width: 0; }
.nv2-live-error > .ti { color: #e74c3c; font-size: 20px; flex-shrink: 0; }
.nv2-live-error-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.nv2-live-error-text span { color: var(--text-muted); }
.nv2-live-error-actions { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }

/* a consumed sugar amount says "At least X g consumed" in words — no extra ≥ mark or hint */
.nv2-nutrient-row--consumed.is-partial span:last-child::after { content: none; }

.nv2-more-toggle { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; border-top: 1px solid var(--nv2-border, rgba(255,255,255,.08)); padding: 12px 0 4px; margin-top: 4px; color: var(--nv2-accent, #e8b44a); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.nv2-more-nutrition { padding-top: 6px; }
.nv2-inline-error { color: #ff8a80; font-size: 13px; padding: 6px 0; }

/* Create Food: the action bar stays on screen (no scrolling past empty optional fields to continue). */
.nv2-wizard-actions { display: flex; gap: 8px; margin-top: 12px; }
.nv2-wizard-actions--sticky {
    position: sticky; bottom: 0; z-index: 40;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-card); border-top: 1px solid var(--border);
}
@media (max-width: 899px) {
    .nv2-wizard-actions--sticky { bottom: calc(var(--mobile-bottom-nav-height) + var(--mobile-bottom-nav-safe-area)); }
}
.nv2-wizard-actions .nv2-btn { flex: 1; }
.nv2-optional-note { font-size: 13px; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: rgba(232,180,74,.10); color: var(--text); }
.nv2-restock-create { margin-top: 14px; }

/* The status banner is for demo / read-only / developer views only; it is hidden for normal use. */
.nv2-demo-banner[hidden] { display: none !important; }

/* keyboard focus is always visible on every Nutrition control (inputs keep their gold border cue as well) */
#nv2Content button:focus-visible, #nv2Content a:focus-visible, #nv2Content select:focus-visible, #nv2Content [role="button"]:focus-visible,
#nv2Sheet button:focus-visible, .nv2-tabs button:focus-visible, .nv2-bottom-nav button:focus-visible,
#nv2Content .nv2-input:focus-visible, #nv2Content input:focus-visible, #nv2Content textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* the small "x" remove controls keep their look but get a comfortable hit area (>= 32 x 32 px) */
.nv2-ing-remove { min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; margin: -8px; }

/* a focused field is scrolled clear of the sticky action bar / bottom nav, never left underneath them */
#nv2Content input, #nv2Content select, #nv2Content textarea { scroll-margin-bottom: min(240px, 40vh); scroll-margin-top: min(70px, 12vh); }
html { scroll-padding-bottom: min(260px, 42vh); scroll-padding-top: min(70px, 12vh); }

/* Phase 4L — a saved recipe that still holds a withdrawn product */
.nv2-withdrawn-note { border: 1px solid var(--red-border); background: var(--red-dim); color: var(--red); font-size: 13px; line-height: 1.4; }
.nv2-withdrawn-note .nv2-btn { display: block; margin-top: 10px; }
.nv2-ing-row.is-withdrawn { border-left: 3px solid var(--red); }

/* Dashboard link added to every screen header (js: addDashboardLinks). */
.nv2-home-row { margin: -6px 0 2px -6px; }
@media (min-width: 901px) { .nv2-home-row { display: none; } }

/* ──────────────────────────────────────────────────────────────────────
   Nutrition hierarchy pass (visual audit): one Add action, calmer cards, advanced details behind a disclosure.
   Only existing tokens are used (--gold, --gold-dim, --gold-border, --bg-card, --bg-input, --border, --text-muted, ...).
   ────────────────────────────────────────────────────────────────────── */

/* The one Add action: a labelled button on desktop, a labelled centre button on a phone. */
@media (min-width: 900px) {
    .nv2-tab-plus { width: auto; height: 38px; padding: 0 18px 0 14px; border-radius: 999px; gap: 6px; font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 600; line-height: 1; }
    .nv2-tab-plus i { font-size: 18px; }
}
@media (max-width: 899px) {
    .nv2-bottom-item--fab { gap: 0; }
    .nv2-bottom-item--fab .nv2-fab-circle { margin-top: -20px; }
    .nv2-fab-label { font-size: 12.5px; font-weight: 600; color: var(--text); margin-top: 3px; line-height: 1.1; }
}
.nv2-sheet-title { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 600; color: var(--text); }
@media (min-width: 900px) { .nv2-sheet { max-width: 520px; } }

/* Today: calories, macros, water, then what was logged. Left column stacks on desktop (no empty gap under the macros card). */
.nv2-today-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.nv2-today-grid > .nv2-card, .nv2-today-main > .nv2-card { margin-bottom: 0; }
.nv2-today-grid { margin-bottom: 4px; }
.nv2-card--hero { padding: 18px 16px 16px; }
.nv2-card--hero .nv2-ring-row { gap: 18px; }
.nv2-consumption { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.nv2-consumption .nv2-macro-row { font-size: 13px; }
.nv2-card--hero .nv2-remaining-cal { margin-top: 12px; font-size: 14.5px; }
.nv2-card--hero .nv2-expand-link { display: inline-block; margin-top: 10px; }
.nv2-today-log .nv2-log-row { align-items: flex-start; }
.nv2-section-label--first { margin-top: 24px; }
@media (max-width: 420px) {
    /* a narrow phone: label + value on one line, the bar underneath, so the bars stay readable next to the ring */
    .nv2-card--hero .nv2-ring { width: 84px; height: 84px; }
    .nv2-card--hero .nv2-ring-row { gap: 14px; }
    .nv2-macro-bars .nv2-macro-row { flex-wrap: wrap; row-gap: 3px; }
    .nv2-macro-bars .nv2-macro-row span:first-child { flex: 1 0 auto; width: auto; }
    .nv2-macro-bars .nv2-macro-row span:last-child { order: 2; width: auto; }
    .nv2-macro-bars .nv2-macro-row .nv2-macro-track { order: 3; flex: 1 1 100%; }
}
/* Water: a compact quick-add row, not a second set of big buttons */
.nv2-water-card { padding: 14px 16px; }
.nv2-water-card .nv2-stock-track { margin: 8px 0 12px; }
.nv2-water-actions--compact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nv2-water-actions--compact .nv2-btn { flex: 1 1 0; min-width: 72px; min-height: 40px; padding: 6px 10px; font-size: 14px; white-space: nowrap; }
.nv2-water-actions--compact .nv2-btn--ghost { margin-left: auto; border-color: transparent; color: var(--text-muted); }
/* Water quick actions: the last custom amount is a pill like +250 / +500; Custom is an obvious, outlined action with an icon (never a hidden "More") */
.nv2-water-actions .nv2-water-recent i,
.nv2-water-actions .nv2-water-custom-btn i { font-size: 15px; margin-right: 4px; vertical-align: -2px; }
.nv2-water-actions .nv2-water-custom-btn { border-color: var(--gold, var(--border-gold, currentColor)); color: var(--gold, inherit); font-weight: 600; }
.nv2-water-actions .nv2-water-custom-btn:focus-visible,
.nv2-water-actions .nv2-water-recent:focus-visible { outline: 2px solid var(--gold, currentColor); outline-offset: 2px; }
@media (max-width: 360px) { .nv2-water-actions .nv2-btn { min-width: 64px; padding-left: 8px; padding-right: 8px; } }

/* "Tonal" = the leading action of a row without a solid gold bar (solid gold stays for the one primary action per screen). */
.nv2-btn--tonal { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); font-weight: 600; }
[data-theme="light"] .nv2-btn--tonal { color: #7a5c00; }
.nv2-btn--tonal:hover { border-color: var(--gold); }
.nv2-pantry-card { padding: 14px 16px; }
.nv2-pantry-actions .nv2-btn { min-height: 38px; }
.nv2-pantry-more > summary { min-height: 38px; color: var(--text-muted); }

/* Kitchen: one primary action in the header; batch cards sit directly on the page (no card inside a card) */
.nv2-header--action { align-items: center; gap: 12px; flex-wrap: wrap; }
.nv2-header--action .nv2-btn { flex: 0 0 auto; }
.nv2-list-grid--flat > .nv2-batch-card { background: var(--bg-card); }
.nv2-list-grid--flat .nv2-batch-icon { background: var(--bg-input); }
.nv2-batch-card:not(.nv2-batch-card--finished) .nv2-kcard-actions .nv2-btn:first-child { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); font-weight: 600; }
[data-theme="light"] .nv2-batch-card:not(.nv2-batch-card--finished) .nv2-kcard-actions .nv2-btn:first-child { color: #7a5c00; }
.nv2-batch-card:not(.nv2-batch-card--finished) .nv2-kcard-actions .nv2-btn:not(:first-child) { background: transparent; border-color: transparent; color: var(--text-muted); }
.nv2-batch-card:not(.nv2-batch-card--finished) .nv2-kcard-actions .nv2-btn:not(:first-child):hover { color: var(--text); border-color: var(--border); }
.nv2-batch-card .nv2-kcard-actions .nv2-btn { min-height: 38px; }
.nv2-batch-card--finished .nv2-batch-main span.nv2-badge { display: inline-block; margin-left: 6px; vertical-align: middle; }

/* Advanced details: one quiet disclosure style used wherever internals are one tap away */
.nv2-adv, .nv2-more-rail { margin: 12px 0; border: 1px dashed var(--border); border-radius: var(--radius-md); }
.nv2-adv > summary, .nv2-more-rail > summary { cursor: pointer; list-style: none; min-height: 44px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--text-muted); }
.nv2-adv > summary::-webkit-details-marker, .nv2-more-rail > summary::-webkit-details-marker { display: none; }
.nv2-adv > summary::after, .nv2-more-rail > summary::after { content: '+'; font-size: 18px; line-height: 1; color: var(--nv2-hint); }
.nv2-adv[open] > summary::after, .nv2-more-rail[open] > summary::after { content: '\2013'; }
.nv2-adv > :not(summary), .nv2-more-rail > :not(summary) { margin-left: 12px; margin-right: 12px; }
.nv2-adv > :last-child, .nv2-more-rail > :last-child { margin-bottom: 12px; }
.nv2-adv:focus-within, .nv2-more-rail:focus-within { border-color: var(--border-hover); }
.nv2-more-rail > .nv2-rail-wrap { margin-top: 0; }

/* Cook, step 2: the result card reads as one calm summary */
.nv2-whatcameout { padding: 14px 16px; }
.nv2-adv-yield .nv2-wco-input-weight, .nv2-adv-yield .nv2-wco-ratio { font-size: 13.5px; color: var(--text-muted); margin-bottom: 6px; }
.nv2-adv-yield .nv2-info-box { margin-top: 8px; }
/* the desktop rail arrows sat 4px outside the content column (a 4px horizontal overflow at 320 px with a fine pointer) */
@media (hover: hover) and (pointer: fine) {
    .nv2-rail-arrow--left { left: 0; }
    .nv2-rail-arrow--right { right: 0; }
}

/* ── Find Food: one search box (Nutrition UX polish) ─────────────────────
   The old "Everyday foods / Packaged / branded" chips now live in a collapsed, secondary "Narrow results" control; the tag on a
   result is one small word; the provider's own name only appears under a collapsed "Source details". */
.nv2-ff-narrow { margin: 8px 0 0; }
.nv2-ff-narrow > summary, .nv2-ff-source > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px;
    min-height: 32px; color: var(--text-muted); font-size: 13.5px; font-family: 'Inter', sans-serif;
}
.nv2-ff-narrow > summary::-webkit-details-marker, .nv2-ff-source > summary::-webkit-details-marker { display: none; }
.nv2-ff-narrow > summary::before, .nv2-ff-source > summary::before { content: '\203A'; display: inline-block; transition: transform 0.15s; }
.nv2-ff-narrow[open] > summary::before, .nv2-ff-source[open] > summary::before { transform: rotate(90deg); }
.nv2-ff-narrow > summary:focus-visible, .nv2-ff-source > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.nv2-ff-narrow-state { color: var(--text-hint); }
.nv2-ff-tag { white-space: nowrap; }
.nv2-ff-hint { color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) { .nv2-ff-narrow > summary::before, .nv2-ff-source > summary::before { transition: none; } }

/* ── Find Food: typed barcode (validation + polish) ─────────────────────────────────────────────────────────────────
   The barcode row never overflows at 320 px (the input may shrink, the button keeps its words on one line); the not-found state is a card with three full-width actions;
   the extra values on a product are a two-column list whose wording is "Not listed", never 0. */
.nv2-ff-barcode-row { flex-wrap: nowrap; align-items: stretch; }
.nv2-ff-barcode-row .nv2-input { min-width: 0; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.nv2-ff-barcode-row .nv2-btn { white-space: nowrap; flex: 0 0 auto; }
.nv2-ff-notfound { margin: 12px 0; }
.nv2-ff-notfound .nv2-btn--block { min-height: 44px; }
.nv2-ff-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 10px 0 2px; }
.nv2-ff-more-item { display: flex; justify-content: space-between; gap: 8px; min-width: 0; font-size: 13px; border-top: 1px solid var(--border, rgba(127,127,127,.2)); padding-top: 6px; }
.nv2-ff-more-item span { color: var(--text-muted); min-width: 0; }
.nv2-ff-more-item strong { font-weight: 600; text-align: right; white-space: nowrap; }
@media (max-width: 359px) { .nv2-ff-more { grid-template-columns: 1fr; } }

/* ── Fast entry: Quick Add and Create Food are ONE compact form each ─────────────────────────────────────────────── */
.nv2-field-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nv2-field-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nv2-field-grid2 > .nv2-field-row, .nv2-field-grid3 > .nv2-field-row { min-width: 0; margin-bottom: 10px; }
.nv2-field-grid2 .nv2-input, .nv2-field-grid3 .nv2-input { min-width: 0; padding-left: 10px; padding-right: 10px; }
.nv2-field-grid3 .nv2-field-row label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
@media (max-width: 359px) { .nv2-field-grid2 { grid-template-columns: 1fr; } }
.nv2-input--lead { font-size: 18px; font-weight: 600; }
.nv2-input.is-invalid { border-color: #ff8a80; }
.nv2-input[type=number] { -moz-appearance: textfield; }
.nv2-check-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 2px; cursor: pointer; min-height: 44px; }
.nv2-check-row input[type=checkbox] { width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--gold, #e8b44a); }
.nv2-check-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nv2-check-row strong { font-size: 15px; font-weight: 600; }
.nv2-check-row small { font-size: 12.5px; color: var(--text-muted); line-height: 1.35; }
.nv2-cf-lead { margin: -4px 0 12px; }
.nv2-cf-card { margin-bottom: 12px; }
.nv2-cf-card .nv2-card-title { margin-bottom: 10px; }
.nv2-cf-custom { margin-top: 2px; }
.nv2-cf-custom .nv2-input { min-width: 0; flex: 1 1 0; }
.nv2-cf-fold { margin-bottom: 12px; }
.nv2-cf-fold > .nv2-more-toggle { border-top: 0; margin-top: 0; padding-top: 8px; }
.nv2-cf-fold-body { padding: 6px 0 0; }
.nv2-cf-pantry { padding: 4px 0 2px 34px; }
.nv2-cf-unit { align-self: center; padding: 0 6px; color: var(--text-muted); white-space: nowrap; }
.nv2-cf-summary { font-size: 13.5px; color: var(--gold); font-weight: 600; min-height: 0; }
.nv2-cf-summary:empty, .nv2-cf-needs:empty { display: none; }
.nv2-cf-summary { display: flex; flex-direction: column; gap: 1px; }
.nv2-cf-summary.nv2-quickadd-preview { margin: 0; }
.nv2-cf-summary-main { font-size: 15px; font-weight: 600; color: var(--gold); }
.nv2-cf-summary-basis { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.nv2-cf-needs { margin: 0; }
/* the sticky action area: a summary line, then the one primary button */
#nv2QABar, #nv2WizardBar { display: block; }
.nv2-quickadd-bar-inner { display: flex; flex-direction: column; gap: 6px; }
.nv2-quickadd-bar-inner .nv2-quickadd-preview { margin: 0; padding: 6px 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; font-size: 13px; }
.nv2-quickadd-preview-quiet { font-size: 12px; color: var(--text-secondary, var(--text-muted, #8a8f98)); font-weight: 400; }
.nv2-quickadd-preview-macros { display: inline-flex; flex-wrap: wrap; gap: 0 6px; }
.nv2-quickadd-bar-inner .nv2-btn { min-height: 46px; }
.nv2-quickadd-card { margin-bottom: 12px; }

/* Find Food: "Can't find yours?" - a strong, single Create action that opens the form with only the name filled in. */
.nv2-ff-cantfind { margin: 12px 0; border: 1px solid var(--gold, #e8b44a); }
.nv2-ff-cantfind .nv2-card-title { margin-bottom: 8px; }
.nv2-ff-cantfind-btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.nv2-ff-cantfind-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Brand + amount on My Foods cards and the Log Item screen. The brand sits on its own line next to the name (never inside it) and wraps; the amount field is a number with its unit beside it. */
.nv2-batch-main span.nv2-food-sub { display: block; overflow-wrap: anywhere; }
.nv2-tile span { overflow-wrap: anywhere; }
.nv2-detail-sub { overflow-wrap: anywhere; }
.nv2-log-amount { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.nv2-log-amount .nv2-input { flex: 1; min-width: 0; }
.nv2-log-unit { flex: 0 0 auto; color: var(--text-muted); font-size: 14px; min-width: 2.5em; }
.nv2-log-unitswitch { align-items: center; margin: 8px 0 0; }
.nv2-log-unitswitch .nv2-caption { margin: 0 2px 0 0; }

/* ── Recipe / Cook quantity consistency ─────────────────────────── */
/* "Have 2 gal · Need 500 mL ✓" under a recipe line, plus the optional calculation-only equivalent */
.nv2-ing-have { display: block; }
.nv2-ing-eq { display: block; font-size: 12px; color: var(--nv2-hint); margin-top: 2px; }
.nv2-ing-eq--warn { color: var(--gold); }
/* Recipe multiplier: presets + Custom */
.nv2-scale-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.nv2-scale-custom { display: inline-flex; align-items: center; gap: 4px; }
.nv2-scale-custom .nv2-input { width: 84px; min-width: 0; }
/* Details: weight for cooking */
.nv2-pkg-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
/* Who is this batch for? — one clear selected state (radio mark + accent border + tint; not colour alone) */
.nv2-choice-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.nv2-choice {
    display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
    background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius-md, 12px); padding: 12px 14px; min-height: 52px; cursor: pointer;
}
.nv2-choice-mark {
    flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
    border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: #1a1a1a;
}
.nv2-choice-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nv2-choice-title { font-weight: 600; font-size: 15px; }
.nv2-choice-sub { font-size: 12.5px; color: var(--text-muted); font-weight: 400; line-height: 1.35; }
.nv2-choice.is-selected { background: var(--gold-dim); border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.nv2-choice.is-selected .nv2-choice-mark { background: var(--gold); border-color: var(--gold); }
.nv2-choice:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* Measurement trust: weights that are estimated / rejected / weighed for one batch */
.nv2-batch-main span.nv2-recipe-meta { display: block; line-height: 1.4; margin-top: 2px; }
.nv2-ing-eq--approx { color: var(--text-muted); font-style: italic; }
.nv2-ing-weight-warn { margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--gold-dim); border: 1px solid var(--gold-border); font-size: 12.5px; line-height: 1.4; }
.nv2-measure-row { margin-top: 10px; }
.nv2-measure-row label { display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }
.nv2-whole-batch-row.is-partial strong { color: var(--text-muted); }
.nv2-diag { margin-top: 8px; font-size: 12px; color: var(--nv2-muted, #8a8f98); }
.nv2-diag summary { cursor: pointer; padding: 6px 0; min-height: 32px; }
