:root {
  --bg: #f7f1e6;
  --bg-deep: #efe3cf;
  --surface: #fffdf8;
  --surface-soft: #fbf4e8;
  --surface-green: #edf5ee;
  --surface-red: #fbefec;
  --ink: #2f2119;
  --ink-soft: #5f5147;
  --muted: #806f61;
  --line: #e7dac6;
  --line-strong: #d7c5ab;
  --terracotta: #b8503d;
  --terracotta-dark: #913a2e;
  --turmeric: #d7962e;
  --turmeric-dark: #a86c17;
  --leaf: #477858;
  --leaf-dark: #315b41;
  --danger: #b5443b;
  --shadow-xs: 0 1px 2px rgba(60, 39, 24, 0.04);
  --shadow-sm: 0 8px 24px rgba(80, 50, 24, 0.07);
  --shadow-md: 0 18px 42px rgba(80, 50, 24, 0.12);
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 30px;
  --tap: 44px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% -10%, rgba(215, 150, 46, 0.12), transparent 30rem),
    radial-gradient(circle at 110% 10%, rgba(71, 120, 88, 0.10), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [data-action] { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), [data-action] { cursor: pointer; }
img, svg { display: block; }
svg { width: 1.15em; height: 1.15em; stroke-width: 2; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 {
  letter-spacing: -0.025em;
  line-height: 1.12;
}
h1 { font-size: clamp(1.55rem, 5vw, 2.15rem); }
h2 { font-size: clamp(1.25rem, 4vw, 1.6rem); }
h3 { font-size: 1.05rem; }
p { line-height: 1.55; }
a { color: inherit; }
small { line-height: 1.4; }

:focus-visible {
  outline: 3px solid rgba(215, 150, 46, 0.45);
  outline-offset: 2px;
}
::selection { background: rgba(215, 150, 46, 0.25); }

#app {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
}

.screen {
  min-height: 100vh;
  padding: 0 16px 36px;
}
.screen > :last-child { margin-bottom: 0; }
.subtle { color: var(--muted); font-size: 0.86rem; }
.eyebrow {
  color: var(--terracotta);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.tamil { font-family: "Noto Sans Tamil", "Latha", system-ui, sans-serif; }
.caution { color: var(--danger); }
.danger { color: var(--danger) !important; }

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 66px;
  margin: 0 -16px 14px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  background: linear-gradient(to bottom, rgba(247, 241, 230, 0.98) 72%, rgba(247, 241, 230, 0.88));
  backdrop-filter: blur(14px);
}
.topbar h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 1.14rem;
}
.topbar-spacer { width: 42px; }
.topbar-right { display: flex; justify-content: flex-end; }
.icon-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.92);
  display: inline-grid;
  place-items: center;
  box-shadow: var(--shadow-xs);
}
.icon-btn:hover { background: var(--surface-soft); border-color: var(--line-strong); }
.icon-btn.back { justify-self: start; }

/* Bottom navigation */
.bottomnav {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 760px);
  min-height: 68px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 253, 248, 0.96);
  border-top: 1px solid rgba(215, 197, 171, 0.9);
  box-shadow: 0 -10px 30px rgba(71, 47, 30, 0.08);
  backdrop-filter: blur(18px);
}
.bottomnav button {
  position: relative;
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
}
.bottomnav button svg { width: 21px; height: 21px; }
.bottomnav button.active {
  color: var(--terracotta-dark);
  background: #f9eee8;
}
.bottomnav button.active::before {
  content: "";
  position: absolute;
  top: 2px;
  width: 26px;
  height: 3px;
  border-radius: 999px;
  background: var(--terracotta);
}

