/* Bitewise design system — calm, warm, premium. Mobile-first. Light + dark.
   "Warm aurora" look: slow ambient gradient background, frosted-glass chrome,
   Outfit display type. All motion respects prefers-reduced-motion. */

/* Outfit (variable, latin subset) — SIL Open Font Licence, self-hosted for offline */
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-var.woff2') format('woff2');
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --bg: #FAF7F2;          /* warm cream */
  --surface: #FFFFFF;
  --surface-2: #F3EEE6;
  --skel: #ECE5D8;
  --ink: #23302A;         /* deep green-charcoal */
  --ink-2: #5C6B62;
  --ink-3: #67736C;       /* AA on bg (4.63) and white (4.95) */
  --line: #E8E1D5;
  --green: #2E6B4F;       /* primary */
  --green-dark: #24543E;
  --green-bright: #4C9A72;
  --green-soft: #E3EFE8;
  --amber: #A85E18;       /* accent — energy (AA as text on white: 4.91) */
  --amber-soft: #F7E9DA;
  --red: #B4472E;
  --red-soft: #F6E3DD;
  --blue: #3A6B8A;
  --blue-soft: #E1EDF4;
  --warn-ink: #6E4318;
  --err-ink: #7C3221;
  --ok-ink: #24543E;
  --info-ink: #2C536C;
  --btn-ink: #FFFFFF;
  --page: #F1ECE3;        /* desktop gutter */
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(35,48,42,.06), 0 8px 24px -6px rgba(46,84,66,.14);
  --shadow-lg: 0 2px 4px rgba(35,48,42,.07), 0 16px 40px -10px rgba(46,84,66,.24);
  --spring: cubic-bezier(.22, 1, .36, 1);
  --sat-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: 'Outfit', var(--font);
  --grad-primary: linear-gradient(150deg, var(--green-bright), var(--green-dark));
  --glass: color-mix(in srgb, var(--surface) 72%, transparent);
  --aurora-1: rgba(118, 178, 146, .42);   /* sage */
  --aurora-2: rgba(233, 180, 120, .38);   /* warm peach */
  --aurora-3: rgba(140, 176, 205, .30);   /* soft sky */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171D1A;
    --surface: #1F2622;
    --surface-2: #29312C;
    --skel: #333C36;
    --ink: #ECF1ED;
    --ink-2: #A8B4AB;
    --ink-3: #8E9A91;
    --line: #323B35;
    --green: #4FA379;
    --green-dark: #6FBF95;
    --green-bright: #7ECCA4;
    --green-soft: #233229;
    --amber: #E1A05E;
    --amber-soft: #37291A;
    --red: #E0785C;
    --red-soft: #392019;
    --blue: #82AECB;
    --blue-soft: #1F2E38;
    --warn-ink: #E8C39A;
    --err-ink: #EFB4A4;
    --ok-ink: #A9D8BE;
    --info-ink: #B4CFE2;
    --btn-ink: #0F1F17;
    --page: #101412;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px -6px rgba(0,0,0,.45);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 16px 40px -10px rgba(0,0,0,.55);
    --glass: color-mix(in srgb, var(--surface) 78%, transparent);
    --aurora-1: rgba(63, 138, 100, .34);    /* emerald */
    --aurora-2: rgba(52, 110, 130, .26);    /* deep teal */
    --aurora-3: rgba(160, 118, 60, .18);    /* bronze */
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  line-height: 1.45; -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* ambient aurora background — pure transform animation, GPU-friendly */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
#bg i {
  position: absolute; display: block; border-radius: 50%;
  filter: blur(70px); will-change: transform;
}
#bg .b1 { width: 65vmax; height: 65vmax; left: -22vmax; top: -18vmax; background: radial-gradient(circle at 40% 40%, var(--aurora-1), transparent 65%); animation: drift1 46s ease-in-out infinite alternate; }
#bg .b2 { width: 55vmax; height: 55vmax; right: -20vmax; top: 22vh; background: radial-gradient(circle at 55% 45%, var(--aurora-2), transparent 65%); animation: drift2 58s ease-in-out infinite alternate; }
#bg .b3 { width: 50vmax; height: 50vmax; left: 8vw; bottom: -22vmax; background: radial-gradient(circle at 50% 50%, var(--aurora-3), transparent 65%); animation: drift3 52s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(14vw, 10vh) scale(1.18); } }
@keyframes drift2 { from { transform: translate(0, 0) scale(1.1); } to { transform: translate(-12vw, -8vh) scale(.92); } }
@keyframes drift3 { from { transform: translate(0, 0) scale(.95); } to { transform: translate(10vw, -10vh) scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

button { font-family: inherit; }
input, select, textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(46,107,79,.45); outline-offset: 1px;
}
label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
.hint { color: var(--ink-2); font-size: .85rem; margin: 4px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* layout */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 16px 16px calc(104px + var(--sat-b)); }
.screen { display: none; }
.screen.active { display: block; animation: fadein .26s var(--spring); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* entrance stagger — applied by JS on screen entry; keyframes fire even on fresh innerHTML nodes */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 55ms); }

