:root {
  --green-bg: #c9d9c3;
  --green-surface: #dcebd6;
  --green-muted: #e8f0e3;
  --green-tag-bg: #e0edd8;
  --green-input: #eef4eb;
  --green-tile: #c0d8b8;
  --green-primary: #3a6b35;
  --green-dark: #1a2e1a;
  --green-text: #4a6b45;
  --green-mid: #7a9a74;
  --green-faint: #9ab094;
  --amber-bg: #fdf3dc;
  --amber-text: #b07a30;
  --red-bg: #fdeaea;
  --red-icon: #c0503a;
  --browser-bg: #f7f9f4;
  --card: #fbfcf7;
  --white: #fffffb;
  --shadow-card: 0 2px 12px rgba(58, 107, 53, 0.08);
  --shadow-mid: 0 2px 10px rgba(58, 107, 53, 0.08);
  --shadow-cta: 0 4px 20px rgba(58, 107, 53, 0.35);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--browser-bg);
  color: var(--green-dark);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.app {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--green-bg), #d6e2d1 72%, #c9d9c3);
}

.screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 20px 26px;
  overflow: hidden;
}

.screen.has-bottom {
  padding-bottom: 160px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 70px;
  margin-bottom: 22px;
}

.page-header.compact {
  padding-top: 48px;
}

.brand {
  margin-bottom: 8px;
  color: var(--green-text);
  font-size: 15px;
  font-weight: 600;
}

.title {
  margin: 0;
  color: var(--green-dark);
  font-size: 36px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-copy {
  margin: 18px 0 0;
  color: var(--green-text);
  font-size: 18px;
  line-height: 1.55;
  font-weight: 650;
}

.hero-art {
  display: grid;
  place-items: center;
  flex: 0 0 92px;
  width: 92px;
  height: 92px;
  margin-top: 34px;
  border-radius: 20px;
  background: #eef5e9;
}

.hero-art img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--green-primary);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.meta-pill .money {
  font-size: 24px;
  line-height: 1;
}

.meta-pill .note {
  color: #b8d4b0;
  font-size: 13px;
}

.card {
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.soft-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 24px;
  background: var(--green-muted);
}

.soft-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: var(--green-tile);
}

.soft-icon img {
  width: 26px;
  height: 26px;
}

.soft-title {
  color: var(--green-text);
  font-size: 18px;
  font-weight: 650;
}

.soft-subtitle {
  margin-top: 5px;
  color: var(--green-mid);
  font-size: 14px;
  font-weight: 600;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  color: var(--green-dark);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 850;
}

.section-note {
  color: var(--green-mid);
  font-size: 15px;
  font-weight: 650;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 14px;
  border-radius: 16px;
  color: var(--green-primary);
  background: var(--green-input);
  font-size: 19px;
  font-weight: 800;
}

.option.active {
  color: #fff;
  background: var(--green-primary);
}

.option .check {
  font-size: 22px;
  line-height: 1;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 10px;
}

.text-input {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  padding: 0 16px;
  color: var(--green-dark);
  background: var(--green-input);
  font-size: 18px;
  font-weight: 750;
  outline: none;
}

.text-input::placeholder {
  color: var(--green-faint);
}

.small-button,
.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--green-primary);
  background: var(--green-input);
  font-size: 15px;
  font-weight: 800;
}

.small-button.primary,
.pill-button.primary {
  color: #fff;
  background: var(--green-primary);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green-primary);
  background: var(--green-tag-bg);
  font-size: 14px;
  font-weight: 720;
}

.ai-preview {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 62px;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border-radius: 24px;
  background: var(--green-muted);
}

.ai-count {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  color: #fff;
  background: var(--green-primary);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.ai-count strong {
  display: block;
  font-size: 30px;
  line-height: 0.95;
}

.date-card {
  padding: 8px;
  border-radius: 24px;
  background: var(--green-surface);
  margin-bottom: 22px;
}

.date-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.date-tile {
  display: grid;
  place-items: center;
  height: 54px;
  border-radius: 16px;
  color: var(--green-dark);
  background: transparent;
}

.date-tile.active {
  color: #fff;
  background: var(--green-primary);
}

.date-day {
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
}

.date-num {
  margin-top: 4px;
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
}

.day-section {
  margin-bottom: 24px;
}

.day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.day-title {
  color: var(--green-dark);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 850;
}

.day-note {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--green-primary);
  background: var(--green-tag-bg);
  font-size: 14px;
  font-weight: 720;
  line-height: 32px;
}

