:root {
  color-scheme: light;
  --forest: #174c3c;
  --forest-deep: #10372c;
  --sage: #dce9df;
  --cream: #f5f1e8;
  --paper: #fffdf8;
  --ink: #1e2924;
  --muted: #6f7872;
  --line: #e3e3dc;
  --sun: #f2b84b;
  --sun-pale: #fff4d8;
  --danger: #a33d2d;
  --shadow: 0 18px 50px rgba(30, 56, 45, 0.1);
  --meal-drawer-width: min(390px, calc(100vw - 48px));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { width: 100%; min-height: 100%; overflow-x: hidden; }
body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: radial-gradient(circle at 0 0, rgba(242, 184, 75, 0.12), transparent 27rem), var(--cream);
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(242, 184, 75, 0.7); outline-offset: 2px; }
[hidden] { display: none !important; }

.auth-gate {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  display: grid;
  place-items: center;
}
.auth-card { width: min(430px, 100%); padding: clamp(26px, 7vw, 44px); border: 1px solid rgba(23, 76, 60, 0.12); border-radius: 28px; background: rgba(255, 253, 248, 0.94); box-shadow: var(--shadow); }
.auth-mark { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 17px; color: white; background: var(--forest); font-family: Georgia, serif; font-size: 30px; box-shadow: 0 12px 26px rgba(23, 76, 60, 0.2); }
.auth-card h1 { font-size: clamp(34px, 9vw, 46px); }
.auth-copy { margin: 17px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.auth-form { display: grid; gap: 8px; }
.auth-form label { margin-top: 6px; color: var(--forest); font-size: 11px; font-weight: 900; }
.auth-form input { width: 100%; min-height: 49px; padding: 0 14px; border: 1px solid rgba(23, 76, 60, 0.2); border-radius: 13px; color: var(--ink); background: white; font-size: 16px; }
.auth-form button { min-height: 50px; margin-top: 12px; border: 0; border-radius: 13px; color: white; background: var(--forest); font-weight: 900; }
.auth-form button:disabled { opacity: 0.55; cursor: wait; }
.auth-error { margin: 7px 0 0; color: var(--danger); font-size: 12px; line-height: 1.45; }
.auth-note { margin: 18px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.shell { width: 100%; min-height: 100vh; min-height: 100dvh; }
.topbar {
  height: 76px;
  padding: 0 clamp(18px, 4vw, 54px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(23, 76, 60, 0.12);
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.menu-button, .menu-close, .icon-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--forest);
  background: var(--paper);
}
.menu-button { width: 42px; height: 42px; padding: 11px 9px; border-radius: 13px; gap: 4px; }
.menu-button span { display: block; width: 19px; height: 2px; border-radius: 2px; background: currentColor; }
.brand { min-width: 0; color: inherit; text-decoration: none; display: flex; align-items: center; gap: 11px; }
.brand-mark, .avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 13px;
  color: white;
  background: var(--forest);
  font-family: Georgia, serif;
  font-size: 23px;
  box-shadow: 0 8px 20px rgba(23, 76, 60, 0.2);
}
.brand strong { display: block; font-family: Georgia, serif; font-size: 20px; letter-spacing: -0.02em; }
.brand small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.week-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); padding: 9px 13px; color: var(--forest); font-size: 12px; font-weight: 800; }
.pulse { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #54a875; box-shadow: 0 0 0 4px rgba(84, 168, 117, 0.14); }

.menu-overlay { position: fixed; inset: 0; z-index: 39; background: rgba(16, 32, 26, 0.42); backdrop-filter: blur(3px); }
.app-menu {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: min(360px, 90vw);
  max-width: 100%;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 190ms ease-out;
  background: var(--paper);
  box-shadow: 24px 0 60px rgba(16, 55, 44, 0.18);
}
body.menu-open { overflow: hidden; }
body.menu-open .app-menu { transform: translateX(0); }
.menu-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 6px 5px 23px; border-bottom: 1px solid var(--line); }
.menu-heading strong { font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.menu-close { width: 40px; height: 40px; border-radius: 50%; font-size: 27px; line-height: 1; }
.menu-links { display: grid; gap: 8px; margin-top: 22px; }
.menu-link {
  width: 100%;
  min-width: 0;
  min-height: 66px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 16px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.menu-link:hover, .menu-link.active { color: var(--forest); background: var(--sage); }
.menu-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--forest); background: white; font-size: 18px; font-weight: 900; }
.menu-link strong, .menu-link small { display: block; }
.menu-link strong { font-size: 14px; }
.menu-link small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.nav-count { display: grid; place-items: center; min-width: 27px; height: 27px; padding: 0 8px; border-radius: 99px; color: white; background: var(--forest); font-size: 11px; font-weight: 900; }
.nav-count.sun { color: #553b0b; background: var(--sun); }
.menu-footer { margin-top: auto; padding: 18px 8px 0; }
.menu-footnote { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.logout-button { width: 100%; min-height: 42px; margin-top: 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--forest); background: transparent; font-size: 11px; font-weight: 800; }
.logout-button:hover { background: var(--sage); }

.meal-drawer-backdrop { position: fixed; inset: 0; z-index: 34; background: rgba(16, 32, 26, 0.34); backdrop-filter: blur(2px); }
.meal-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 35;
  width: var(--meal-drawer-width);
  height: 100vh;
  height: 100dvh;
  padding: max(25px, env(safe-area-inset-top)) 22px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 210ms ease-out;
  background: var(--paper);
  box-shadow: -24px 0 60px rgba(16, 55, 44, 0.2);
}
body.meal-drawer-open { overflow: hidden; }
body.meal-drawer-open .meal-drawer { transform: translateX(0); }
.meal-drawer-tab {
  position: fixed;
  top: clamp(96px, 15vh, 145px);
  right: 0;
  z-index: 36;
  width: 46px;
  min-height: 138px;
  padding: 10px 7px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 16px 0 0 16px;
  color: white;
  background: var(--forest);
  box-shadow: -8px 10px 28px rgba(16, 55, 44, 0.2);
  transition: right 210ms ease-out, background 160ms ease;
}
.meal-drawer-tab:hover { background: var(--forest-deep); }
body.meal-drawer-open .meal-drawer-tab { right: var(--meal-drawer-width); }
.meal-drawer-chevron { font-size: 28px; font-weight: 300; line-height: 0.75; transition: transform 180ms ease; }
body.meal-drawer-open .meal-drawer-chevron { transform: rotate(180deg); }
.meal-drawer-tab-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; font-weight: 900; letter-spacing: 0.13em; text-transform: uppercase; }
.meal-drawer-tab-count { min-width: 24px; height: 24px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; color: #553b0b; background: var(--sun); font-size: 10px; font-weight: 900; }
.meal-drawer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.meal-drawer-heading h2 { font-size: 30px; }
.meal-drawer-close { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--forest); background: white; font-size: 27px; line-height: 1; }
.meal-drawer-summary { padding: 18px 0 13px; }
.meal-drawer-summary strong, .meal-drawer-summary span { display: block; }
.meal-drawer-summary strong { color: var(--forest); font-size: 14px; }
.meal-drawer-summary span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.drawer-meals { min-height: 0; flex: 1; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding-right: 3px; }
.drawer-meal { min-width: 0; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.drawer-meal:first-child { border-top: 0; }
.drawer-meal-day { padding-top: 2px; color: var(--forest); font-size: 10px; font-weight: 900; line-height: 1.4; text-transform: capitalize; overflow-wrap: anywhere; }
.drawer-meal-day small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 700; line-height: 1.3; text-transform: none; }
.drawer-meal > div { min-width: 0; }
.drawer-meal strong, .drawer-meal small { display: block; min-width: 0; overflow-wrap: anywhere; }
.drawer-meal strong { font-size: 14px; line-height: 1.35; }
.drawer-meal small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.meal-drawer-empty { padding: 42px 12px 20px; text-align: center; color: var(--muted); }
.meal-drawer-empty span { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: var(--sage); font-size: 19px; font-weight: 900; }
.meal-drawer-empty p { margin: 0; font-size: 12px; line-height: 1.55; }
.meal-drawer-action { width: 100%; min-height: 48px; margin-top: 17px; flex: 0 0 auto; border: 0; border-radius: 13px; color: white; background: var(--forest); font-size: 11px; font-weight: 900; }
.meal-drawer-action:hover { background: var(--forest-deep); }