h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.02em; }
h2 { font-family: var(--font-display); font-size: 1.18rem; font-weight: 650; margin: 24px 0 10px; letter-spacing: -.01em; }
h3 { font-family: var(--font-display); font-size: .98rem; font-weight: 600; margin: 0 0 6px; }
.sub { color: var(--ink-2); font-size: .92rem; margin: 0 0 14px; }

/* cards */
.card {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.card.tight { padding: 12px 14px; }
.card.hero {
  background: linear-gradient(165deg, color-mix(in srgb, var(--surface) 88%, transparent) 52%, var(--green-soft) 135%);
  border-color: color-mix(in srgb, var(--green) 26%, var(--line));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: 14px; border: none;
  background: var(--grad-primary); color: var(--btn-ink);
  font-family: var(--font-display); font-size: 1rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(46,107,79,.28);
  transition: transform .12s var(--spring), filter .15s ease, box-shadow .15s ease; width: 100%;
}
.btn:active { transform: scale(.97); box-shadow: 0 2px 6px rgba(46,107,79,.25); }
.btn:hover { filter: brightness(1.06); }
.btn.secondary { background: var(--surface); color: var(--green); border: 1.5px solid var(--green); box-shadow: none; }
.btn.secondary:hover { background: var(--green-soft); filter: none; }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); filter: none; }
.btn.danger { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(180,71,46,.25); }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: .9rem; width: auto; border-radius: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.iconbtn {
  background: none; border: none; cursor: pointer; color: var(--ink-2);
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 1.15rem;
  transition: transform .12s var(--spring), background .15s ease;
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn:active { transform: scale(.9); }
.linkbtn { background: none; border: none; color: var(--green); font-weight: 650; cursor: pointer; padding: 10px 4px; font-size: .92rem; }

/* icons */
.svgic { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px 8px; border-bottom: 1px solid transparent;
}
.topbar .title { font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.logo-dot { width: 24px; height: 24px; border-radius: 8px; background: linear-gradient(150deg, var(--green-bright), var(--green-dark)); display: inline-flex; align-items: center; justify-content: center; color: var(--btn-ink); font-size: .82rem; font-weight: 800; box-shadow: 0 2px 6px rgba(46,107,79,.35); }

/* date strip */
.datestrip { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 14px; }
.datestrip .when { text-align: center; }
.datestrip .when b { display: block; font-size: 1.02rem; }
.datestrip .when span { color: var(--ink-2); font-size: .82rem; }

/* fasting-window status pill */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: .8rem; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow);
}

/* streak flame */
.flame { display: inline-block; animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50% { transform: scale(1.18) rotate(4deg); }
}