.dish-list {
  display: grid;
  gap: 14px;
}

.dish-card {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 132px;
  padding: 16px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.dish-image {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 18px;
}

.dish-name {
  color: var(--green-dark);
  font-size: 24px;
  line-height: 1.16;
  font-weight: 900;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--green-primary);
  background: var(--green-tag-bg);
  font-size: 14px;
  font-weight: 750;
}

.tag.warm {
  color: var(--amber-text);
  background: var(--amber-bg);
}

.dish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.dish-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--green-primary);
  background: var(--green-input);
  font-size: 15px;
  font-weight: 780;
}

.dish-action img {
  width: 17px;
  height: 17px;
}

.bottom-area {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100vw, 480px);
  transform: translateX(-50%);
  padding: 10px 20px calc(8px + var(--safe-bottom));
  background: var(--green-bg);
}

.primary-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  color: #fff;
  background: var(--green-primary);
  box-shadow: var(--shadow-cta);
  font-size: 20px;
  font-weight: 900;
}

.primary-cta.is-complete {
  color: var(--green-primary);
  background: var(--green-tag-bg);
  box-shadow: none;
  opacity: 0.72;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 76px;
  margin-top: 8px;
  background: transparent;
}

.nav-item {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--green-mid);
  font-size: 13px;
  font-weight: 650;
}

.nav-item.active {
  color: var(--green-primary);
  font-weight: 900;
}

.nav-item img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  opacity: 0.82;
}

.nav-badge {
  position: absolute;
  top: 9px;
  left: 50%;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--green-primary);
  font-size: 12px;
  font-weight: 900;
  line-height: 21px;
}

.segment {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 6px;
  margin-bottom: 20px;
  border-radius: 24px;
  background: var(--green-surface);
}

.segment.four {
  grid-template-columns: repeat(4, 1fr);
}

.segment button {
  min-height: 58px;
  border-radius: 18px;
  color: var(--green-dark);
  background: transparent;
  font-size: 19px;
  font-weight: 850;
}

.segment button.active {
  color: #fff;
  background: var(--green-primary);
}

.summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.estimate-box {
  min-width: 78px;
  padding: 12px 14px;
  border-radius: 18px;
  color: var(--amber-text);
  background: var(--amber-bg);
  text-align: center;
  font-size: 13px;
  font-weight: 780;
}

.estimate-box strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: #f0f5ee;
}

.mini-stats {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.grocery-list {
  overflow: hidden;
}

.grocery-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 16px 0;
  width: 100%;
  background: transparent;
  border-bottom: 1px solid #f0f5ee;
  text-align: left;
}

.grocery-item:last-child {
  border-bottom: 0;
}

.grocery-item:disabled {
  cursor: default;
  opacity: 1;
}

.check-circle {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #cbd8c8;
  border-radius: 999px;
  color: transparent;
  background: transparent;
  font-size: 15px;
  font-weight: 900;
}

.grocery-item.done .check-circle {
  color: var(--green-primary);
  border-color: var(--green-primary);
}

.grocery-item.done .grocery-name,
.grocery-item.done .grocery-source,
.grocery-item.done .grocery-amount {
  color: var(--green-mid);
  opacity: 0.55;
}

.grocery-name {
  display: block;
  color: var(--green-dark);
  font-size: 21px;
  line-height: 1.2;
  font-weight: 900;
}

.grocery-source {
  display: block;
}

.grocery-source,
.dish-desc {
  margin-top: 5px;
  color: var(--green-mid);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 650;
}

.grocery-amount {
  color: var(--green-primary);
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.spend-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  align-items: center;
}

.money-input {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 58px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--green-input);
}

.spend-prefix {
  color: var(--green-mid);
  font-size: 18px;
  font-weight: 900;
}

.money-input .spend-input {
  min-height: 58px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 20px;
}

.search {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 64px;
  margin-bottom: 20px;
  padding: 0 18px;
  border-radius: 24px;
  background: var(--green-muted);
  color: var(--green-mid);
}

.search input {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--green-dark);
  font-size: 20px;
  font-weight: 800;
}

.favorite-card {
  position: relative;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 138px;
}

.favorite-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--green-input);
}

.icon-btn.delete {
  background: var(--red-bg);
}

.icon-btn img {
  width: 19px;
  height: 19px;
}

.schedule-pill {
  margin-top: 12px;
  transition: background-color 180ms ease, color 180ms ease;
}

.schedule-pill.is-active {
  color: var(--white);
  background: var(--green-primary);
}

