:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --ink: #16231d;
  --muted: #647067;
  --line: #d8d6ce;
  --panel: #fffdf8;
  --green: #1f7a5a;
  --green-soft: #e5f1ea;
  --red: #b42318;
  --amber: #c77725;
  --blue: #2f5f98;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.landing-page {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.95) 0%, rgba(255, 253, 248, 0.9) 58%, rgba(245, 241, 232, 1) 100%),
    url("/assets/mealfit-recipe-grid.png");
  background-attachment: scroll;
  background-position: center top;
  background-size: cover;
  height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

.landing-nav {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto;
  min-height: 88px;
  padding: 26px 32px;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 20;
}

.landing-nav::before {
  backdrop-filter: blur(16px);
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(216, 214, 206, 0.78);
  border-radius: 8px;
  content: "";
  inset: 10px 16px 14px;
  position: absolute;
  z-index: -1;
}

.brand-mark {
  color: var(--ink);
  display: inline-grid;
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.brand-mark strong {
  color: var(--green);
  font-size: 12px;
  margin-top: 3px;
  text-transform: uppercase;
}

.landing-nav-actions {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.landing-nav-actions a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.landing-language-select {
  background: rgba(255, 253, 248, 0.78);
  border-color: rgba(31, 122, 90, 0.28);
  min-height: 39px;
  min-width: 74px;
  padding: 0 10px;
}

.landing-hero {
  align-items: center;
  display: grid;
  gap: clamp(32px, 5vw, 92px);
  grid-template-columns: minmax(480px, 0.92fr) minmax(380px, 0.72fr);
  margin: 0 auto;
  min-height: calc(100svh - 86px);
  padding: clamp(24px, 4vh, 44px) 24px clamp(46px, 7vh, 86px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  width: min(100% - 32px, 1500px);
}

.hero-copy {
  order: 1;
}

.hero-copy h1 {
  color: #101913;
  font-size: clamp(44px, 5.8vw, 86px);
  font-weight: 800;
  line-height: 1.02;
  margin-bottom: 22px;
  max-width: 820px;
}

.hero-copy p:not(.eyebrow) {
  color: #405048;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.55;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 22px;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 680px;
}

.hero-proof span {
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid rgba(216, 214, 206, 0.9);
  border-radius: 8px;
  color: #38443d;
  font-size: 13px;
  font-weight: 900;
  padding: 9px 10px;
}

.hero-media {
  min-height: 540px;
  order: 2;
  position: relative;
}

.hero-media > img {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(22, 35, 29, 0.24);
  height: 390px;
  object-fit: cover;
  position: absolute;
  right: 0;
  top: 24px;
  transform: rotate(3deg);
  width: min(470px, 100%);
}

.phone-preview {
  background: #101913;
  border: 8px solid #26332c;
  border-radius: 32px;
  bottom: 22px;
  box-shadow: 0 32px 90px rgba(22, 35, 29, 0.34);
  color: #fffdf8;
  display: grid;
  gap: 12px;
  padding: 18px;
  position: absolute;
  right: min(160px, 22vw);
  width: 260px;
}

.phone-bar {
  background: #fffdf8;
  border-radius: 999px;
  height: 5px;
  justify-self: center;
  opacity: 0.8;
  width: 70px;
}

.phone-card {
  background: #fffdf8;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 5px;
  padding: 14px;
}

.phone-card span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.phone-card small,
.macro-strip {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.phone-card.accent {
  background: #fff4dc;
}

.macro-strip {
  background: #e5f1ea;
  border-radius: 8px;
  color: var(--green);
  display: flex;
  justify-content: space-between;
  padding: 12px;
}

.landing-band,
.landing-showcase,
.landing-final {
  background: #16231d;
  box-shadow: 0 0 0 100vmax #16231d;
  clip-path: inset(0 -100vmax);
  margin: 0 auto;
  min-height: 100svh;
  padding: clamp(72px, 11vh, 124px) 24px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  width: min(100% - 32px, 1500px);
}

.landing-band {
  align-content: center;
  color: #fffdf8;
  display: grid;
}

.landing-band .eyebrow,
.landing-showcase .eyebrow {
  color: #9dd8ba;
}

.landing-band h2,
.landing-showcase h2,
.landing-final h2 {
  font-size: clamp(34px, 4.8vw, 72px);
  line-height: 1;
  max-width: 1020px;
}

.landing-band h2 {
  max-width: 100%;
}

.headline-line {
  display: block;
}

.feature-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(38px, 6vh, 72px);
}

.feature-grid article,
.recipe-stack article {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--ink);
  padding: 20px;
}

.feature-grid span {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.feature-grid p,
.landing-showcase p,
.landing-final p,
.recipe-stack span {
  color: #c6d0c9;
  line-height: 1.55;
}

.feature-grid article p {
  color: var(--muted);
  margin-bottom: 0;
}

.landing-showcase {
  align-items: center;
  color: #fffdf8;
  display: grid;
  gap: clamp(36px, 6vw, 86px);
  grid-template-columns: minmax(0, 0.82fr) minmax(360px, 0.9fr);
}

.landing-showcase p,
.landing-final p {
  max-width: 650px;
}

.recipe-stack {
  display: grid;
  gap: 18px;
  justify-self: stretch;
  max-width: 680px;
}

.recipe-stack article {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 112px 1fr;
  min-height: 118px;
}

.recipe-stack article:nth-child(2) {
  transform: none;
}

.recipe-stack article:nth-child(3) {
  transform: none;
}

.recipe-stack img {
  aspect-ratio: 1;
  border-radius: 8px;
  height: 92px;
  object-fit: cover;
  width: 92px;
}

.recipe-stack span {
  color: var(--muted);
  display: block;
  margin-top: 5px;
}

.landing-final {
  align-content: center;
  color: #fffdf8;
  display: grid;
}

.landing-final p {
  color: #c6d0c9;
  font-size: 18px;
  max-width: min(100%, 1120px);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.landing-hero .reveal {
  animation: heroEnter 620ms ease both;
  opacity: 1;
  transform: none;
}

.landing-hero .hero-media {
  animation-delay: 120ms;
}

@keyframes heroEnter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-page {
    background-attachment: scroll;
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.app-shell {
  margin: 0 auto;
  max-width: 1180px;
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 8px 0 24px;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.top-link {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.legal-page {
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 920px;
  padding: 28px;
}

.language-select {
  min-height: 44px;
  width: 76px;
}

.eyebrow {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(28px, 5vw, 56px);
  letter-spacing: 0;
  line-height: 1.02;
  margin-bottom: 0;
  max-width: 850px;
}

h2 {
  font-size: 22px;
  letter-spacing: 0;
  margin-bottom: 12px;
}

h3 {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.auth-grid {
  align-items: stretch;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 390px;
}

#verifyForm {
  grid-column: 2;
}

#resetForm {
  grid-column: 2;
}

.auth-copy {
  align-content: end;
  border-top: 1px solid var(--line);
  min-height: 430px;
  padding-top: 24px;
}

.auth-copy h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.06;
  max-width: 640px;
}

.auth-copy p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
  max-width: 620px;
}

.notice {
  background: #fff8df;
  border: 1px solid #ead99c;
  border-radius: 8px;
  color: #61460f;
  padding: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

label {
  color: #38443d;
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  padding: 0 12px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.15);
}

input,
select {
  min-height: 44px;
}

textarea {
  line-height: 1.45;
  min-height: 110px;
  padding-bottom: 10px;
  padding-top: 10px;
  resize: vertical;
}

.segmented,
.tabs {
  background: #ebe8dd;
  border-radius: 8px;
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
}

.segmented button,
.tabs button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  flex: 1;
  font-weight: 800;
  min-height: 38px;
  padding: 0 12px;
}

.segmented button.active,
.tabs button.active {
  background: var(--green);
  color: white;
}

.primary,
.secondary,
.danger {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
}

.primary {
  background: var(--green);
  border: 1px solid var(--green);
  color: white;
}

.secondary {
  background: var(--green-soft);
  border: 1px solid #b9d8c8;
  color: var(--green);
}

.danger {
  background: #fff1f0;
  border: 1px solid #f3b8b2;
  color: #b42318;
}

.icon-button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 22px;
  height: 44px;
  width: 44px;
}

.message {
  color: var(--muted);
  margin: 10px 0 0;
  min-height: 20px;
}

.dev-code {
  background: #eef6ff;
  border: 1px solid #b8d1ef;
  border-radius: 8px;
  color: #173f70;
  font-weight: 900;
  padding: 10px;
}

.hidden {
  display: none !important;
}

.profile-grid {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.macro-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.recipe-form-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.pantry-form-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.chip-groups {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.chip-group {
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.chip-group h3 {
  margin-bottom: 8px;
}

.chip {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  margin: 0 6px 6px 0;
  min-height: 34px;
  padding: 0 10px;
}

.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.tag-columns {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tags {
  align-content: start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
}

.tag {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
}

.tag button {
  background: transparent;
  border: 0;
  color: var(--red);
  font-weight: 900;
  padding: 0;
}

.tag-input-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 44px;
  margin-top: 10px;
}

.tag-input-row button {
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  color: white;
  font-size: 22px;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.section-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 18px 0;
}

.section-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.plan-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}

.day-card {
  background: transparent;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.meal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 10px;
  padding: 14px;
}

.meal-type {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.recipe-title {
  font-size: 17px;
  font-weight: 900;
  margin: 6px 0;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 12px;
}

.budget-summary {
  color: var(--green);
  font-weight: 900;
  margin-top: 8px;
}

.recipe-thumb {
  aspect-ratio: 16 / 9;
  background-size: 300% 300%;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  margin-bottom: 10px;
  width: 100%;
}

.meal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meal-actions button {
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  min-height: 36px;
  padding: 0 10px;
}

.shopping-list {
  display: grid;
  gap: 10px;
}

.cost-drivers {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 14px;
}

.cost-driver {
  background: #fff8df;
  border: 1px solid #ead99c;
  border-radius: 8px;
  padding: 12px;
}

.shopping-row {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  padding: 14px;
}

.shopping-row.checked {
  background: #eef7f0;
  border-color: #add8ba;
  opacity: .82;
}

.shopping-row.checked strong {
  text-decoration: line-through;
}

.quantity {
  color: var(--green);
  font-weight: 900;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.toast {
  background: var(--ink);
  border-radius: 8px;
  bottom: 22px;
  color: white;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 14px;
  position: fixed;
  transform: translateX(-50%);
}

.recipe-dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  max-width: min(760px, calc(100vw - 28px));
  padding: 20px;
  width: 760px;
}

.recipe-dialog::backdrop {
  background: rgba(22, 35, 29, 0.45);
}

.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
}

.recipe-detail-image {
  aspect-ratio: 16 / 9;
  background-size: 300% 300%;
  border-radius: 8px;
  display: block;
  margin-bottom: 16px;
  width: 100%;
}

.detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.detail-list {
  margin: 0;
  padding-left: 20px;
}

.price-note {
  background: #eef6ff;
  border: 1px solid #b8d1ef;
  border-radius: 8px;
  color: #173f70;
  padding: 12px;
}

@media (max-width: 860px) {
  .landing-page {
    background-attachment: scroll;
    scroll-snap-type: y proximity;
  }

  .landing-nav {
    gap: 14px;
    min-height: 70px;
    padding: 14px 18px;
    width: 100%;
  }

  .landing-nav::before {
    inset: 7px 10px;
  }

  .landing-nav-actions a {
    display: none;
  }

  .landing-nav-actions .secondary {
    display: none;
  }

  .landing-language-select {
    min-width: 64px;
  }

  .landing-hero,
  .landing-showcase,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: calc(100svh - 72px);
    padding: 22px 16px 62px;
    width: min(100% - 16px, 1500px);
  }

  .hero-copy,
  .hero-media {
    order: initial;
  }

  .hero-media {
    min-height: 430px;
  }

  .hero-media > img {
    height: 330px;
    left: 0;
    right: auto;
    width: 100%;
  }

  .phone-preview {
    bottom: 0;
    right: 20px;
    width: min(250px, 76vw);
  }

  .landing-band,
  .landing-showcase,
  .landing-final {
    min-height: 100svh;
    padding: 58px 16px;
    width: min(100% - 16px, 1500px);
  }

  .recipe-stack article,
  .recipe-stack article:nth-child(2),
  .recipe-stack article:nth-child(3) {
    grid-template-columns: 88px 1fr;
    transform: none;
  }

  .recipe-stack img {
    height: 72px;
    width: 72px;
  }

  .app-shell {
    padding: 16px;
  }

  .auth-grid,
  .form-grid,
  .tag-columns,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  #verifyForm,
  #resetForm {
    grid-column: auto;
  }

  .auth-copy {
    min-height: auto;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
}