/* Generic cards and section structure */
.card,
.form-card,
.notice-card,
.more-profile,
.preferences-card,
.recipe-card,
.manual-summary,
.grocery-hero,
.pantry-overview {
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card { padding: 18px; }
.form-card { padding: 20px; margin-top: 16px; }
.form-card.compact { padding: 16px; }
.form-card h3 { margin-bottom: 16px; }
.card-heading,
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-heading { margin-bottom: 14px; }
.section-title-row { margin: 22px 2px 12px; }
.section-title-row h2 { margin-top: 2px; }
.section-heading { margin: 12px 2px 18px; }
.section-heading h1,
.section-heading h2 { margin: 5px 0 8px; }
.section-heading p { color: var(--muted); }
.notice-card {
  padding: 15px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.notice-card + .notice-card { margin-top: 12px; }
.notice-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-soft);
  font-size: 1.1rem;
}
.notice-card strong { display: block; margin-bottom: 2px; }
.notice-card p { color: var(--muted); font-size: 0.86rem; }

/* Buttons */
.btn {
  min-height: var(--tap);
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--terracotta), #ca684e);
  border-color: var(--terracotta);
  box-shadow: 0 8px 18px rgba(184, 80, 61, 0.23);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--terracotta-dark), var(--terracotta)); }
.btn-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--surface-soft); }
.btn-ghost {
  color: var(--terracotta-dark);
  background: transparent;
  border-color: transparent;
  padding-inline: 8px;
}
.btn-danger {
  color: var(--danger);
  background: #fff8f6;
  border-color: #e8bcb5;
}
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; padding: 13px 20px; font-size: 0.94rem; }
.btn-sm { min-height: 36px; padding: 8px 12px; font-size: 0.76rem; }
.text-btn {
  border: 0;
  background: transparent;
  color: var(--terracotta-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

/* Form controls */
.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label:not(.toggle-row) {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
}
input[type="text"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  font-size: 0.92rem;
  box-shadow: inset 0 1px 2px rgba(74, 45, 25, 0.03);
}
textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #aa9b8f; }
input:focus, select:focus, textarea:focus {
  border-color: var(--turmeric);
  outline: 3px solid rgba(215, 150, 46, 0.13);
}
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 0.73rem; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 50px; }
.input-suffix span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.78rem;
  pointer-events: none;
}
.toggle-row {
  margin: 0;
  padding: 13px 0;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.toggle-row:last-of-type { border-bottom: 0; }
.toggle-row input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--leaf);
}
.toggle-row span { min-width: 0; }
.toggle-row strong { display: block; font-size: 0.88rem; }
.toggle-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.74rem; }
.switch {
  width: 45px;
  height: 26px;
  appearance: none;
  border-radius: 999px;
  background: #d8cdbd;
  position: relative;
  transition: background 150ms ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform 150ms ease;
}
.switch:checked { background: var(--leaf); }
.switch:checked::after { transform: translateX(19px); }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip,
.mode-chip {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}
.chip.selected,
.mode-chip.selected,
.mode-chip.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 5px 14px rgba(47,33,25,.16);
}