/* calorie summary */
.kcal-hero { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 136px; height: 136px; flex: none; }
.ring::before {
  content: ''; position: absolute; inset: -14px; border-radius: 50%;
  background: radial-gradient(circle, rgba(76,154,114,.16), transparent 68%);
  pointer-events: none;
}
.ring svg { transform: rotate(-90deg); }
.ring .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .mid b { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ring .mid span { font-size: .72rem; color: var(--ink-2); }
.kcal-legend { flex: 1; display: grid; gap: 7px; font-size: .88rem; }
.kcal-legend .row { display: flex; justify-content: space-between; color: var(--ink-2); }
.kcal-legend .row b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* confetti (spans injected by JS, animated via WAAPI) */
.confetti-dot { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-radius: 2px; pointer-events: none; z-index: 5; }

/* macro bars */
.macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.macro { text-align: center; }
.macro .bar { display: block; height: 7px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin: 6px 0 4px; }
.macro .bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--green), var(--green-bright)); transition: width .7s var(--spring); }
.macro.m-carbs .bar i { background: linear-gradient(90deg, var(--amber), #D08A45); }
.macro.m-fat .bar i { background: linear-gradient(90deg, var(--blue), #6699BB); }
.macro.m-fibre .bar i { background: linear-gradient(90deg, #7A8B4E, #9AAC6A); }
.macro small { color: var(--ink-2); font-size: .72rem; display: block; }
.macro b { font-size: .82rem; font-variant-numeric: tabular-nums; }

/* meals */
.meal { margin-bottom: 14px; }
.meal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }
.meal-head h3 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mi {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem;
  border: 1px solid var(--line);
}
.meal-head .kc { color: var(--ink-2); font-size: .85rem; font-variant-numeric: tabular-nums; }
.entry {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 6px; cursor: pointer; width: 100%; text-align: left; font-size: .95rem;
  transition: border-color .15s ease, transform .15s var(--spring);
}
.entry:hover { border-color: var(--green); }
.entry:active { transform: scale(.985); }
.entry .meta { flex: 1; min-width: 0; }
.entry .meta .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .meta .d { color: var(--ink-2); font-size: .8rem; }
.entry .kc { font-variant-numeric: tabular-nums; font-weight: 650; }
.addline {
  width: 100%; text-align: left; background: none; border: 1.5px dashed var(--line); color: var(--green);
  border-radius: var(--radius-sm); padding: 12px; font-weight: 650; cursor: pointer; font-size: .92rem;
  transition: background .15s ease, border-color .15s ease;
}
.addline:hover { background: var(--green-soft); border-color: var(--green); }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 8px 16px; font-size: .88rem; font-weight: 600; cursor: pointer; min-height: 44px;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s var(--spring);
}
.chip:active { transform: scale(.94); }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--btn-ink); }

/* lists */
.foodrow {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: none; border-bottom: 1px solid var(--line);
  padding: 13px 6px; cursor: pointer; font-size: .95rem;
}
.foodrow:hover { background: var(--surface-2); }
.foodrow .meta { flex: 1; min-width: 0; }
.foodrow .n { font-weight: 600; }
.foodrow .d { color: var(--ink-2); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foodrow .kc { color: var(--ink-2); font-size: .88rem; font-variant-numeric: tabular-nums; text-align: right; flex: none; }
.badge { display: inline-block; font-size: .66rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; vertical-align: 1px; }
.badge.v { background: var(--green-soft); color: var(--ok-ink); }
.badge.u { background: var(--amber-soft); color: var(--warn-ink); }
.badge.mine { background: var(--blue-soft); color: var(--info-ink); }

/* bottom sheet */
.sheet-scrim { position: fixed; inset: 0; background: rgba(14,19,16,.45); z-index: 40; opacity: 0; transition: opacity .2s; }
.sheet-scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border-radius: 22px 22px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.25);
  border-top: 1px solid var(--line);
  transform: translateY(100%); transition: transform .32s var(--spring);
  max-height: 92vh; display: flex; flex-direction: column;
}
.sheet.show { transform: none; }
.sheet .grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 2px; flex: none; }
.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 4px; flex: none; }
.sheet .sheet-head h2 { margin: 0; font-size: 1.05rem; }
.sheet .sheet-body { overflow-y: auto; padding: 4px 16px calc(20px + var(--sat-b)); -webkit-overflow-scrolling: touch; }

/* bottom nav */
nav.tabs[hidden] { display: none; }
nav.tabs {
  position: fixed; bottom: calc(10px + var(--sat-b)); left: 12px; right: 12px; z-index: 30;
  max-width: 536px; margin: 0 auto;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg);
  display: flex; padding: 6px 8px;
}
nav.tabs button {
  flex: 1; background: none; border: none; color: var(--ink-3); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 5px;
  font-family: var(--font-display); font-size: .72rem; font-weight: 600; border-radius: 18px; min-height: 52px;
  transition: color .18s ease, background .18s ease, transform .12s var(--spring);
}
nav.tabs button:active { transform: scale(.92); }
nav.tabs button .ic { display: block; }
nav.tabs button[aria-current="page"] { color: var(--green); background: var(--green-soft); }
nav.tabs .fab {
  flex: none; width: 58px; height: 58px; margin: -26px 6px 0; border-radius: 50%;
  background: var(--grad-primary); color: var(--btn-ink); font-size: 1.8rem; font-weight: 400;
  box-shadow: 0 8px 22px rgba(46,107,79,.45); align-self: flex-start; justify-content: center; padding: 0; min-height: 58px;
  transition: transform .16s var(--spring), box-shadow .16s ease;
}
nav.tabs .fab:hover { filter: brightness(1.05); }
nav.tabs .fab:active { transform: scale(.86) rotate(90deg); box-shadow: 0 3px 10px rgba(46,107,79,.35); }