.app-main { width: min(1080px, 100%); min-width: 0; margin: 0 auto; padding: clamp(28px, 5vw, 62px) clamp(18px, 5vw, 64px) 80px; }
.app-view { width: 100%; min-width: 0; }
.conversation-view { width: min(880px, 100%); margin: 0 auto; }
.conversation-heading, .page-heading { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.conversation-heading > div, .page-heading > div { min-width: 0; }
.eyebrow { margin: 0 0 7px; color: var(--forest); font-size: 10px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -0.035em; }
h1 { max-width: 760px; font-size: clamp(34px, 5vw, 54px); line-height: 1.03; overflow-wrap: anywhere; }
h2 { font-size: 24px; }
.icon-button { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; font-size: 21px; }
.page-intro { max-width: 650px; margin: 13px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.large-count { display: grid; place-items: center; min-width: 58px; height: 58px; padding: 0 15px; flex: 0 0 auto; border-radius: 18px; color: white; background: var(--forest); font-size: 19px; font-weight: 900; }
.large-count.sun { color: #553b0b; background: var(--sun); }

.quick-actions { max-width: 100%; display: flex; gap: 9px; flex-wrap: wrap; margin: 24px 0 18px; }
.quick-actions button, .text-button, .filter-button { border: 1px solid rgba(23, 76, 60, 0.18); color: var(--forest); background: rgba(255, 253, 248, 0.82); font-weight: 800; }
.quick-actions button { border-radius: 999px; padding: 9px 13px; font-size: 12px; transition: 160ms ease; }
.quick-actions button:hover { background: var(--sage); transform: translateY(-1px); }
.text-button { border-radius: 10px; padding: 8px 10px; font-size: 11px; }

.messages { width: 100%; min-width: 0; min-height: 280px; max-height: min(48vh, 520px); overflow-x: hidden; overflow-y: auto; padding: 8px 6px 22px 0; scroll-behavior: smooth; overscroll-behavior: contain; }
.message { min-width: 0; display: flex; align-items: flex-start; gap: 12px; margin: 14px 0; animation: rise 180ms ease-out; }
.message.user { justify-content: flex-end; }
.message.user .avatar { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; box-shadow: none; }
.bubble { min-width: 0; max-width: min(650px, 84%); padding: 13px 16px; border: 1px solid rgba(23, 76, 60, 0.1); border-radius: 6px 18px 18px 18px; background: var(--paper); box-shadow: 0 6px 20px rgba(30, 56, 45, 0.05); line-height: 1.55; overflow-wrap: anywhere; }
.message.user .bubble { color: white; background: var(--forest); border: 0; border-radius: 18px 6px 18px 18px; box-shadow: 0 8px 24px rgba(23, 76, 60, 0.18); }
.bubble p { margin: 0; white-space: pre-wrap; }
.message.pending .bubble p::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: var(--sun); animation: blink 900ms infinite; }
.message-feedback { display: flex; align-items: center; gap: 4px; margin: 8px 0 -5px; }
.message-feedback span { margin-right: 3px; color: var(--muted); font-size: 9px; }
.message-feedback button { width: 29px; height: 27px; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: transparent; font-size: 12px; }
.message-feedback button:hover, .message-feedback button.active { border-color: rgba(23, 76, 60, 0.35); color: var(--forest); background: var(--sage); }
.message-feedback button:disabled { opacity: 0.5; }

.work-status { width: fit-content; max-width: 100%; margin: 0 0 9px; padding: 9px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid rgba(23, 76, 60, 0.14); border-radius: 13px; color: var(--forest); background: rgba(220, 233, 223, 0.74); }
.work-status > span:last-child { min-width: 0; }
.work-status strong, .work-status small { display: block; }
.work-status strong { font-size: 11px; }
.work-status small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.work-spinner { width: 16px; height: 16px; flex: 0 0 auto; border: 2px solid rgba(23, 76, 60, 0.18); border-top-color: var(--forest); border-radius: 50%; animation: work-spin 700ms linear infinite; }
.composer { width: 100%; min-width: 0; display: flex; align-items: flex-end; gap: 9px; padding: 9px; border: 1px solid rgba(23, 76, 60, 0.18); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.composer:focus-within { border-color: rgba(23, 76, 60, 0.5); box-shadow: 0 18px 55px rgba(30, 56, 45, 0.15); }
.composer textarea { width: 100%; min-width: 0; min-height: 46px; max-height: 150px; padding: 11px 9px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; line-height: 1.45; }
.composer textarea::placeholder { color: #929a95; }
.send-button { min-width: 45px; min-height: 45px; padding: 0 15px; display: flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto; border: 0; border-radius: 13px; color: white; background: var(--forest); font-weight: 800; }
.send-button:disabled { opacity: 0.5; cursor: wait; }
.composer-hint { margin: 8px 4px 0; color: var(--muted); font-size: 10px; }
.voice-button { width: 46px; height: 46px; flex: 0 0 auto; border: 1px solid rgba(23, 76, 60, 0.16); border-radius: 13px; color: var(--forest); background: var(--sage); font-size: 13px; }
.voice-button::after { content: ""; display: block; width: 8px; height: 13px; margin: -10px auto 0; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 8px 8px; }
.voice-button[aria-pressed="true"] { color: white; background: var(--forest); box-shadow: 0 0 0 5px rgba(23, 76, 60, 0.12); }
.voice-panel { margin: 0 0 9px; min-height: 62px; padding: 8px 11px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid rgba(23, 76, 60, 0.14); border-radius: 15px; background: var(--forest); color: white; box-shadow: 0 8px 22px rgba(23, 76, 60, 0.14); }
.voice-orb { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 50%; color: var(--forest); background: var(--sun); }
.voice-orb span { width: 3px; height: 10px; border-radius: 99px; background: currentColor; animation: voice-wave 850ms ease-in-out infinite; }
.voice-orb span:nth-child(2) { height: 19px; animation-delay: -180ms; }
.voice-orb span:nth-child(3) { animation-delay: -360ms; }
.voice-panel.thinking .voice-orb span { animation-duration: 420ms; }
.voice-panel.speaking .voice-orb { color: white; background: #54a875; }
.voice-copy { min-width: 0; }
.voice-copy strong, .voice-copy span { display: block; }
.voice-copy strong { font-size: 13px; }
.voice-copy span { margin-top: 3px; color: rgba(255, 255, 255, 0.67); font-size: 10px; overflow-wrap: anywhere; }
.voice-stop { min-height: 39px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 11px; color: white; background: transparent; font-size: 11px; font-weight: 800; }
.voice-stop:hover { background: rgba(255, 255, 255, 0.1); }
.realtime-audio { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.store-heading { align-items: center; }
.store-toolbar { margin-top: 31px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.store-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.store-progress-copy strong, .store-progress-copy span { display: block; }
.store-progress-copy strong { color: var(--forest); font-size: 14px; }
.store-progress-copy span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.filter-button { min-height: 42px; border-radius: 12px; padding: 0 14px; font-size: 11px; }
.filter-button[aria-pressed="true"] { color: white; background: var(--forest); }
.shopping-finish { min-height: 42px; padding: 0 14px; border: 0; border-radius: 12px; color: white; background: var(--forest); font-size: 11px; font-weight: 900; }
.shopping-finish:disabled { opacity: 0.55; cursor: wait; }
.progress-track { height: 5px; margin: 18px 0 10px; overflow: hidden; border-radius: 99px; background: var(--sage); }
.progress-track span { display: block; width: 0; height: 100%; background: var(--forest); transition: width 240ms ease; }
.store-progress { height: 8px; margin: 19px 0 25px; background: rgba(23, 76, 60, 0.11); }
.store-list { display: grid; gap: 18px; }
.store-category { padding: 17px 20px 7px; border: 1px solid rgba(23, 76, 60, 0.1); border-radius: 22px; background: rgba(255, 253, 248, 0.9); box-shadow: 0 10px 30px rgba(30, 56, 45, 0.05); }
.category-title { margin: 0; padding: 0 0 10px; color: var(--forest); font-size: 11px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.shopping-item { min-width: 0; display: flex; align-items: center; gap: 13px; min-height: 63px; padding: 9px 2px; border-top: 1px solid var(--line); }
.shopping-item input { appearance: none; width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; margin: 0; border: 2px solid #9caca3; border-radius: 10px; background: white; }
.shopping-item input:checked { border-color: var(--forest); background: var(--forest); }
.shopping-item input:checked::after { content: "✓"; color: white; font-size: 17px; font-weight: 900; }
.shopping-item input:disabled { cursor: default; }
.shopping-item label { min-width: 0; flex: 1; font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.shopping-item label small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.35; }
.shopping-item.checked { opacity: 0.5; }
.shopping-item.checked label { text-decoration: line-through; }
.hide-checked .shopping-item.checked { display: none; }
.quantity { flex: 0 0 auto; color: var(--forest); font-size: 13px; font-weight: 900; }

.shopping-complete-card { margin: 0 0 22px; padding: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; border-radius: 20px; color: white; background: var(--forest); box-shadow: 0 14px 34px rgba(23, 76, 60, 0.2); }
.shopping-complete-mark, .shopping-completion-mark { display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: var(--sun); font-weight: 900; }
.shopping-complete-mark { width: 46px; height: 46px; font-size: 22px; }
.shopping-complete-card .eyebrow { color: #b9d7c7; }
.shopping-complete-card h2 { color: white; font-size: 23px; }
.shopping-complete-card p { margin: 5px 0 0; color: rgba(255, 255, 255, 0.76); font-size: 11px; line-height: 1.45; }
.shopping-complete-actions { display: flex; gap: 7px; }
.shopping-complete-actions button { min-height: 39px; padding: 0 11px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 10px; color: white; background: transparent; font-size: 9px; font-weight: 900; }
.shopping-complete-actions button:hover { background: rgba(255, 255, 255, 0.1); }

.shopping-completion-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.shopping-completion-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(16, 55, 44, 0.54); backdrop-filter: blur(5px); }
.shopping-completion-sheet { position: relative; width: min(460px, 100%); padding: 29px; border-radius: 26px; background: var(--paper); box-shadow: 0 28px 80px rgba(16, 55, 44, 0.3); animation: rise 180ms ease both; }
.shopping-completion-mark { width: 54px; height: 54px; margin-bottom: 19px; font-size: 25px; }
.shopping-completion-sheet h2 { font-size: 30px; }
.shopping-completion-sheet > p:not(.eyebrow) { margin: 13px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.shopping-completion-actions { margin-top: 24px; display: grid; grid-template-columns: 1fr 1.25fr; gap: 9px; }
.shopping-completion-actions button { min-height: 48px; border-radius: 13px; font-size: 11px; font-weight: 900; }
.completion-secondary { border: 1px solid rgba(23, 76, 60, 0.18); color: var(--forest); background: white; }
.completion-primary { border: 0; color: white; background: var(--forest); }
.shopping-completion-actions button:disabled { opacity: 0.55; cursor: wait; }
body.shopping-completion-open { overflow: hidden; }

.recipes-count { color: var(--forest); background: var(--sun); }
.recipes-view { width: min(920px, 100%); margin: 0 auto; }
.recipes-heading { align-items: center; }
.recipes-toolbar { margin: 27px 0 20px; padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-radius: 18px; color: var(--forest); background: var(--sage); }
.recipes-toolbar strong, .recipes-toolbar span { display: block; }
.recipes-toolbar strong { font-size: 13px; }
.recipes-toolbar span { max-width: 520px; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.recipes-toolbar-actions, .recipe-actions { display: flex; gap: 8px; }
.primary-action, .secondary-action, .recipe-actions button { min-height: 41px; padding: 0 12px; border-radius: 11px; font-size: 10px; font-weight: 900; }
.primary-action, .confirm-recipe { border: 0; color: white; background: var(--forest); }
.secondary-action, .recipe-actions button:not(.confirm-recipe) { border: 1px solid rgba(23, 76, 60, 0.18); color: var(--forest); background: rgba(255, 255, 255, 0.72); }
.primary-action:disabled, .secondary-action:disabled, .recipe-actions button:disabled { opacity: 0.5; cursor: wait; }
.recipes-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.recipe-card { min-width: 0; padding: 20px; border: 1px solid rgba(23, 76, 60, 0.11); border-radius: 22px; background: rgba(255, 253, 248, 0.92); box-shadow: 0 10px 30px rgba(30, 56, 45, 0.05); }
.recipe-card.draft { border-color: rgba(242, 184, 75, 0.62); }
.recipe-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.recipe-card h2 { font-size: 23px; overflow-wrap: anywhere; }
.recipe-status { flex: 0 0 auto; padding: 6px 9px; border-radius: 99px; font-size: 9px; font-weight: 900; }
.recipe-status.confirmed { color: var(--forest); background: var(--sage); }
.recipe-status.draft { color: #604814; background: var(--sun-pale); }
.recipe-servings { margin: 10px 0 0; color: var(--muted); font-size: 10px; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.recipe-tags span { padding: 4px 7px; border-radius: 99px; color: var(--forest); background: var(--sage); font-size: 8px; font-weight: 800; }
.recipe-ingredients { display: grid; gap: 0; margin: 15px 0 0; padding: 0; list-style: none; }
.recipe-ingredients li { min-width: 0; padding: 8px 0; display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); font-size: 11px; }
.recipe-ingredients li span { min-width: 0; overflow-wrap: anywhere; }
.recipe-ingredients li strong { flex: 0 0 auto; color: var(--forest); }
.recipe-notes { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.recipe-actions { margin-top: 15px; justify-content: flex-end; }

.pantry-legend { margin: 27px 0 19px; display: flex; flex-wrap: wrap; gap: 9px 18px; color: var(--muted); font-size: 11px; }
.pantry-legend span { display: flex; align-items: center; gap: 6px; }
.stock-dot { width: 9px; height: 9px; border-radius: 50%; }
.stock-dot.enough { background: #54a875; }
.stock-dot.low { background: var(--sun); }
.stock-dot.out { background: #c55d4b; }
.pantry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.pantry-item { min-width: 0; padding: 18px; border: 1px solid rgba(23, 76, 60, 0.11); border-radius: 21px; background: rgba(255, 253, 248, 0.9); box-shadow: 0 10px 28px rgba(30, 56, 45, 0.05); }
.pantry-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pantry-item strong { min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.pantry-meta { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.stock-status { width: 12px; height: 12px; flex: 0 0 auto; margin-top: 3px; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 1px rgba(23, 76, 60, 0.14); }
.stock-status.enough { background: #54a875; }
.stock-status.low { background: var(--sun); }
.stock-status.out { background: #c55d4b; }
.stock-status.unknown { background: #b8bdb9; }
.stock-actions { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.stock-action { min-width: 0; min-height: 42px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 11px; color: var(--forest); background: white; font-size: 11px; font-weight: 800; }
.stock-action:hover, .stock-action.active { border-color: var(--forest); color: white; background: var(--forest); }
.stock-action:disabled { opacity: 0.5; cursor: wait; }

.knowledge-view { width: min(900px, 100%); margin: 0 auto; }
.knowledge-view .page-heading { margin-bottom: 28px; }
.knowledge-view { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 17px; }
.knowledge-view.active { display: grid; }
.knowledge-view .page-heading { grid-column: 1 / -1; }
.panel-card { min-width: 0; padding: 22px; border: 1px solid rgba(23, 76, 60, 0.11); border-radius: 24px; background: rgba(255, 253, 248, 0.9); box-shadow: 0 12px 35px rgba(30, 56, 45, 0.06); }
.panel-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.count-badge { display: grid; place-items: center; min-width: 29px; height: 29px; padding: 0 9px; flex: 0 0 auto; border-radius: 999px; color: #553b0b; background: var(--sun); font-size: 12px; font-weight: 900; }
.onboarding-card { color: white; background: var(--forest); border-color: transparent; box-shadow: 0 20px 45px rgba(23, 76, 60, 0.2); }
.onboarding-card .eyebrow { color: #b9d7c7; }
.onboarding-card h2 { color: white; }
.onboarding-percent { min-width: 48px; color: var(--forest-deep); }
.onboarding-copy { margin: 14px 0 15px; color: rgba(255, 255, 255, 0.74); font-size: 12px; line-height: 1.5; }
.onboarding-progress { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.16); }
.onboarding-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--sun); transition: width 240ms ease; }
.onboarding-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin: 15px 0 18px; padding: 0; list-style: none; }
.onboarding-steps li { min-width: 0; color: rgba(255, 255, 255, 0.48); font-size: 8px; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.onboarding-steps li span { display: grid; place-items: center; width: 20px; height: 20px; margin: 0 auto 5px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 50%; color: var(--forest-deep); font-size: 10px; }
.onboarding-steps li.current { color: white; }
.onboarding-steps li.current span { border-color: var(--sun); box-shadow: 0 0 0 4px rgba(242, 184, 75, 0.14); }
.onboarding-steps li.complete { color: rgba(255, 255, 255, 0.78); }
.onboarding-steps li.complete span { border-color: var(--sun); background: var(--sun); }
.primary-panel-button, .secondary-panel-button { width: 100%; min-height: 44px; border-radius: 12px; padding: 0 14px; font-weight: 800; }
.primary-panel-button { border: 0; color: var(--forest-deep); background: var(--sun); }
.secondary-panel-button { margin-top: 16px; border: 1px solid rgba(23, 76, 60, 0.16); color: var(--forest); background: transparent; }
.primary-panel-button:hover { background: #f7c96f; }
.secondary-panel-button:hover { background: var(--sage); }
.knowledge-summary { margin-top: 15px; }
.knowledge-section { padding: 12px 0; border-top: 1px solid var(--line); }
.knowledge-section:first-child { padding-top: 0; border-top: 0; }
.knowledge-section h3 { margin: 0 0 7px; color: var(--forest); font-size: 10px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.knowledge-section ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.knowledge-section li { position: relative; padding-left: 13px; color: #4f5a54; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.knowledge-section li::before { content: ""; position: absolute; top: 0.55em; left: 1px; width: 4px; height: 4px; border-radius: 50%; background: var(--sun); }

.nutrition-count { min-width: 40px; background: #cfe2d6; color: var(--forest); }
.nutrition-view { width: min(900px, 100%); margin: 0 auto; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 17px; }
.nutrition-view.active { display: grid; }
.nutrition-view .page-heading, .nutrition-safety { grid-column: 1 / -1; }
.nutrition-view .page-heading { margin-bottom: 11px; }
.nutrition-onboarding-card { color: white; background: var(--forest); border-color: transparent; box-shadow: 0 20px 45px rgba(23, 76, 60, 0.2); }
.nutrition-onboarding-card .eyebrow { color: #b9d7c7; }
.nutrition-onboarding-card h2 { color: white; }
.nutrition-copy { color: rgba(255, 255, 255, 0.74); }
.nutrition-progress span { background: var(--sun); }
.nutrition-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nutrition-profiles { display: grid; gap: 10px; margin-top: 15px; }
.nutrition-profile { padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.nutrition-profile-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nutrition-profile-heading strong { font-size: 14px; }
.nutrition-profile-heading span { border-radius: 99px; padding: 4px 8px; color: var(--forest); background: var(--sage); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.nutrition-profile ul { display: grid; gap: 4px; margin: 9px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 11px; line-height: 1.4; }
.nutrition-profile.empty { background: rgba(220, 233, 223, 0.35); }
.nutrition-safety { padding: 16px 18px; border-radius: 17px; color: #604814; background: var(--sun-pale); }
.nutrition-safety strong { font-size: 12px; }
.nutrition-safety p { margin: 5px 0 0; font-size: 11px; line-height: 1.5; }

.empty-state { padding: 34px 10px 20px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty-state span { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 11px; border-radius: 50%; color: var(--forest); background: var(--sage); font-weight: 900; }
.muted { color: var(--muted); font-size: 12px; }
.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; }

@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
@keyframes blink { 50% { opacity: 0.25; transform: scale(0.8); } }
@keyframes voice-wave { 0%, 100% { transform: scaleY(0.55); } 50% { transform: scaleY(1.25); } }
@keyframes work-spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .topbar { height: 64px; padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right)); gap: 9px; }
  .menu-button { width: 40px; height: 40px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 20px; }
  .brand strong { font-size: 18px; }
  .brand small { display: none; }
  .week-pill { min-width: 17px; padding: 8px; border: 0; background: transparent; }
  .week-pill #week-label { display: none; }
  .app-main { padding: 22px 14px calc(92px + env(safe-area-inset-bottom)); }
  h1 { font-size: 36px; }
  .conversation-heading, .page-heading { gap: 14px; }
  .large-count { min-width: 50px; height: 50px; border-radius: 16px; font-size: 17px; }
  .page-intro { font-size: 13px; }
  .quick-actions { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 3px; scrollbar-width: none; }
  .quick-actions::-webkit-scrollbar { display: none; }
  .quick-actions button { flex: 0 0 auto; }
  .meal-drawer { padding-right: 17px; padding-left: 17px; }
  .meal-drawer-tab { top: 82px; width: 42px; min-height: 130px; border-radius: 14px 0 0 14px; }
  .drawer-meal { grid-template-columns: 64px minmax(0, 1fr); }
  .messages { min-height: 245px; max-height: none; padding-right: 1px; }
  .bubble { max-width: 88%; padding: 12px 14px; }
  .composer { position: sticky; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 12; border-radius: 18px; scroll-margin-bottom: 100px; }
  .composer textarea { font-size: 16px; }
  .composer-hint { display: none; }
  .send-button { width: 46px; padding: 0; }
  .send-button span:first-child { display: none; }
  .store-toolbar { margin-top: 25px; align-items: flex-start; flex-direction: column; gap: 13px; }
  .store-toolbar-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .filter-button, .shopping-finish { width: 100%; min-height: 45px; font-size: 12px; }
  .shopping-complete-card { grid-template-columns: auto minmax(0, 1fr); padding: 17px; }
  .shopping-complete-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .shopping-complete-actions button { min-height: 43px; }
  .shopping-completion-layer { place-items: end center; padding: 0; }
  .shopping-completion-sheet { width: 100%; padding: 26px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; }
  .store-category { padding: 15px 14px 5px; border-radius: 18px; }
  .shopping-item { min-height: 66px; gap: 11px; }
  .shopping-item label { font-size: 16px; }
  .quantity { font-size: 12px; }
  .pantry-grid { grid-template-columns: 1fr; }
  .recipes-toolbar { align-items: stretch; flex-direction: column; }
  .recipes-toolbar-actions { display: grid; grid-template-columns: 1fr; }
  .primary-action, .secondary-action { min-height: 46px; font-size: 11px; }
  .recipes-list { grid-template-columns: 1fr; }
  .recipe-card { padding: 17px; border-radius: 19px; }
  .recipe-actions { display: grid; grid-template-columns: 1fr; }
  .recipe-actions button { min-height: 45px; font-size: 11px; }
  .pantry-item { padding: 16px; border-radius: 18px; }
  .stock-action { min-height: 45px; font-size: 12px; }
  .knowledge-view.active { display: flex; flex-direction: column; gap: 16px; }
  .knowledge-view .page-heading { margin-bottom: 10px; }
  .panel-card { padding: 19px; border-radius: 20px; }
  .voice-panel { position: static; grid-template-columns: 40px minmax(0, 1fr) auto; padding: 8px 9px; }
  .voice-orb { width: 42px; height: 42px; }
  .nutrition-view.active { display: flex; flex-direction: column; gap: 16px; }
  .nutrition-view .page-heading { margin-bottom: 10px; }
}

@media (max-width: 370px) {
  .app-main { padding-left: 10px; padding-right: 10px; }
  h1 { font-size: 32px; }
  .brand-mark { display: none; }
  .bubble { max-width: 91%; }
  .quantity { max-width: 60px; text-align: right; overflow-wrap: anywhere; }
}

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