/* Onboarding */
.onboard-screen {
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 18px 40px;
  display: flex;
  flex-direction: column;
}
.progress-dots { display: flex; gap: 7px; margin-bottom: 28px; }
.progress-dots span {
  height: 5px;
  flex: 1;
  max-width: 70px;
  border-radius: 999px;
  background: var(--line);
}
.progress-dots span.done { background: linear-gradient(90deg, var(--turmeric), var(--terracotta)); }
.onboard-brand { display: flex; align-items: flex-start; gap: 16px; }
.brand-mark {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(145deg, #f4c365, #d4872d);
  box-shadow: 0 15px 30px rgba(180, 112, 33, 0.24);
  font-size: 2rem;
  transform: rotate(-3deg);
}
.onboard-brand h1 { margin-top: 6px; }
.onboard-intro { margin-top: 20px; color: var(--ink-soft); font-size: 0.96rem; }
.member-list { display: grid; gap: 9px; }
.member-card {
  min-height: 62px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
}
.avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, var(--leaf), #6a9476);
  font-weight: 900;
}
.avatar.large { width: 50px; height: 50px; flex-basis: 50px; border-radius: 17px; font-size: 1.2rem; }
.member-info { flex: 1; min-width: 0; }
.member-info strong, .member-info span { display: block; }
.member-info span { margin-top: 3px; color: var(--muted); font-size: 0.75rem; text-transform: capitalize; }
.success-state {
  margin: auto 0;
  padding: 30px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.success-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-green);
  color: var(--leaf);
  font-size: 2rem;
  font-weight: 900;
}
.success-state p { margin: 10px 0 22px; color: var(--muted); }
.success-stats {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.success-stats div { padding: 12px 6px; border-radius: 14px; background: var(--surface-soft); }
.success-stats strong, .success-stats span { display: block; }
.success-stats strong { font-size: 1rem; }
.success-stats span { margin-top: 3px; color: var(--muted); font-size: 0.68rem; }

/* Dashboard */
.dashboard-screen { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
.dashboard-hero {
  position: relative;
  overflow: hidden;
  margin: 0 -2px 20px;
  padding: 24px 22px 20px;
  color: #fffaf3;
  background:
    linear-gradient(135deg, rgba(42,31,23,.08), transparent),
    linear-gradient(135deg, #a74635, #ca6c4c 62%, #d89537);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(145, 58, 46, 0.23);
}
.dashboard-hero::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -80px;
  top: -75px;
  border-radius: 50%;
  border: 30px solid rgba(255,255,255,.08);
}
.hero-top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.hero-date { color: rgba(255,255,255,.78); font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.dashboard-hero h1 { margin: 5px 0 5px; max-width: 430px; }
.dashboard-hero p:last-child { color: rgba(255,255,255,.86); font-size: 0.87rem; }
.hero-bowl {
  position: relative;
  z-index: 1;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.2);
  font-size: 2rem;
  transform: rotate(4deg);
}
.hero-cta {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  min-height: 50px;
  width: 100%;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 17px;
  background: rgba(255,253,248,.94);
  color: var(--terracotta-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(63,30,20,.16);
}
.meal-slot-list { display: grid; gap: 10px; }
.meal-slot {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
}
.slot-main {
  width: 100%;
  min-height: 74px;
  padding: 12px 12px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 11px;
  text-align: left;
  border: 0;
  background: transparent;
}
.meal-slot.empty .slot-main { opacity: .82; }
.meal-emoji {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--surface-soft);
  font-size: 1.35rem;
}
.slot-copy { min-width: 0; }
.slot-copy > * { display: block; }
.slot-label { margin-bottom: 3px; color: var(--terracotta); font-size: 0.69rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.slot-copy strong { line-height: 1.35; font-size: .91rem; }
.slot-copy small { margin-top: 4px; color: var(--muted); font-size: .71rem; }
.slot-done {
  width: 100%;
  min-height: 36px;
  padding: 7px 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface-green);
  color: var(--leaf-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .74rem;
  font-weight: 900;
}
.use-soon { margin-top: 12px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.quick-card {
  min-height: 108px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
}
.quick-card > span { font-size: 1.3rem; }
.quick-card strong { display: block; margin-top: 8px; }
.quick-card small { display: block; margin-top: 3px; color: var(--muted); }

/* Recommendation screen */
.today-screen { max-width: 720px; margin: 0 auto; }
.date-switcher,
.week-switcher {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
}
.date-switcher > div, .week-label { text-align: center; }
.date-switcher strong, .date-switcher span, .week-label strong, .week-label span { display: block; }
.date-switcher span, .week-label span { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.mode-help { margin-bottom: 8px; color: var(--muted); font-size: .75rem; }
.mode-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 2px 16px 12px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.mode-scroll::-webkit-scrollbar { display: none; }
.mode-chip { display: inline-flex; align-items: center; gap: 5px; scroll-snap-align: start; }
.recommendation-heading {
  margin: 10px 2px 13px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.recommendation-heading p { color: var(--muted); font-size: .78rem; }
.recommendation-list { display: grid; gap: 14px; }
.rec-card {
  overflow: hidden;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 23px;
  box-shadow: var(--shadow-sm);
}
.rec-card:first-child { border-color: #d7c29a; box-shadow: 0 15px 34px rgba(105,65,26,.11); }
.rec-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.recommendation-label { display: inline-flex; align-items: center; gap: 5px; color: var(--terracotta); font-size: .72rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.rec-card h3 { margin-top: 6px; font-size: 1.15rem; }
.score-ring,
.progress-ring {
  --score: 0;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--leaf) calc(var(--score) * 1%), var(--surface-soft) 0);
  position: relative;
}
.score-ring::before,
.progress-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--surface);
}
.score-ring span,
.progress-ring span { position: relative; z-index: 1; font-size: .75rem; font-weight: 900; }
.rec-dishes { margin: 15px 0 12px; display: grid; gap: 7px; }
.rec-dish {
  padding: 10px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  background: var(--surface-soft);
}
.dish-emoji {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.76);
  font-size: 1.05rem;
}
.rec-dish strong { font-size: .87rem; }
.rec-dish small { color: var(--muted); font-size: .68rem; }
.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: var(--line-strong);
}
.dot.veg { background: var(--leaf); }
.dot.egg { background: var(--turmeric); }
.dot.chicken { background: var(--terracotta); }
.nutrition-strip {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.metric {
  min-width: 0;
  padding: 9px 5px;
  text-align: center;
  border-radius: 13px;
  background: #f7f1e6;
}
.metric strong, .metric span { display: block; }
.metric strong { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; }
.metric span { margin-top: 2px; color: var(--muted); font-size: .61rem; }
.estimate-note { margin-top: 6px; color: var(--muted); font-size: .67rem; text-align: right; }
.nutrition-unavailable { margin: 10px 0; padding: 10px; color: var(--muted); background: var(--surface-soft); border-radius: 12px; font-size: .75rem; }
.missing-box {
  margin-top: 10px;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border-radius: 13px;
  color: var(--danger);
  background: var(--surface-red);
  font-size: .76rem;
}
.why-details { margin-top: 11px; border-top: 1px solid var(--line); padding-top: 9px; }
.why-details summary { color: var(--ink-soft); font-size: .77rem; font-weight: 800; }
.why-details ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.rec-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.rec-actions .btn-primary { flex: 1; }
.manual-cta { margin-top: 16px; }
.suggestions { margin: 18px 2px 0; text-align: center; color: var(--muted); font-size: .76rem; }
.empty-state {
  padding: 30px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.empty-icon { margin: 0 auto 10px; font-size: 2rem; }
.empty-state h3 { margin-bottom: 7px; }
.empty-state p { color: var(--muted); font-size: .85rem; }
.empty-inline { padding: 14px; color: var(--muted); text-align: center; font-size: .8rem; }

/* Manual builder */
.manual-screen { max-width: 700px; margin: 0 auto; }
.manual-summary { padding: 16px; margin-bottom: 12px; }
.manual-summary h3 { margin-bottom: 10px; }
.selected-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.selected-chips .chip { background: var(--surface-soft); }
.mini-metrics { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .74rem; }
.search-field { position: relative; margin: 12px 0; }
.search-field input { padding-left: 41px; }
.search-field svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.list-count { margin: 8px 2px; color: var(--muted); font-size: .73rem; }
.manual-list { display: grid; gap: 8px; }
.manual-dish {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.manual-dish.selected { border-color: var(--leaf); background: var(--surface-green); }
.manual-copy strong, .manual-copy small { display: block; }
.manual-copy small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.select-circle {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--leaf);
}
.manual-dish.selected .select-circle { color: #fff; background: var(--leaf); border-color: var(--leaf); }

/* Planner */
.planner-screen { max-width: 900px; margin: 0 auto; }
.planner-toolbar { margin: 10px 0 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.planner-toolbar .btn-primary { flex: 1; }
.planner-tip { margin-bottom: 12px; color: var(--muted); font-size: .73rem; }
.planner-days { display: grid; gap: 12px; }
.planner-day {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-xs);
}
.planner-day > header {
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
.planner-day > header strong { font-size: .9rem; }
.planner-day > header span { color: var(--muted); font-size: .72rem; }
.planner-cell {
  min-height: 66px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}
.planner-cell:last-child { border-bottom: 0; }
.planner-cell.locked { background: #fff9eb; }
.planner-emoji { font-size: 1.2rem; text-align: center; }
.planner-main {
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 4px 0;
}
.planner-main strong, .planner-main small { display: block; }
.planner-main strong { font-size: .8rem; line-height: 1.35; }
.planner-main small { margin-top: 2px; color: var(--muted); font-size: .65rem; }
.planner-cell-actions { display: flex; align-items: center; gap: 4px; }
.planner-cell-actions .icon-btn { width: 34px; height: 34px; min-width: 34px; min-height: 34px; border: 0; background: transparent; box-shadow: none; }

/* Library */
.library-screen { max-width: 900px; margin: 0 auto; }
.library-stats {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.library-stats > div { padding: 12px 8px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.library-stats strong, .library-stats span { display: block; }
.library-stats strong { font-size: 1.05rem; }
.library-stats span { margin-top: 2px; color: var(--muted); font-size: .65rem; }
.category-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 2px 16px 10px;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.library-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; }
.library-list { display: grid; gap: 8px; }
.library-row {
  min-height: 72px;
  padding: 10px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
}
.library-row.inactive { opacity: .58; }
.library-main { min-width: 0; border: 0; padding: 0; background: transparent; text-align: left; }
.library-copy strong, .library-copy small { display: block; }
.library-copy strong { font-size: .87rem; }
.library-copy small { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.row-badges { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; }
.status {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: .6rem;
  font-weight: 900;
}
.status.ready { color: var(--leaf-dark); background: var(--surface-green); }
.status.missing { color: var(--danger); background: var(--surface-red); }
.status.custom { color: var(--turmeric-dark); background: #fff3dc; }
.fav-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #c9bba9;
  font-size: 1.25rem;
}
.fav-btn.active { color: var(--turmeric); background: #fff7e6; }

/* Dish details and recipe forms */
.dish-detail-screen, .form-screen { max-width: 720px; margin: 0 auto; }
.dish-hero {
  margin-bottom: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(145deg, var(--surface), #f9ead8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.dish-hero-icon {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(255,255,255,.8);
  font-size: 2rem;
  box-shadow: var(--shadow-xs);
}
.dish-hero-copy { min-width: 0; }
.dish-hero-copy h1 { font-size: 1.55rem; }
.dish-hero-copy .tamil { margin-top: 4px; color: var(--muted); }
.dish-meta { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.dish-meta span { padding: 4px 8px; color: var(--ink-soft); background: rgba(255,255,255,.75); border-radius: 999px; font-size: .66rem; font-weight: 700; }
.preferences-card, .recipe-card { padding: 17px; margin-top: 12px; }
.rating-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rating-row > span { color: var(--muted); font-size: .8rem; }
.rating-star { border: 0; background: transparent; color: #d7c8b7; font-size: 1.35rem; padding: 3px; }
.rating-star.active { color: var(--turmeric); }
.confidence { padding: 4px 8px; border-radius: 999px; color: var(--ink-soft); background: var(--surface-soft); font-size: .64rem; font-weight: 800; }
.servings-control { display: flex; align-items: center; gap: 7px; }
.servings-control input { width: 64px; min-height: 38px; text-align: center; }
.ingredient-list { margin: 0; padding: 0; list-style: none; }
.ingredient-list li { padding: 9px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); font-size: .82rem; }
.ingredient-list li:last-child { border-bottom: 0; }
.ingredient-list li span:last-child { color: var(--muted); text-align: right; }
.steps-title { margin: 17px 0 8px; }
.steps-list { margin: 0; padding-left: 24px; }
.steps-list li { padding: 5px 0 8px 4px; color: var(--ink-soft); font-size: .83rem; line-height: 1.5; }
.missing-recipe { padding: 24px 18px; text-align: center; }
.missing-recipe-icon { margin-bottom: 8px; font-size: 2rem; }
.missing-recipe p { margin: 7px 0 14px; color: var(--muted); font-size: .82rem; }
.dish-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.dish-actions .btn-primary { flex: 1; }
.form-screen .form-card { margin-top: 0; }

/* Pantry */
.pantry-screen { max-width: 820px; margin: 0 auto; }
.pantry-overview {
  margin-bottom: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.pantry-overview > div { text-align: center; }
.pantry-overview strong, .pantry-overview span { display: block; }
.pantry-overview strong { font-size: 1rem; }
.pantry-overview span { margin-top: 2px; color: var(--muted); font-size: .6rem; }
.pantry-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; }
.pantry-list { display: grid; gap: 8px; }
.pantry-row {
  min-height: 72px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.pantry-name strong, .pantry-name small { display: block; }
.pantry-name small { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.status-segment {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-soft);
}
.status-segment button {
  min-width: 33px;
  min-height: 33px;
  padding: 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
}
.status-segment button.selected.untracked { background: #e8dfd3; color: var(--ink-soft); }
.status-segment button.selected.available { background: #dcecdf; color: var(--leaf-dark); }
.status-segment button.selected.running_low { background: #fff0ce; color: var(--turmeric-dark); }
.status-segment button.selected.use_soon { background: #f8dfd8; color: var(--terracotta-dark); }
.status-segment button.selected.not_available { background: #eee6e1; color: var(--danger); }

/* Grocery */
.grocery-screen { max-width: 760px; margin: 0 auto; }
.grocery-hero {
  margin-bottom: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.grocery-hero .progress-ring { --score: 0; width: 60px; height: 60px; flex-basis: 60px; }
.grocery-hero > div:last-child { min-width: 0; }
.grocery-hero h2 { margin-bottom: 4px; }
.grocery-hero p { color: var(--muted); font-size: .78rem; }
.grocery-actions { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.inline-add { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 7px; margin: 12px 0; }
.inline-add input { min-height: 42px; }
.grocery-section { margin-top: 15px; }
.grocery-section > h3 { margin: 0 2px 7px; color: var(--ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
.grocery-items { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; }
.grocery-row {
  min-height: 52px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}
.grocery-row:last-child { border-bottom: 0; }
.grocery-row.checked .g-name { text-decoration: line-through; color: var(--muted); }
.custom-check { width: 21px; height: 21px; accent-color: var(--leaf); }
.g-name { min-width: 0; font-size: .83rem; }
.g-qty { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.grocery-row .icon-btn { min-width: 32px; min-height: 32px; width: 32px; height: 32px; border: 0; background: transparent; box-shadow: none; }

/* History and saved */
.history-screen { max-width: 720px; margin: 0 auto; }
.history-list, .saved-list { display: grid; gap: 8px; }
.history-row, .saved-row {
  min-height: 64px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.history-emoji {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-soft);
  font-size: 1.15rem;
}
.history-row > div { min-width: 0; }
.history-row strong, .history-row small, .saved-row strong, .saved-row small { display: block; }
.history-row strong, .saved-row strong { font-size: .84rem; line-height: 1.35; }
.history-row small, .saved-row small { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.saved-row { justify-content: space-between; }
.saved-row > div { display: flex; align-items: center; gap: 9px; }
.saved-row > div:first-child { min-width: 0; }
.saved-row > div:last-child { flex: 0 0 auto; }

/* Mom mode */
.mom-screen {
  min-height: 100vh;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 14px 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(215,150,46,.18), transparent 25rem),
    var(--bg-deep);
}
.mom-paper {
  width: min(100%, 600px);
  margin: 0 auto;
  padding: 28px 22px;
  background: #fffdf7;
  border: 1px solid #dac8aa;
  border-radius: 8px 28px 8px 28px;
  box-shadow: var(--shadow-md);
  position: relative;
}
.mom-paper::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(184,80,61,.25);
  border-radius: 5px 20px 5px 20px;
  pointer-events: none;
}
.mom-paper header { position: relative; text-align: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.mom-logo { width: 58px; height: 58px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%; background: #f6e2b9; font-size: 1.8rem; }
.mom-paper header p { color: var(--terracotta); font-size: .69rem; font-weight: 900; letter-spacing: .1em; }
.mom-paper header h1 { margin: 5px 0; font-family: Georgia, serif; font-size: 2rem; }
.mom-paper header > span { color: var(--muted); font-size: .78rem; }
.mom-meals { position: relative; padding: 16px 0; }
.mom-meal { padding: 13px 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: start; border-bottom: 1px solid #eee3d1; }
.mom-meal:last-child { border-bottom: 0; }
.mom-meal > span { font-size: 1.35rem; }
.mom-meal small, .mom-meal strong { display: block; }
.mom-meal small { color: var(--terracotta); font-size: .69rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.mom-meal strong { margin-top: 4px; font-family: Georgia, serif; font-size: 1.08rem; line-height: 1.45; }
.mom-paper footer { position: relative; padding-top: 15px; text-align: center; color: var(--muted); font-size: .72rem; border-top: 1px solid var(--line); }
.mom-controls { width: min(100%, 600px); margin: 14px auto 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* More + settings */
.more-screen, .settings-screen { max-width: 720px; margin: 0 auto; }
.more-profile { padding: 15px; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.more-profile strong, .more-profile span { display: block; }
.more-profile span { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.more-list { overflow: hidden; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 19px; }
.more-list > button {
  width: 100%;
  min-height: 68px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.more-list > button:last-child { border-bottom: 0; }
.more-emoji { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--surface-soft); font-size: 1.15rem; }
.more-list strong, .more-list small { display: block; }
.more-list strong { font-size: .86rem; }
.more-list small { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.settings-section { margin-top: 22px; }
.settings-rules .toggle-row:first-of-type { margin-top: 4px; }
.reset-btn { margin-top: 20px; }

/* Toast */
.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  color: #fff;
  background: rgba(47,33,25,.96);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  animation: toast-in 180ms ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 600px) {
  body { padding-bottom: 88px; }
  .screen { padding-inline: 22px; }
  .topbar { margin-inline: -22px; padding-inline: 22px; }
  .dashboard-screen { padding-top: 24px; }
  .dashboard-hero { padding: 30px; }
  .meal-slot-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meal-slot { display: flex; flex-direction: column; }
  .slot-main { flex: 1; }
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .recommendation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .recommendation-list .rec-card:first-child:last-child { grid-column: 1 / -1; }
  .rec-card { height: 100%; }
  .category-scroll, .mode-scroll { margin-inline: -22px; padding-inline: 22px; }
  .planner-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pantry-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 820px) {
  #app, .bottomnav { width: min(100%, 980px); }
  .bottomnav { max-width: 760px; left: 50%; bottom: 12px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-md); }
  .planner-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 410px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .nutrition-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-add { grid-template-columns: 1fr 80px; }
  .inline-add .btn { grid-column: 1 / -1; }
  .pantry-row { grid-template-columns: 1fr; }
  .status-segment { justify-self: stretch; grid-template-columns: repeat(5, 1fr); grid-auto-flow: row; }
  .mom-controls { flex-direction: column; align-items: stretch; }
  .mom-controls .chip-group { justify-content: center; }
  .grocery-row { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .grocery-row .icon-btn { grid-column: 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media print {
  @page { margin: 12mm; }
  body { padding: 0; background: #fff; }
  .bottomnav, .topbar, .mom-controls, .planner-toolbar, .planner-tip, .btn, .icon-btn { display: none !important; }
  #app, .screen, .mom-screen { width: 100%; max-width: none; padding: 0; }
  .planner-days { grid-template-columns: repeat(2, 1fr); }
  .planner-day, .mom-paper { box-shadow: none; break-inside: avoid; }
  .mom-paper { margin: 0 auto; }
}

/* Structure corrections for nested interactive rows */
.score-ring > span,
.progress-ring > span {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.score-ring > span strong { font-size: .88rem; }
.score-ring > span small { margin-top: 2px; color: var(--muted); font-size: .53rem; }
.progress-ring > span strong { font-size: .76rem; }

.rec-dish > div:nth-child(2) { min-width: 0; }
.rec-dish > div:nth-child(2) strong,
.rec-dish > div:nth-child(2) small { display: block; }
.rec-dish > div:nth-child(2) small { margin-top: 2px; }

.manual-cta {
  width: 100%;
  min-height: 68px;
  margin-top: 15px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
}
.manual-cta > span { min-width: 0; }
.manual-cta strong, .manual-cta small { display: block; }
.manual-cta small { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.selected-chips > span {
  min-height: 34px;
  padding: 7px 7px 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: .75rem;
  font-weight: 800;
}
.selected-chips > span button {
  width: 22px;
  height: 22px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #eadcc9;
  color: var(--ink-soft);
}

.planner-cell {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 9px;
}
.planner-main {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}
.planner-main > span:last-child { min-width: 0; }
.planner-main > span:last-child small,
.planner-main > span:last-child strong { display: block; }
.planner-main > span:last-child small {
  margin-bottom: 3px;
  color: var(--terracotta);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.planner-main > span:last-child strong { font-size: .82rem; line-height: 1.35; }
.planner-day > header > div strong,
.planner-day > header > div span { display: block; }
.planner-day > header > div span { margin-top: 2px; color: var(--terracotta); font-size: .63rem; font-weight: 800; }
.week-label {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: transparent;
}

.library-row { grid-template-columns: minmax(0, 1fr) auto; }
.library-main {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.dish-emoji.large { width: 44px; height: 44px; font-size: 1.25rem; }
.library-filters {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  color: var(--muted);
  font-size: .7rem;
}
.library-filters label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: .7rem;
}
.library-filters input { accent-color: var(--leaf); }
.library-filters > span { text-align: right; }

.pantry-name {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}
.pantry-name > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-soft);
}
.pantry-filters {
  display: flex;
  grid-template-columns: none;
  margin-inline: -16px;
}

.grocery-section > h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.grocery-section > h3 span {
  min-width: 22px;
  padding: 3px 7px;
  text-align: center;
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: .62rem;
}
.grocery-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}
.grocery-row > label {
  min-width: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.grocery-row > label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--leaf);
}
.grocery-row .custom-check { display: none; }
.grocery-row .g-name { font-weight: 750; line-height: 1.3; }
.grocery-row .g-qty { padding-left: 8px; }
.inline-add {
  grid-template-columns: minmax(0, 1fr) 74px;
}
.inline-add select { grid-column: 1; }
.inline-add .icon-btn { grid-column: 2; width: 46px; justify-self: end; }
.icon-btn.primary { color: #fff; background: var(--terracotta); border-color: var(--terracotta); }

.switch {
  width: 46px;
  height: 27px;
  position: relative;
  display: inline-block;
  flex: 0 0 46px;
}
.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8cdbd;
  transition: background 150ms ease;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform 150ms ease;
}
.switch input:checked + span { background: var(--leaf); }
.switch input:checked + span::after { transform: translateX(19px); }

.toast.leaving { opacity: 0; transform: translate(-50%, 8px); transition: opacity .25s ease, transform .25s ease; }

@media (min-width: 600px) {
  .inline-add { grid-template-columns: minmax(0, 1fr) 86px 100px 46px; }
  .inline-add select, .inline-add .icon-btn { grid-column: auto; }
}
.backup-card { display: grid; gap: 15px; }
.backup-card p:not(.eyebrow) { margin-top: 6px; color: var(--muted); font-size: .8rem; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.backup-actions .btn { flex: 1; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