/* onboarding */
.ob-progress { height: 5px; background: var(--surface-2); border-radius: 3px; margin: 8px 0 22px; overflow: hidden; }
.ob-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--green-bright)); border-radius: 3px; transition: width .4s var(--spring); }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 15px 16px; margin-bottom: 9px; cursor: pointer; font-size: .98rem; min-height: 54px;
  transition: border-color .15s ease, background .15s ease, transform .12s var(--spring);
}
.opt:hover { border-color: var(--green); }
.opt:active { transform: scale(.985); }
.opt[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); font-weight: 650; }
.opt .desc { display: block; color: var(--ink-2); font-size: .82rem; font-weight: 400; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: none; background: none; padding: 10px; border-radius: 9px; font-weight: 650; color: var(--ink-2); cursor: pointer; min-height: 44px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.inline-inputs { display: flex; gap: 10px; }
.inline-inputs > div { flex: 1; }

/* stats + charts */
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow); }
.stat b { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em; display: block; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: .78rem; }
.chart-wrap { overflow-x: auto; }
.chart-dot { transition: opacity .3s ease; }
.range-chips { display: flex; gap: 6px; margin: 8px 0 4px; }
.range-chips .chip { padding: 6px 12px; min-height: 38px; font-size: .8rem; }

/* water */
.water-cups { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cup { position: relative; width: 30px; height: 38px; border-radius: 6px 6px 10px 10px; border: 2px solid var(--blue); background: transparent; overflow: hidden; }
.cup i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(to top, var(--blue), color-mix(in srgb, var(--blue) 70%, var(--blue-soft))); transition: height .55s cubic-bezier(.34, 1.56, .64, 1); }

/* toast */
#toast {
  position: fixed; bottom: calc(84px + var(--sat-b)); left: 50%; transform: translateX(-50%) translateY(20px) scale(.9);
  background: var(--ink); color: var(--bg); padding: 11px 20px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  opacity: 0; transition: all .3s var(--spring); z-index: 60; pointer-events: none; max-width: 88vw; text-align: center;
  box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

/* empty states */
.empty { text-align: center; padding: 28px 18px; color: var(--ink-2); }
.empty .big {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--green-soft); display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
}
.empty b { color: var(--ink); display: block; margin-bottom: 4px; }
.empty p { font-size: .88rem; margin: 0 0 14px; }

/* notices */
.notice { border-radius: var(--radius-sm); padding: 12px 14px; font-size: .88rem; margin: 10px 0; }
.notice.warn { background: var(--amber-soft); color: var(--warn-ink); }
.notice.err { background: var(--red-soft); color: var(--err-ink); }
.notice.ok { background: var(--green-soft); color: var(--ok-ink); }
.notice.info { background: var(--blue-soft); color: var(--info-ink); }

/* skeletons */
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--skel) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: skel 1.2s infinite linear; height: 52px; margin-bottom: 8px; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* nutrient table */
.nut-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.nut-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.nut-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.nut-table tr.subtle td { color: var(--ink-2); padding-left: 16px; font-weight: 400; }

/* settings list */
.setrow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  background: var(--surface); border: none; border-bottom: 1px solid var(--line);
  padding: 15px 6px; cursor: pointer; text-align: left; font-size: .95rem; min-height: 54px;
}
.setrow:hover { background: var(--surface-2); }
.setrow .v { color: var(--ink-2); font-size: .88rem; }

/* scanner */
#scan-video { width: 100%; border-radius: var(--radius); background: #111; aspect-ratio: 3/4; object-fit: cover; }

/* desktop niceties */
@media (min-width: 600px) {
  body { background: var(--page); }
  #app { background: color-mix(in srgb, var(--bg) 72%, transparent); min-height: 100vh; box-shadow: 0 0 60px rgba(0,0,0,.1); }
  nav.tabs { max-width: 536px; }
  .sheet { max-width: 560px; }
}