.schedule-pill.is-muted {
  color: var(--green-primary);
  background: var(--green-input);
}

.confirm-screen {
  padding-bottom: 28px;
}

.confirm-back {
  position: absolute;
  top: 76px;
  left: 20px;
  z-index: 4;
  margin: 0;
  background: rgba(255, 255, 251, 0.78);
}

.confirm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-top: 74px;
  margin-bottom: 14px;
}

.confirm-header .brand {
  margin-bottom: 5px;
  font-size: 16px;
  font-weight: 700;
}

.confirm-header .title {
  font-size: 42px;
  line-height: 0.98;
  letter-spacing: 0;
}

.retain-card {
  flex: 0 0 116px;
  min-height: 84px;
  margin-top: -8px;
  padding: 15px 18px 12px;
  border-radius: 28px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.retain-label {
  color: var(--green-text);
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.retain-main {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 3px;
}

.retain-main strong {
  color: var(--green-primary);
  font-size: 42px;
  line-height: 0.92;
  font-weight: 950;
}

.retain-main span {
  color: var(--green-text);
  font-size: 21px;
  font-weight: 900;
}

.ingredient-hero {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.ingredient-hero img {
  width: 110px;
  height: 110px;
  object-fit: contain;
}

.group-card .section-head {
  margin-bottom: 12px;
}

.ingredient-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
  margin: 14px 0 0;
}

.ingredient-add-input {
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  outline: none;
  color: var(--green-dark);
  background: var(--green-input);
  font-size: 16px;
  font-weight: 760;
}

.ingredient-add-input::placeholder {
  color: var(--green-faint);
}

.ingredient-add-row .pill-button {
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
}

.ingredient-pills {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.ingredient-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(220px, 76%);
  min-height: 42px;
  border-radius: 999px;
  color: var(--green-text);
  background: var(--green-tag-bg);
  font-size: 17px;
  font-weight: 760;
}

.ingredient-pill.is-inactive {
  color: var(--green-faint);
  background: var(--green-input);
  box-shadow: inset 0 0 0 1px #dfe9dc;
}

.two-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.secondary-cta {
  min-height: 56px;
  border-radius: 18px;
  color: var(--green-primary);
  background: var(--green-input);
  font-size: 19px;
  font-weight: 900;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(23, 33, 27, 0.3);
}

.bottom-sheet {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 60;
  width: min(calc(100vw - 24px), 456px);
  max-height: min(78vh, 760px);
  overflow: auto;
  transform: translateX(-50%);
  padding: 20px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 8px 40px rgba(58, 107, 53, 0.18);
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.sheet-title {
  color: var(--green-dark);
  font-size: 23px;
  line-height: 1.2;
  font-weight: 900;
}

.sheet-note {
  margin-top: 6px;
  color: var(--green-mid);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 650;
}

.sheet-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--green-primary);
  background: var(--green-input);
  font-size: 24px;
  font-weight: 900;
}

.replace-option {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 28px;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 86px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-mid);
  text-align: left;
}

.replace-option.active {
  background: var(--green-muted);
}

.replace-option img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.radio {
  width: 24px;
  height: 24px;
  border: 2px solid #9ead98;
  border-radius: 999px;
  background: var(--white);
}

.replace-option.active .radio {
  border: 7px solid var(--green-primary);
}

.schedule-sheet {
  padding: 18px;
}

.schedule-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-mid);
  text-align: left;
}

.schedule-option.active {
  background: var(--green-muted);
}

.schedule-option-title,
.schedule-option-desc {
  display: block;
}

.schedule-option-title {
  color: var(--green-dark);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.schedule-option-desc {
  margin-top: 3px;
  color: var(--green-text);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
}

.schedule-option.active .radio {
  border: 7px solid var(--green-primary);
}

.schedule-confirm {
  min-height: 50px;
  margin-top: 10px;
  border-radius: 12px;
  font-size: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(128px + var(--safe-bottom));
  z-index: 80;
  transform: translateX(-50%);
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(26, 46, 26, 0.92);
  font-size: 14px;
  font-weight: 760;
}

.hidden {
  display: none !important;
}

@media (max-width: 360px) {
  .screen {
    padding-left: 14px;
    padding-right: 14px;
  }

  .title {
    font-size: 32px;
  }

  .dish-card,
  .favorite-card {
    grid-template-columns: 82px minmax(0, 1fr);
    padding: 14px;
  }

  .dish-image,
  .favorite-card .dish-image {
    width: 76px;
    height: 76px;
  }
}
