:root {
  --paper: #f4ede1;
  --paper-deep: #ebe0d0;
  --surface: #fffaf2;
  --ink: #23372f;
  --muted: #746e64;
  --line: #d8cbb8;
  --green: #294d3e;
  --green-soft: #dfe9e1;
  --clay: #b85f48;
  --clay-soft: #f1ddd5;
  --gold: #e3b85e;
  --good: #3f725d;
  --warn: #a66b29;
  --bad: #a64d3e;
  --expert: #655778;
  --shadow: 0 18px 50px rgba(62, 48, 31, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #d8cfc1; color: var(--ink); }
body {
  display: grid;
  place-items: start center;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(227, 184, 94, .68);
  outline-offset: 2px;
}
.svg-defs { position: fixed; width: 0; height: 0; overflow: hidden; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 17px; height: 17px; }
.icon.xs { width: 14px; height: 14px; }
.asset-icon { display: inline-block; flex: 0 0 auto; background: currentColor; fill: none; stroke: none; vertical-align: middle; -webkit-mask: var(--icon-asset) center / contain no-repeat; mask: var(--icon-asset) center / contain no-repeat; }

.app-shell {
  width: min(100vw, 390px);
  height: min(100svh, 844px);
  min-height: 620px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 5%, rgba(255,255,255,.55), transparent 28%),
    var(--paper);
  box-shadow: var(--shadow);
}
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; animation: screen-in .24s ease-out both; }
@keyframes screen-in { from { opacity: .5; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 18px 18px 106px; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.scroll.secondary { padding-top: 8px; }
.content-end { height: 18px; }

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 34px; gap: 10px; }
.brand { font-size: 18px; font-weight: 900; letter-spacing: .18em; }
.eyebrow { margin: 0 0 5px; color: var(--clay); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.date-note, .subtle { color: var(--muted); font-size: 12px; }
.avatar-button { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 0; cursor: pointer; }
.avatar {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: var(--member-color, var(--green)); color: #fff; font-weight: 900; font-size: 14px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.26);
}
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.avatar.lg { width: 58px; height: 58px; font-size: 18px; }
.avatar-copy { text-align: left; line-height: 1.25; }
.avatar-copy strong { display: block; font-size: 13px; }
.avatar-copy small { color: var(--muted); font-size: 10px; }

.display { font-family: "Songti SC", "STSong", Georgia, serif; letter-spacing: -.035em; text-wrap: balance; }
h1.display { margin: 18px 0 8px; font-size: 31px; line-height: 1.16; }
h2.display { margin: 0; font-size: 24px; line-height: 1.2; }
h3.display { margin: 0; font-size: 20px; line-height: 1.2; }
.lead { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 0; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.section-title h2 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 21px; letter-spacing: -.02em; }
.section-title button, .text-btn { border: 0; background: transparent; color: var(--clay); font-size: 12px; font-weight: 800; padding: 7px 0; cursor: pointer; }

.member-strip { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 2px; scrollbar-width: none; }
.member-strip::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.member-pill {
  border: 1px solid var(--line); background: rgba(255,250,242,.64); border-radius: 999px; padding: 6px 10px 6px 6px;
  display: flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; min-height: 42px;
}
.member-pill.active { background: var(--green); color: #fff; border-color: var(--green); }
.member-pill.active .avatar { box-shadow: none; background: rgba(255,255,255,.18); }
.member-pill span { font-size: 12px; font-weight: 800; }

.hero-meal { margin-top: 16px; min-height: 218px; border-radius: 28px 8px 28px 8px; overflow: hidden; position: relative; background: var(--green); color: white; }
.hero-meal img { position: absolute; inset: 0 0 0 44%; width: 56%; height: 100%; object-fit: cover; }
.hero-meal::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,var(--green) 0 42%,rgba(41,77,62,.94) 55%,rgba(41,77,62,.08) 100%); }
.hero-copy { position: relative; z-index: 1; width: 64%; padding: 22px 8px 18px 18px; }
.hero-copy .kicker { color: #d9e9df; font-size: 11px; font-weight: 800; }
.hero-copy h2 { font-family: "Songti SC", "STSong", serif; font-size: 23px; margin: 8px 0; }
.hero-copy p { font-size: 11px; line-height: 1.55; color: #dce8e1; margin: 0 0 12px; }

.primary, .secondary-btn, .ghost-btn, .icon-btn { min-height: 44px; border: 0; cursor: pointer; font-weight: 850; }
.primary { border-radius: 999px; background: var(--gold); color: var(--ink); padding: 0 16px; }
.primary.dark { background: var(--green); color: #fff; }
.primary.clay { background: var(--clay); color: #fff; }
.primary.full, .secondary-btn.full, .ghost-btn.full { width: 100%; }
.secondary-btn { border: 1px solid var(--green); border-radius: 999px; background: transparent; color: var(--green); padding: 0 16px; }
.ghost-btn { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.45); padding: 0 15px; }
.icon-btn { width: 44px; padding: 0; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.54); border: 1px solid var(--line); }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }

.status-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; border: 1px solid var(--line); color: #5c574f; background: rgba(255,255,255,.38); font-size: 11px; white-space: nowrap; }
.tag.strong { background: var(--green); border-color: var(--green); color: #fff; }
.tag.good { background: var(--green-soft); color: #315b49; border-color: transparent; }
.tag.warn, .tag.adjust { background: #f4e3c9; color: #80551d; border-color: transparent; }
.tag.bad { background: var(--clay-soft); color: #8a4034; border-color: transparent; }
.tag.expert { background: #e7e1ec; color: #5e4d70; border-color: transparent; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-card { min-height: 92px; border: 0; border-radius: 17px; padding: 14px; text-align: left; background: rgba(255,250,242,.72); border: 1px solid var(--line); cursor: pointer; }
.quick-card:nth-child(1) { border-radius: 4px 19px 19px 19px; }
.quick-card:nth-child(2) { border-radius: 19px 4px 19px 19px; }
.quick-card strong { display: block; font-size: 14px; margin-bottom: 5px; }
.quick-card small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.quick-card .mini-link { color: var(--clay); font-size: 10px; font-weight: 800; display: block; margin-top: 8px; }

.care-note { margin-top: 16px; padding: 13px 14px; border-left: 3px solid var(--clay); background: rgba(255,250,242,.56); font-size: 11px; line-height: 1.6; color: #665f56; }
.care-note strong { color: var(--ink); }

.bottom-nav {
  position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; height: 80px; padding: 7px 8px max(8px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; background: rgba(248,242,232,.97); border-top: 1px solid var(--line); backdrop-filter: blur(14px);
}
.nav-item { min-height: 58px; border: 0; background: transparent; color: #837a6e; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; cursor: pointer; }
.nav-item.active { color: var(--green); font-weight: 900; }
.nav-item.scan { transform: translateY(-10px); }
.nav-item.scan .nav-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--clay); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(184,95,72,.28); }
.nav-item.scan .icon { width: 25px; height: 25px; }
.nav-item.scan.active .nav-icon { background: var(--green); }

.backbar { min-height: 52px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 4px; }
.backbar h1 { margin: 0; font-size: 17px; text-align: center; }
.backbar .back { border: 0; background: transparent; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.backbar .right { display: flex; justify-content: flex-end; }

.searchbox { min-height: 46px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: rgba(255,250,242,.72); border-radius: 15px; padding: 0 13px; margin-top: 14px; }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.voice-button { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(41,77,62,.1); color: var(--green); display: grid; place-items: center; cursor: pointer; transition: background .16s ease, color .16s ease, transform .16s ease; }
.voice-button:hover { background: var(--green-soft); }
.voice-button.listening { background: var(--clay); color: #fff; animation: voice-pulse 1.05s ease-in-out infinite; }
@keyframes voice-pulse { 50% { box-shadow: 0 0 0 7px rgba(184,95,72,.15); transform: scale(1.04); } }
.voice-field, .field-with-voice { position: relative; }
.voice-field textarea { padding-right: 54px; }
.voice-field > .voice-button, .field-with-voice > .voice-button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.textarea-voice > .voice-button { top: 9px; transform: none; }
.field-with-voice input { padding-right: 52px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 11px 0 3px; scrollbar-width: none; }
.chip { min-height: 34px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.35); padding: 0 12px; white-space: nowrap; color: #645e55; font-size: 11px; cursor: pointer; }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 800; }

.recipe-list { display: grid; gap: 12px; margin-top: 13px; }
.recipe-card { display: grid; grid-template-columns: 108px 1fr; min-height: 132px; border: 1px solid var(--line); background: rgba(255,250,242,.72); border-radius: 7px 22px 7px 22px; overflow: hidden; cursor: pointer; text-align: left; padding: 0; }
.recipe-card img { width: 108px; height: 100%; object-fit: cover; }
.recipe-card-copy { padding: 12px 12px 10px; min-width: 0; }
.recipe-card h3 { margin: 0 0 6px; font-family: "Songti SC", "STSong", serif; font-size: 18px; }
.recipe-meta { display: flex; gap: 9px; color: var(--muted); font-size: 10px; margin-bottom: 8px; }
.recipe-card p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.match-line { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 10px; }
.progress { height: 5px; flex: 1; background: var(--paper-deep); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--green); border-radius: inherit; }

.video-entry { width: 100%; border: 0; background: var(--clay); color: white; border-radius: 18px 6px 18px 18px; padding: 14px; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; margin-top: 14px; }
.video-entry .icon-wrap { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.14); }
.video-entry strong { display: block; font-size: 14px; }
.video-entry small { display: block; color: #f6ded7; margin-top: 3px; font-size: 10px; }
.video-entry .icon-chevron { margin-left: auto; }

.detail-hero { margin: 0 -18px; position: relative; height: 252px; overflow: hidden; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,rgba(20,34,28,.05) 25%,rgba(20,34,28,.87) 100%); }
.detail-back { position: absolute; z-index: 2; top: 12px; left: 14px; background: rgba(250,246,238,.9); }
.detail-title { position: absolute; z-index: 2; left: 18px; right: 18px; bottom: 18px; color: white; }
.detail-title h1 { margin: 0 0 5px; font-size: 29px; }
.detail-title p { margin: 0; color: #e4ece7; font-size: 11px; }
.detail-actions { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.servings { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.round-mini { width: 31px; height: 31px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.4); cursor: pointer; }
.detail-tabs { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--line); margin-top: 4px; position: sticky; top: 0; z-index: 2; background: var(--paper); }
.detail-tabs button { min-height: 44px; border: 0; background: transparent; font-size: 12px; color: var(--muted); cursor: pointer; }
.detail-tabs button.active { color: var(--green); font-weight: 900; box-shadow: inset 0 -3px var(--green); }
.ingredient-group { margin-top: 18px; }
.ingredient-group h3 { margin: 0 0 7px; font-size: 13px; }
.ingredient-row { display: flex; justify-content: space-between; gap: 20px; min-height: 38px; align-items: center; border-bottom: 1px solid rgba(216,203,184,.72); font-size: 12px; }
.ingredient-row span:last-child { color: var(--muted); text-align: right; }
.step-row { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.step-num { font-family: Georgia,serif; font-style: italic; color: var(--clay); font-size: 22px; }
.step-row h3 { margin: 0 0 5px; font-size: 14px; }
.step-row p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.heat-time { display: flex; gap: 7px; margin-top: 8px; }
.reason-box { padding: 15px; background: var(--green-soft); border-radius: 4px 18px 18px 18px; margin-top: 15px; }
.reason-box h3 { margin: 0 0 7px; font-size: 15px; }
.reason-box p { margin: 0; font-size: 11px; color: #486054; line-height: 1.6; }

.scan-stage { margin-top: 18px; height: 288px; border-radius: 30px 6px 30px 6px; position: relative; overflow: hidden; background: #243f34; color: #fff; display: grid; place-items: center; }
.scan-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .42; }
.scan-stage::after { content: ""; position: absolute; inset: 22px; border: 1px solid rgba(255,255,255,.7); border-radius: 22px 4px 22px 4px; box-shadow: 0 0 0 999px rgba(24,45,36,.2); }
.scan-copy { position: relative; z-index: 2; text-align: center; width: 220px; }
.scan-copy .camera-disc { width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--clay); }
.scan-copy h2 { margin: 0 0 7px; font-family: "Songti SC", "STSong", serif; font-size: 22px; }
.scan-copy p { margin: 0; color: #d5e1db; font-size: 11px; line-height: 1.5; }
.capture-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 13px; }
.capture-option { min-height: 76px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,250,242,.7); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; font-size: 11px; font-weight: 800; cursor: pointer; }
.scan-guidance { margin-top: 16px; display: grid; gap: 8px; }
.guidance-row { display: grid; grid-template-columns: 22px 1fr; gap: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.guidance-row b { color: var(--clay); font-family: Georgia,serif; font-style: italic; }

.result-photo { height: 205px; margin: 0 -18px; overflow: hidden; position: relative; }
.result-photo img { width: 100%; height: 100%; object-fit: cover; }
.result-badge { position: absolute; left: 18px; bottom: 14px; padding: 9px 13px; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 900; background: var(--good); }
.result-badge.adjust { background: var(--warn); }
.result-badge.bad { background: var(--bad); }
.result-badge.expert { background: var(--expert); }
.result-title { padding: 17px 0 12px; border-bottom: 1px solid var(--line); }
.result-title h1 { margin: 0 0 4px; font-size: 27px; }
.result-title p { margin: 0; color: var(--muted); font-size: 11px; }
.explain { display: grid; gap: 10px; margin-top: 14px; }
.explain-block { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.explain-block small { color: var(--clay); font-weight: 900; }
.explain-block p { margin: 5px 0 0; font-size: 12px; line-height: 1.65; }
.scenario-switch { display: flex; gap: 6px; margin-top: 15px; }
.scenario-switch button { flex: 1; min-height: 34px; border: 1px solid var(--line); border-radius: 9px; background: transparent; font-size: 10px; cursor: pointer; }
.scenario-switch button.active { background: var(--ink); color: white; border-color: var(--ink); }

.family-intro { display: flex; align-items: center; gap: 13px; padding: 16px 0 14px; border-bottom: 1px solid var(--line); }
.family-intro h1 { margin: 0 0 4px; font-size: 25px; }
.family-intro p { margin: 0; font-size: 11px; color: var(--muted); }
.family-list { margin-top: 12px; }
.member-card { width: 100%; display: grid; grid-template-columns: 48px 1fr 24px; gap: 11px; align-items: center; border: 0; border-bottom: 1px solid var(--line); padding: 13px 0; background: transparent; text-align: left; cursor: pointer; }
.member-card h3 { margin: 0 0 4px; font-size: 15px; }
.member-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.completion { margin-top: 7px; display: flex; align-items: center; gap: 7px; font-size: 9px; color: var(--muted); }
.completion .progress { max-width: 82px; }

.plan-member { display: flex; align-items: center; gap: 12px; padding: 6px 0 16px; }
.plan-member h1 { margin: 0 0 3px; font-size: 26px; }
.plan-member p { margin: 0; font-size: 11px; color: var(--muted); }
.plan-quote { padding: 18px 17px; border-radius: 22px 5px 22px 5px; background: linear-gradient(135deg, #ff7b30, #f2581d); color: #fff; }
.plan-quote h2 { margin: 0 0 7px; font-size: 21px; }
.plan-quote p { margin: 0; color: #fff3ec; font-size: 11px; line-height: 1.55; }
.plan-section { padding: 15px 0; border-bottom: 1px solid var(--line); }
.plan-section h3 { margin: 0 0 10px; font-size: 14px; }
.bullet-list { display: grid; gap: 8px; }
.bullet { display: grid; grid-template-columns: 7px 1fr; gap: 9px; align-items: start; font-size: 12px; line-height: 1.45; }
.bullet::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-top: 6px; }
.bullet.limit::before { background: var(--clay); }
.source-card { margin-top: 14px; font-size: 10px; line-height: 1.55; color: var(--muted); }
.source-card a { color: var(--green); font-weight: 800; }

.week-strip { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; margin-top: 14px; }
.day { min-height: 58px; border: 1px solid var(--line); border-radius: 14px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.day small { font-size: 9px; color: var(--muted); }
.day strong { font-size: 13px; }
.day.active { background: var(--green); color: #fff; border-color: var(--green); }
.day.active small { color: #d8e8df; }
.meal-plan { margin-top: 17px; }
.meal-row { display: grid; grid-template-columns: 42px 1fr 32px; gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.meal-kind { font-family: "Songti SC", "STSong", serif; color: var(--clay); font-size: 14px; }
.meal-row h3 { margin: 0 0 3px; font-size: 14px; }
.meal-link { display: block; border: 0; background: transparent; padding: 2px 0 4px; color: var(--ink); font-size: 14px; font-weight: 850; text-align: left; cursor: pointer; }
.meal-link:after { content: "  ›"; color: var(--clay); }
.meal-row p { margin: 0; color: var(--muted); font-size: 10px; }
.swap { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--green); }
.shopping-summary { margin-top: 17px; padding: 15px; border-radius: 4px 18px 18px 18px; background: var(--clay-soft); }
.shopping-summary strong { display: block; font-size: 14px; }
.shopping-summary p { margin: 5px 0 10px; font-size: 10px; color: #7f5549; }

.import-box { margin-top: 16px; }
.import-box textarea { width: 100%; height: 118px; resize: none; border: 1px solid var(--line); border-radius: 18px 5px 18px 18px; background: rgba(255,250,242,.72); padding: 13px; outline: 0; font-size: 12px; line-height: 1.55; color: var(--ink); }
.import-hint { display: flex; gap: 7px; align-items: start; color: var(--muted); font-size: 10px; line-height: 1.45; margin: 8px 2px 14px; }
.error-text { color: var(--bad); font-size: 11px; margin-top: 7px; }
.analyzing { padding: 28px 0; text-align: center; }
.analyzing-ring { width: 64px; height: 64px; margin: 0 auto 15px; border-radius: 50%; border: 3px solid var(--paper-deep); border-top-color: var(--clay); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.analysis-steps { display: grid; gap: 8px; margin-top: 18px; text-align: left; }
.analysis-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.analysis-step.done { color: var(--green); font-weight: 800; }
.draft-head { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: center; padding: 12px 0 14px; border-bottom: 1px solid var(--line); }
.draft-head img { width: 88px; height: 88px; object-fit: cover; border-radius: 16px 5px 16px 16px; }
.draft-head h2 { margin: 0 0 5px; font-size: 20px; }
.draft-head p { margin: 0; color: var(--muted); font-size: 10px; }
.editable-block { padding: 13px 0; border-bottom: 1px solid var(--line); }
.editable-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.editable-title h3 { margin: 0; font-size: 13px; }
.editable-title button { border: 0; background: transparent; color: var(--clay); cursor: pointer; }
.draft-list { margin: 0; padding-left: 18px; color: #5e594f; font-size: 11px; line-height: 1.75; }
.unknown-label { color: var(--warn); font-weight: 800; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border: 1px solid var(--line); border-radius: 14px; margin-top: 13px; background: rgba(255,255,255,.3); }
.segmented button { min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--green); box-shadow: 0 3px 10px rgba(62,48,31,.08); font-weight: 900; }
.fridge-summary { display: grid; grid-template-columns: 1.25fr .9fr .9fr; gap: 7px; margin-top: 14px; }
.fridge-stat { padding: 12px 9px; background: rgba(255,250,242,.62); border-bottom: 2px solid var(--line); }
.fridge-stat strong { display: block; font-family: Georgia,serif; font-size: 23px; color: var(--green); }
.fridge-stat small { color: var(--muted); font-size: 9px; }
.zone-title { margin: 18px 0 7px; font-size: 12px; color: var(--clay); font-weight: 900; letter-spacing: .08em; }
.pantry-row { display: grid; grid-template-columns: 1fr 26px; gap: 10px; align-items: center; min-height: 54px; border-bottom: 1px solid var(--line); }
.pantry-main { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; min-height: 50px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.pantry-row h3 { margin: 0 0 3px; font-size: 13px; }
.pantry-row p { margin: 0; color: var(--muted); font-size: 9px; }
.pantry-row .qty { font-size: 11px; font-weight: 800; text-align: right; }
.pantry-row .qty small { display: block; margin-top: 3px; color: var(--clay); font-size: 9px; font-weight: 700; }
.delete-item { width: 26px; height: 32px; border: 0; background: transparent; color: #a08778; cursor: pointer; display: grid; place-items: center; }
.fridge-rec { margin-top: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fridge-rec-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.fridge-rec h3 { margin: 0 0 4px; font-size: 15px; }
.fridge-rec p { margin: 0; color: var(--muted); font-size: 10px; }
.dual-score { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.score { padding: 9px; background: rgba(255,250,242,.65); border-radius: 10px; }
.score small { display: block; color: var(--muted); font-size: 9px; margin-bottom: 3px; }
.score strong { font-size: 12px; }
.missing { margin-top: 8px; color: var(--warn); font-size: 10px; }

.sheet-backdrop { position: absolute; z-index: 40; inset: 0; background: rgba(31,43,37,.38); display: flex; align-items: flex-end; animation: fade .18s ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-height: 74%; overflow-y: auto; background: var(--surface); border-radius: 25px 25px 0 0; padding: 13px 18px 24px; animation: sheet-in .22s ease-out both; }
@keyframes sheet-in { from { transform: translateY(30px); opacity: .6; } }
.sheet-handle { width: 38px; height: 4px; border-radius: 8px; background: #d6c8b5; margin: 0 auto 16px; }
.sheet-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-title h2 { margin: 0; font-size: 19px; }
.sheet-close { width: 40px; height: 40px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.sheet-member { width: 100%; display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; min-height: 62px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.sheet-member strong { font-size: 13px; }
.sheet-member small { display: block; color: var(--muted); margin-top: 3px; font-size: 9px; }
.check-disc { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; color: transparent; border: 1px solid var(--line); }
.sheet-member.active .check-disc { color: #fff; background: var(--green); border-color: var(--green); }
.form-grid { display: grid; gap: 11px; }
.field label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.field input, .field select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: #fffdfa; padding: 0 11px; outline: 0; color: var(--ink); }

.toast { position: absolute; z-index: 60; left: 18px; right: 18px; bottom: 94px; min-height: 48px; border-radius: 14px; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 9px; padding: 11px 13px; font-size: 11px; box-shadow: 0 12px 30px rgba(25,35,30,.26); animation: toast-in .25s ease-out both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.busy-overlay { position: absolute; z-index: 55; inset: 0; background: rgba(31,45,38,.82); color: white; display: grid; place-items: center; text-align: center; }
.busy-overlay .analyzing-ring { border-color: rgba(255,255,255,.25); border-top-color: var(--gold); }
.busy-overlay p { margin: 0; font-size: 12px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.6; }

@media (max-width: 390px) {
  .app-shell { width: 100vw; height: 100svh; box-shadow: none; }
}
@media (min-width: 700px) {
  body { padding-top: 24px; }
  .app-shell { border-radius: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* V2 · 温馨自然 iOS 视觉系统
   Form: 大图是每一餐的视觉锚点；暖米白的留白让健康信息更适合长辈阅读。 */
:root { --paper:#faf6ee; --paper-deep:#f2eadc; --surface:#fffdf9; --ink:#20211d; --muted:#6f6c64; --line:#ece3d6; --green:#3e6555; --green-soft:#e6f0e9; --clay:#bd654a; --clay-soft:#f8e7df; --gold:#ed9849; --good:#41705b; --warn:#ae702e; --shadow:0 10px 28px rgba(78,58,37,.08); }
html, body { background:#ebe6dd; }
body, button, input, textarea, select { font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline-color:rgba(237,152,73,.8); }
.icon { stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.app-shell { background:linear-gradient(180deg,#fffdf9 0%,var(--paper) 62%,#f7efe3 100%); box-shadow:0 20px 54px rgba(75,59,37,.13); }
.screen { animation-duration:.22s; }
.scroll { padding:20px 18px 122px; }
.scroll.secondary { padding-top:12px; }
.display, .hero-copy h2, .section-title h2, .recipe-card h3, .scan-copy h2 { font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif; font-weight:800; letter-spacing:-.045em; }
h1.display { margin:20px 0 10px; font-size:31px; line-height:1.22; } h2.display { font-size:25px; } h3.display { font-size:21px; }
.eyebrow { color:var(--clay); font-size:12px; font-weight:750; letter-spacing:.09em; }.brand{font-size:20px;letter-spacing:.08em}.lead{font-size:15px;line-height:1.65}.date-note,.subtle{font-size:13px}.avatar{box-shadow:inset 0 0 0 3px rgba(255,255,255,.58),0 3px 12px rgba(38,43,35,.12)}.avatar-copy strong{font-size:14px}.avatar-copy small{font-size:11px}
.member-strip{gap:9px;padding:14px 0 4px}.member-pill{min-height:46px;padding:6px 12px 6px 6px;border-color:transparent;background:rgba(255,255,255,.86);box-shadow:0 3px 12px rgba(70,52,31,.05)}.member-pill.active{background:var(--ink);border-color:var(--ink)}.member-pill span{font-size:13px}
.status-row{gap:8px;margin-top:15px}.tag{padding:7px 10px;border-color:transparent;background:#f2ede5;font-size:12px;font-weight:650}.tag.strong{background:var(--ink);border-color:var(--ink)}.tag.good{background:var(--green-soft);color:#35614d}.tag.warn,.tag.adjust{background:#f8ead3;color:#8c5a23}.tag.bad{background:var(--clay-soft);color:#984630}
.hero-meal{min-height:312px;margin-top:18px;border-radius:28px;background:var(--ink);box-shadow:var(--shadow)}.hero-meal img{inset:0;width:100%;height:100%;transform:scale(1.01)}.hero-meal::after{background:linear-gradient(180deg,rgba(18,20,16,.02) 19%,rgba(18,20,16,.18) 40%,rgba(18,20,16,.84) 100%)}.hero-copy{width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-end;padding:22px}.hero-copy .kicker{color:#fff4e9;font-size:12px}.hero-copy h2{font-size:27px;margin:8px 0 7px}.hero-copy p{max-width:290px;font-size:13px;color:rgba(255,255,255,.85);margin-bottom:15px}
.section-title{margin:28px 0 13px}.section-title h2{font-size:22px}.section-title button,.text-btn{font-size:13px;color:var(--clay)}.primary,.secondary-btn,.ghost-btn,.icon-btn{min-height:48px;font-size:14px}.primary{border-radius:15px;background:var(--gold);color:#39220e;box-shadow:0 5px 12px rgba(201,110,44,.18)}.primary.dark{background:var(--ink)}.primary.clay{background:var(--clay)}.secondary-btn{border-radius:15px;border-color:#dfd3c3;background:rgba(255,255,255,.72);color:var(--ink)}.ghost-btn{border-radius:15px;background:#f8f3eb;border-color:transparent}.icon-btn{background:rgba(255,255,255,.9);border-color:transparent;box-shadow:0 3px 12px rgba(43,37,29,.12)}.button-row{gap:10px}
.quick-grid{gap:11px}.quick-card,.quick-card:nth-child(1),.quick-card:nth-child(2){min-height:118px;border:0;border-radius:22px;padding:16px;background:rgba(255,255,255,.84);box-shadow:0 5px 18px rgba(76,58,39,.06)}.quick-card strong{font-size:16px;margin-bottom:7px}.quick-card small{font-size:12px;line-height:1.5}.quick-card .mini-link{margin-top:10px;font-size:11px;color:var(--clay)}.care-note{margin-top:19px;padding:15px 16px;border:0;border-radius:18px;background:#f8eadf;color:#654f43;font-size:13px;line-height:1.65}
.bottom-nav{left:12px;right:12px;bottom:12px;height:72px;padding:5px 7px;border:1px solid rgba(255,255,255,.8);border-radius:23px;background:rgba(255,253,249,.88);box-shadow:0 9px 30px rgba(64,48,28,.15);backdrop-filter:blur(18px)}.nav-item{min-height:58px;font-size:11px;color:#8c887f;gap:3px}.nav-item.active{color:var(--ink)}.nav-item.scan{transform:translateY(-14px)}.nav-item.scan .nav-icon{width:56px;height:56px;border-radius:19px;background:var(--gold);color:#3b220c;box-shadow:0 7px 18px rgba(197,113,48,.28)}.nav-item.scan.active .nav-icon{background:var(--clay);color:#fff}
.backbar{min-height:58px}.backbar h1{font-size:18px}.backbar .back{border-radius:50%;background:rgba(255,255,255,.85);box-shadow:0 2px 10px rgba(58,43,26,.08)}.searchbox{min-height:50px;border:0;border-radius:17px;background:#f0ece4;padding:0 15px}.searchbox input{font-size:15px}.chips{gap:9px;padding-top:14px}.chip{min-height:38px;padding:0 14px;border:0;background:#f1ede6;font-size:13px}.chip.active{background:var(--ink);border-color:var(--ink)}.video-entry{margin-top:17px;padding:16px;border-radius:22px;background:linear-gradient(135deg,#c66d50,#a9543d);box-shadow:0 8px 20px rgba(171,80,52,.17)}.video-entry .icon-wrap{width:46px;height:46px;border-radius:15px}.video-entry strong{font-size:16px}.video-entry small{font-size:12px;line-height:1.5}
.recipe-list{display:grid;gap:13px}.recipe-card{grid-template-columns:128px 1fr;min-height:148px;border:0;border-radius:24px;background:var(--surface);box-shadow:0 6px 20px rgba(75,55,35,.07)}.recipe-card img{width:128px}.recipe-card-copy{padding:15px 14px 12px}.recipe-card h3{margin-bottom:8px;font-size:19px}.recipe-meta{font-size:12px}.recipe-card p{font-size:12px;line-height:1.5}
.detail-hero{height:296px;margin:0 -18px;border-radius:0 0 28px 28px}.detail-hero::after{background:linear-gradient(180deg,rgba(18,18,16,.06) 24%,rgba(18,18,16,.78) 100%)}.detail-title{bottom:22px}.detail-title h1{font-family:inherit;font-size:31px;font-weight:800}.detail-title p{font-size:13px}.detail-actions{padding:17px 0}.servings{font-size:14px}.round-mini{width:36px;height:36px;border:0;background:#f1ede6;font-size:17px}.detail-tabs{margin:8px -2px 0;padding:4px;border:0;border-radius:15px;background:#f0ece5}.detail-tabs button{min-height:40px;border-radius:12px;font-size:13px}.detail-tabs button.active{color:var(--ink);background:#fff;box-shadow:0 2px 8px rgba(55,43,28,.08)}.ingredient-group h3,.step-row h3{font-size:16px}.ingredient-row{min-height:44px;font-size:14px}.step-row{grid-template-columns:34px 1fr;padding:18px 0}.step-num{color:var(--clay)}.step-row p,.reason-box p{font-size:13px;line-height:1.65}.reason-box{border-radius:20px;background:var(--green-soft)}
.scan-stage{height:318px;margin-top:20px;border-radius:28px;background:var(--ink)}.scan-stage::after{inset:19px;border-radius:21px}.scan-copy h2{font-size:25px}.scan-copy p{font-size:13px}.scan-copy .camera-disc{background:var(--gold);color:#3b220c}.capture-option{min-height:84px;border:0;border-radius:18px;background:rgba(255,255,255,.85);font-size:12px;box-shadow:0 4px 14px rgba(76,58,39,.05)}.guidance-row{font-size:13px}.result-photo{height:238px;margin:0 -18px;border-radius:0 0 28px 28px}.result-badge{font-size:13px}.result-title h1{font-size:29px}.result-title p,.explain-block p{font-size:13px;line-height:1.65}
.family-intro{padding:18px 0}.family-intro h1,.plan-member h1{font-size:27px}.family-intro p,.plan-member p,.member-card p{font-size:12px}.member-card{min-height:78px;padding:14px 2px}.member-card h3{font-size:16px}.plan-quote{border-radius:24px;background:linear-gradient(135deg,#ff7b30,#f2581d);padding:20px}.plan-quote h2{font-size:22px}.plan-quote p{font-size:13px;line-height:1.65}.plan-section h3{font-size:16px}.segmented{padding:4px;border:0;border-radius:16px;background:#f0ece5}.segmented button{min-height:42px;border-radius:12px;font-size:13px}.segmented button.active{color:var(--ink);box-shadow:0 2px 9px rgba(65,49,30,.09)}.fridge-summary{gap:10px}.fridge-stat{padding:14px 10px;border:0;border-radius:18px;background:#fff;box-shadow:0 4px 13px rgba(70,54,35,.05)}.fridge-stat strong{font-family:inherit;font-size:25px;color:var(--ink)}.fridge-stat small{font-size:11px}.pantry-row{min-height:64px}.pantry-row h3{font-size:15px}.pantry-row p,.pantry-row .qty{font-size:12px}
.sheet-backdrop{background:rgba(34,33,28,.3);backdrop-filter:blur(3px)}.sheet{max-height:80%;border-radius:28px 28px 0 0;padding:14px 20px max(28px,env(safe-area-inset-bottom))}.sheet-title h2{font-size:22px}.sheet-copy{margin:0 0 16px;color:var(--muted);font-size:13px;line-height:1.55}.sheet-member{min-height:70px}.sheet-member strong{font-size:15px}.sheet-member small,.field label{font-size:12px}.field input,.field select{min-height:48px;border-radius:14px;border-color:#e8e0d4;font-size:15px}.toast{left:22px;right:22px;bottom:98px;min-height:52px;border-radius:17px;font-size:13px}.empty{font-size:14px}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration:.01ms !important; transition-duration:.01ms !important; } }

/* V4 · layout follows the supplied food-app reference, while colour tokens stay on V2. */
.scroll { padding:24px 18px 116px; }
.home-v4 { padding-bottom:4px; }
.v4-topbar { display:flex; align-items:center; justify-content:space-between; }
.v4-profile { display:flex; align-items:center; gap:10px; }
.v4-profile .avatar { width:43px; height:43px; box-shadow:inset 0 0 0 3px rgba(255,255,255,.65),0 4px 12px rgba(52,44,33,.1); }
.v4-profile span { display:grid; gap:1px; }
.v4-profile small { color:var(--muted); font-size:11px; }
.v4-profile strong { color:var(--ink); font-size:18px; }
.v4-alert { width:46px; height:46px; display:grid; place-items:center; border:0; border-radius:50%; background:#fff; color:var(--clay); box-shadow:0 4px 14px rgba(70,52,31,.07); }
.v4-greeting { margin:27px 0 7px; color:var(--clay); font-size:13px; }
.v4-title { margin:0; color:var(--ink); font-size:31px; line-height:1.22; letter-spacing:-.055em; font-weight:850; }
.v4-search { width:100%; min-height:54px; display:flex; align-items:center; gap:11px; margin-top:23px; padding:0 14px; border:0; border-radius:17px; background:#fff; color:#8d8579; text-align:left; font-size:14px; box-shadow:0 5px 17px rgba(70,52,31,.06); }
.v4-search .icon { color:var(--ink); }.v4-filter { width:30px; height:30px; margin-left:auto; display:grid; place-items:center; border-radius:10px; background:var(--clay-soft); color:var(--clay); }
.v4-category-scroll { display:flex; gap:11px; overflow-x:auto; margin:21px -18px 0; padding:0 18px 4px; scrollbar-width:none; }.v4-category-scroll::-webkit-scrollbar{display:none}
.v4-category { flex:0 0 60px; min-height:74px; display:grid; justify-items:center; align-content:center; gap:7px; padding:0; border:0; border-radius:18px; background:transparent; color:var(--muted); font-size:11px; }.v4-category>span { width:44px; height:44px; display:grid; place-items:center; border-radius:15px; background:#fff; color:var(--clay); box-shadow:0 4px 12px rgba(70,52,31,.05); }.v4-category small{font-size:11px}.v4-category.active>span { background:var(--gold); color:#4d3215; box-shadow:0 6px 15px rgba(217,149,65,.19); }.v4-category.active { color:var(--ink); font-weight:850; }
.v4-section-title { display:flex; align-items:center; justify-content:space-between; margin:27px 0 13px; }.v4-section-title h2 { margin:0; color:var(--ink); font-size:24px; letter-spacing:-.04em; }.v4-section-title button { display:flex; align-items:center; gap:2px; border:0; background:transparent; color:var(--clay); font-size:12px; font-weight:750; }
.v4-recipe-grid { display:grid; grid-template-columns:1fr 1fr; gap:13px; }.v4-recipe-card { min-width:0; padding:0; border:0; background:transparent; text-align:left; color:var(--ink); }.v4-image { position:relative; display:block; height:162px; overflow:hidden; border-radius:22px; background:#eee5d7; box-shadow:0 7px 18px rgba(70,52,31,.08); }.v4-image img{width:100%;height:100%;object-fit:cover}.v4-image em{position:absolute;right:8px;bottom:8px;padding:5px 7px;border-radius:999px;background:rgba(255,253,249,.93);color:var(--clay);font-size:10px;font-style:normal;font-weight:800}.v4-recipe-card strong{display:block;margin:9px 2px 4px;font-size:16px;line-height:1.3}.v4-recipe-card small{display:-webkit-box;margin:0 2px;color:var(--muted);font-size:11px;line-height:1.45;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.v4-family-note { width:100%; display:grid; grid-template-columns:37px 1fr 25px; gap:10px; align-items:center; margin-top:24px; padding:14px; border:0; border-radius:19px; background:var(--green-soft); color:var(--ink); text-align:left; }.v4-family-note>span:first-child { width:35px; height:35px; display:grid; place-items:center; border-radius:12px; background:#fff; color:var(--clay); }.v4-family-note strong,.v4-family-note small{display:block}.v4-family-note strong{margin-bottom:3px;font-size:14px}.v4-family-note small{color:#52695d;font-size:12px;line-height:1.4}.v4-family-note>.icon{justify-self:end;color:var(--clay)}
.bottom-nav { left:12px; right:12px; bottom:12px; height:72px; padding:5px 7px; border:1px solid rgba(255,255,255,.8); border-radius:23px; background:rgba(255,253,249,.94); box-shadow:0 9px 30px rgba(64,48,28,.15); }.nav-item{font-size:10px;color:#8c857b}.nav-item.active{color:var(--ink)}.nav-item.scan{transform:translateY(-14px)}.nav-item.scan .nav-icon{width:54px;height:54px;border-radius:18px;background:var(--gold);color:#452c13;box-shadow:0 7px 17px rgba(200,124,47,.25)}.nav-item.scan.active .nav-icon{background:var(--clay);color:#fff}
@media (max-width:360px){.v4-title{font-size:29px}.v4-image{height:148px}.v4-category{flex-basis:57px}}

/* V5 · 暖橙家庭照护视觉系统 */
:root {
  --paper: #fffaf5;
  --paper-deep: #f8eee4;
  --surface: #ffffff;
  --ink: #30201a;
  --muted: #786c65;
  --line: #f1e4d8;
  --green: #ff6724;
  --green-soft: #edf8e9;
  --clay: #ef5516;
  --clay-soft: #fff0e8;
  --gold: #ff9f2f;
  --good: #54af36;
  --warn: #ee921b;
  --bad: #e25f4d;
  --expert: #8b6ae1;
  --shadow: 0 10px 30px rgba(117, 67, 26, .09);
}

html, body { background: #f1ece7; }
body, button, input, textarea, select { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
button { transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease; }
button:active { transform: scale(.985); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline-color: rgba(255, 103, 36, .62); }
.app-shell { background: linear-gradient(180deg, #fffdfb 0%, var(--paper) 100%); box-shadow: 0 20px 54px rgba(79, 49, 28, .14); }
.scroll { padding: 24px 18px 118px; }
.scroll.secondary { padding-top: 8px; }
.display, .hero-copy h2, .section-title h2, .recipe-card h3, .scan-copy h2 { font-family: inherit; font-weight: 850; letter-spacing: -.055em; }
h1.display { font-size: 30px; line-height: 1.17; }
h2.display { font-size: 24px; }
h3.display { font-size: 20px; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.brand { color: var(--ink); letter-spacing: -.04em; }
.lead { color: var(--muted); font-size: 13px; line-height: 1.65; }
.subtle, .date-note { color: var(--muted); }

.avatar { overflow: hidden; background: #fff; color: transparent; box-shadow: inset 0 0 0 1px var(--line), 0 3px 10px rgba(101, 70, 41, .08); }
.avatar img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }
.avatar.lg { width: 70px; height: 70px; }
.avatar.sm { width: 34px; height: 34px; }
.avatar-button { gap: 8px; }
.avatar-copy strong { color: var(--ink); }

.member-strip { gap: 9px; padding: 15px 0 4px; }
.member-pill { min-height: 48px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px 6px 6px; box-shadow: 0 5px 15px rgba(87, 54, 25, .04); }
.member-pill.active { background: var(--green); border-color: var(--green); color: #fff; }
.member-pill.active .avatar { background: rgba(255,255,255,.88); }
.member-pill span { font-size: 13px; }

.primary, .secondary-btn, .ghost-btn, .icon-btn { min-height: 46px; border-radius: 16px; font-size: 14px; }
.primary, .primary.dark, .primary.clay { background: linear-gradient(135deg, #ff7b2e, #f25717); color: #fff; box-shadow: 0 8px 18px rgba(234, 86, 22, .2); }
.secondary-btn { border-color: #f2d9c8; background: #fff; color: var(--green); }
.ghost-btn { border-color: var(--line); background: #fffaf6; color: var(--ink); }
.icon-btn { border-color: var(--line); background: #fff; color: var(--ink); box-shadow: 0 4px 12px rgba(86, 56, 31, .07); }
.text-btn, .section-title button { color: var(--green); }
.tag { border: 1px solid #f5e3d7; background: #fff8f2; color: #75655b; font-size: 11px; font-weight: 750; }
.tag.strong { background: var(--green); border-color: var(--green); }
.tag.good { background: #edf8e9; color: #45952d; }
.tag.warn, .tag.adjust { background: #fff3e2; color: #df7e13; }
.tag.bad { background: #ffebea; color: #d25345; }
.tag.expert { background: #f2edff; color: #7959c8; }
.care-note { border: 1px solid #ffe0c6; border-left: 4px solid var(--green); border-radius: 18px; background: #fff8ef; color: #6b5548; }

.bottom-nav { left: 0; right: 0; bottom: 0; height: 84px; padding: 7px 10px max(8px, env(safe-area-inset-bottom)); border: 1px solid rgba(246, 232, 220, .95); border-radius: 26px 26px 0 0; background: rgba(255,255,255,.94); box-shadow: 0 -8px 28px rgba(104, 62, 27, .09); backdrop-filter: blur(18px); }
.nav-item { min-height: 58px; color: #8c8580; font-size: 11px; }
.nav-item.active { color: var(--green); }
.nav-item.scan { transform: translateY(-19px); }
.nav-item.scan .nav-icon, .nav-item.scan.active .nav-icon { width: 62px; height: 62px; border-radius: 50%; background: linear-gradient(135deg, #ff893a, #f35717); color: #fff; box-shadow: 0 8px 18px rgba(229, 80, 19, .3), 0 0 0 8px rgba(255,255,255,.88); }
.nav-item.scan .icon { width: 28px; height: 28px; }

.backbar { min-height: 56px; }
.backbar h1 { color: var(--ink); font-size: 18px; }
.backbar .back { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 3px 10px rgba(84, 51, 24, .07); }
.searchbox { min-height: 50px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 5px 16px rgba(99, 58, 23, .04); }
.searchbox input { font-size: 14px; }
.voice-button { background: #fff0e6; color: var(--green); }
.voice-button:hover { background: #ffe5d5; }
.voice-button.listening { background: var(--green); }
.chips { padding: 14px 0 4px; }
.chip { min-height: 38px; border: 1px solid #f3e6dd; background: #fffaf7; color: #695e58; font-size: 13px; }
.chip.active { background: #fff5ef; border-color: var(--green); color: var(--green); }

.video-entry { margin-top: 18px; border-radius: 24px; background: linear-gradient(135deg, #ca4a14, #f4772b); box-shadow: 0 10px 20px rgba(218, 82, 20, .19); }
.video-entry .icon-wrap { background: rgba(255,255,255,.2); }
.recipe-list { gap: 13px; }
.recipe-card { grid-template-columns: 124px 1fr; min-height: 144px; border: 1px solid #f6e9df; border-radius: 22px; background: #fff; box-shadow: 0 5px 17px rgba(83, 50, 23, .05); }
.recipe-card img { width: 124px; }
.recipe-card-copy { padding: 14px 13px 12px; }
.recipe-card h3 { color: var(--ink); font-size: 19px; }
.recipe-meta, .recipe-card p { color: var(--muted); }

.detail-hero { border-radius: 0 0 28px 28px; }
.detail-hero::after { background: linear-gradient(180deg, rgba(38,20,8,.04) 25%, rgba(38,20,8,.78) 100%); }
.detail-title h1 { font-family: inherit; font-weight: 850; }
.detail-actions { border-color: var(--line); }
.round-mini { border-color: var(--line); background: #fff8f2; color: var(--green); }
.detail-tabs { background: #fff4eb; border-radius: 16px; border: 0; padding: 4px; }
.detail-tabs button { border-radius: 12px; }
.detail-tabs button.active { color: var(--green); background: #fff; box-shadow: 0 3px 8px rgba(107, 57, 18, .08); }
.ingredient-row, .step-row { border-color: var(--line); }
.reason-box { background: #fff4ea; border: 1px solid #ffe0ca; border-radius: 20px; }
.step-num { color: var(--green); }

.scan-stage { height: 320px; border-radius: 28px; background: #4c2413; }
.scan-stage img { opacity: .58; }
.scan-stage::after { inset: 20px; border: 3px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(85, 35, 13, .18); }
.scan-copy { padding-top: 132px; width: 265px; }
.scan-copy .camera-disc { width: 60px; height: 60px; background: var(--green); }
.scan-copy h2 { font-size: 22px; }
.scan-copy p { color: rgba(255,255,255,.92); }
.capture-option { min-height: 90px; border: 1px solid #f4e9df; border-radius: 20px; background: #fff; color: var(--ink); box-shadow: 0 5px 15px rgba(99, 58, 23, .04); }
.capture-option:first-child { background: linear-gradient(135deg, #ff7b2e, #f25617); border-color: transparent; color: #fff; }
.guidance-row b { color: var(--green); }

.segmented { background: #fff4ec; border: 1px solid #f5e5d8; border-radius: 18px; padding: 4px; }
.segmented button { border-radius: 14px; }
.segmented button.active { color: var(--green); background: #fff; box-shadow: 0 3px 8px rgba(105, 60, 25, .08); }
.fridge-summary { gap: 10px; }
.fridge-stat { border: 1px solid #f6e9df; border-radius: 18px; background: #fff; box-shadow: 0 5px 15px rgba(99, 58, 23, .04); }
.fridge-stat strong { color: var(--ink); }
.zone-title { color: var(--ink); }
.pantry-row { border-color: var(--line); }
.pantry-row h3 { color: var(--ink); }
.fridge-rec { border-color: var(--line); background: #fff; box-shadow: 0 5px 17px rgba(83, 50, 23, .04); }

.sheet-backdrop { background: rgba(65, 40, 22, .28); }
.sheet { background: #fffdfb; }
.sheet-handle { background: #f0c6aa; }
.field input, .field select { border-color: #f1e3d8; background: #fff; }
.toast { background: #3b261a; }
.busy-overlay { background: rgba(67, 35, 16, .78); }

/* V5 首页 */
.v5-home-head { display: grid; grid-template-columns: 42px 1fr 44px; align-items: center; gap: 9px; }
.v5-home-head h1 { margin: 0; color: var(--ink); font-size: 31px; letter-spacing: -.065em; line-height: 1.1; }
.v5-page-head { display: grid; grid-template-columns: 48px 1fr 44px; align-items: center; gap: 10px; min-height: 50px; }
.v5-page-head h1 { margin: 0; color: var(--ink); font-size: 31px; letter-spacing: -.065em; line-height: 1.1; }
.v5-page-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, #ffae40, #ff6b26); color: #fff; box-shadow: 0 6px 14px rgba(238, 93, 22, .18); }
.v5-sun { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 14px; color: var(--green); background: #fff1e6; }
.v5-bell { width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--ink); box-shadow: 0 3px 12px rgba(88, 54, 24, .08); }
.v5-hero { width: 100%; min-height: 232px; margin-top: 16px; position: relative; overflow: hidden; display: block; border: 1px solid #f4e5d9; border-radius: 28px; padding: 0; background: #fff3e6; text-align: left; color: var(--ink); box-shadow: var(--shadow); }
.v5-hero img { position: absolute; inset: 0 0 0 42%; width: 58%; height: 100%; object-fit: cover; }
.v5-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #fffaf4 0 32%, rgba(255,250,244,.92) 48%, rgba(255,250,244,.15) 74%); }
.v5-hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; width: 66%; min-height: 232px; padding: 22px 8px 20px 20px; }
.v5-hero-copy small { color: var(--green); font-size: 11px; font-weight: 800; }
.v5-hero-copy strong { margin-top: 9px; font-size: 27px; line-height: 1.18; letter-spacing: -.06em; }
.v5-hero-copy p { margin: 9px 0 15px; color: #6f625a; font-size: 11px; line-height: 1.55; }
.v5-hero-copy b { width: max-content; display: inline-flex; align-items: center; gap: 3px; padding: 10px 13px; border-radius: 50px; background: var(--green); color: #fff; font-size: 13px; }
.v5-hero-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.v5-hero-tags em { padding: 5px 7px; border-radius: 8px; background: #eff8ea; color: #58a53b; font-size: 10px; font-style: normal; }
.v5-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 25px 0 12px; }
.v5-section-head h2 { margin: 0; color: var(--ink); font-size: 21px; letter-spacing: -.04em; }
.v5-section-head button { border: 0; background: transparent; color: #78635a; font-size: 12px; }
.v5-plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.v5-plan-card { min-height: 119px; padding: 12px 10px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid #f5e8de; border-radius: 20px; background: #fff; text-align: left; color: var(--ink); box-shadow: 0 5px 14px rgba(90, 55, 25, .04); }
.v5-plan-card > .icon:first-child { width: 23px; height: 23px; color: var(--green); }
.v5-plan-card strong { margin-top: auto; font-size: 13px; line-height: 1.25; }
.v5-plan-card small { min-height: 28px; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.v5-plan-card > .icon:last-child { align-self: flex-end; margin-top: -16px; color: var(--green); }
.v5-care-card { width: 100%; display: grid; grid-template-columns: 42px 1fr 20px; gap: 11px; align-items: center; margin-top: 18px; padding: 15px; border: 1px solid #f7e4d6; border-radius: 22px; background: #fffdfb; text-align: left; color: var(--ink); }
.v5-care-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; background: #fff1e6; color: var(--green); }
.v5-care-card strong, .v5-care-card b, .v5-care-card small { display: block; }
.v5-care-card strong { font-size: 12px; }
.v5-care-card b { margin: 3px 0; color: var(--green); font-size: 16px; }
.v5-care-card small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.v5-ingredient-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.v5-ingredient-row button { min-height: 92px; display: grid; align-content: center; justify-items: center; gap: 5px; border: 1px solid #f5e8de; border-radius: 18px; background: #fff; color: var(--ink); }
.v5-ingredient-row span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 11px; background: #fff3e7; color: var(--green); }
.v5-ingredient-row strong { font-size: 12px; }
.v5-ingredient-row small { color: var(--muted); font-size: 10px; }

/* V5 家庭中心 */
.v5-family > .v5-home-top { margin-bottom: 17px; }
.v5-profile-list { border-top: 1px solid #eadfd3; }
.v5-profile-row { width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr) 18px; gap: 12px; align-items: center; padding: 16px 3px 16px 0; border: 0; border-bottom: 1px solid #eadfd3; background: transparent; color: var(--ink); text-align: left; }
.v5-profile-row.selected { background: linear-gradient(90deg, rgba(255, 246, 238, .72), transparent 74%); }
.v5-profile-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 3px solid rgba(255,255,255,.88); border-radius: 50%; background: var(--member-color); color: #fff; font-size: 15px; font-weight: 850; box-shadow: 0 3px 9px color-mix(in srgb, var(--member-color) 28%, transparent); }
.v5-profile-copy { min-width: 0; display: grid; gap: 5px; }
.v5-profile-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v5-profile-name strong { font-size: 17px; line-height: 1; }
.v5-profile-name em { padding: 5px 8px; border-radius: 999px; background: #f5f0e9; color: #766b62; font-size: 10px; font-style: normal; white-space: nowrap; }
.v5-profile-copy > small { overflow: hidden; color: #766b62; font-size: 12px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.v5-profile-progress { display: grid; grid-template-columns: 78px auto; gap: 8px; align-items: center; }
.v5-profile-progress i { height: 4px; overflow: hidden; border-radius: 999px; background: #e8e2d9; }
.v5-profile-progress b { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.v5-profile-progress small { color: #847a70; font-size: 10px; white-space: nowrap; }
.v5-profile-row > .icon { width: 17px; height: 17px; color: #5f564f; }
.v5-add-member { width: 100%; min-height: 48px; margin-top: 16px; border: 1px solid #e5d4c5; border-radius: 15px; background: #fffdfb; color: #3e352e; font-size: 15px; font-weight: 700; }

@media (max-width: 360px) {
  .v5-home-head h1 { font-size: 28px; }
  .v5-hero-copy strong { font-size: 24px; }
  .v5-profile-row { grid-template-columns: 44px minmax(0, 1fr) 17px; gap: 9px; }
  .v5-profile-mark { width: 39px; height: 39px; }
}

/* V5 primary-screen coverage: recipe library, recognition and pantry */
body[data-route="recipes"] .v5-recipes > .v5-home-top { margin-bottom: 18px; }
body[data-route="recipes"] .v5-recipe-import { display: grid; gap: 11px; padding: 14px; border: 1px solid #f4dfd0; border-radius: 25px; background: rgba(255,253,250,.72); box-shadow: 0 8px 24px rgba(102, 55, 20, .045); }
body[data-route="recipes"] .v5-link-field { min-height: 55px; display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid #f4cdb2; border-radius: 18px; background: #fffdfb; color: #8c7f76; text-align: left; }
body[data-route="recipes"] .v5-link-field > span, body[data-route="recipes"] .v5-link-field > i { display: grid; place-items: center; color: #8d8077; font-style: normal; }
body[data-route="recipes"] .v5-link-field strong { overflow: hidden; font-size: 15px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
body[data-route="recipes"] .v5-link-field .icon { width: 23px; height: 23px; }
body[data-route="recipes"] .v5-generate-button { min-height: 52px; display: grid; grid-template-columns: 1fr 34px; align-items: center; padding: 0 10px 0 44px; border: 0; border-radius: 18px; background: linear-gradient(100deg, #d24a13, #f16921); color: #fff; box-shadow: 0 9px 20px rgba(214, 73, 17, .18); }
body[data-route="recipes"] .v5-generate-button strong { font-size: 17px; letter-spacing: .05em; }
body[data-route="recipes"] .v5-generate-button span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.16); }
body[data-route="recipes"] .v5-generate-button .icon { width: 19px; height: 19px; }
body[data-route="recipes"] .v5-recipe-search { margin-top: 16px; min-height: 52px; border: 1px solid #f1e3d8; border-radius: 999px; background: #fff; box-shadow: 0 6px 18px rgba(92, 54, 27, .05); }
body[data-route="recipes"] .v5-recipe-search > .icon { width: 24px; height: 24px; color: #7d736c; }
body[data-route="recipes"] .v5-recipe-search input { font-size: 14px; }
body[data-route="recipes"] .v5-recipe-search .voice-button { background: transparent; color: #8a7f76; }
body[data-route="recipes"] .v5-filter-group { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 14px; }
body[data-route="recipes"] .v5-filter-group + .v5-filter-group { margin-top: 5px; }
body[data-route="recipes"] .v5-filter-group > strong { color: #322a25; font-size: 16px; }
body[data-route="recipes"] .v5-filter-group > div { min-width: 0; display: flex; gap: 7px; overflow-x: auto; padding: 2px 1px 4px; scrollbar-width: none; }
body[data-route="recipes"] .v5-filter-group > div::-webkit-scrollbar { display: none; }
body[data-route="recipes"] .chip { min-height: 38px; padding: 0 13px; border: 1px solid #f1e4dc; border-radius: 999px; background: #fffaf6; color: #4f4640; font-size: 12px; }
body[data-route="recipes"] .chip.active { border-color: #f26522; background: #fff9f4; color: #f05b1b; box-shadow: 0 3px 9px rgba(232, 90, 27, .07); }
body[data-route="recipes"] .recipe-list { gap: 10px; margin-top: 14px; }
body[data-route="recipes"] .recipe-card { position: relative; height: 120px; min-height: 120px; grid-template-columns: 112px 1fr; border: 1px solid #f3e6dc; border-radius: 19px; background: #fff; box-shadow: 0 5px 15px rgba(83, 50, 23, .045); }
body[data-route="recipes"] .recipe-card > img { width: 112px; }
body[data-route="recipes"] .recipe-card-copy { position: relative; display: flex; flex-direction: column; justify-content: flex-start; overflow: hidden; padding: 13px 27px 8px 12px; }
body[data-route="recipes"] .recipe-card h3 { margin-bottom: 6px; color: #332a24; font-size: 19px; line-height: 1.16; }
body[data-route="recipes"] .recipe-tags { display: flex; flex-wrap: nowrap; gap: 4px; overflow: hidden; }
body[data-route="recipes"] .recipe-tags .tag { padding: 4px 6px; border-color: #f3ccb2; border-radius: 6px; background: #fffaf6; color: #f15f20; font-size: 10px; }
body[data-route="recipes"] .recipe-tags .tag.good { border-color: #d9e9cc; background: #f3faed; color: #4b8839; }
body[data-route="recipes"] .recipe-ingredients { display: block; margin-top: 6px; overflow: hidden; color: #665b53; font-size: 11px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
body[data-route="recipes"] .recipe-card p { margin-top: 5px; color: #655b54; font-size: 11px; line-height: 1.35; -webkit-line-clamp: 1; }
body[data-route="recipes"] .recipe-arrow { position: absolute; right: 9px; top: 50%; display: grid; place-items: center; color: #f15e1e; transform: translateY(-50%); }
body[data-route="recipes"] .recipe-arrow .icon { width: 21px; height: 21px; }
body[data-route="recipes"] .recipe-card.featured { display: block; height: 184px; min-height: 184px; overflow: hidden; background: #fff8f1; }
body[data-route="recipes"] .recipe-card.featured > img { position: absolute; inset: 0 0 0 39%; width: 61%; height: 100%; object-fit: cover; }
body[data-route="recipes"] .recipe-card.featured::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, #fffaf5 0 34%, rgba(255,250,245,.92) 49%, rgba(255,250,245,.05) 79%); }
body[data-route="recipes"] .recipe-card.featured .recipe-card-copy { z-index: 1; justify-content: flex-start; width: 68%; min-height: 184px; padding: 17px 10px 12px 20px; }
body[data-route="recipes"] .recipe-card.featured h3 { margin-bottom: 9px; font-size: 24px; }
body[data-route="recipes"] .recipe-card.featured .recipe-tags .tag { padding: 4px 6px; font-size: 10px; }
body[data-route="recipes"] .recipe-card.featured .recipe-ingredients { margin-top: 8px; font-size: 11px; }
body[data-route="recipes"] .recipe-card.featured p { max-width: 84%; margin-top: 7px; font-size: 11px; line-height: 1.45; white-space: normal; -webkit-line-clamp: 2; }
body[data-route="recipes"] .recipe-card.featured .recipe-arrow { right: auto; top: auto; bottom: 12px; left: 20px; width: 30px; height: 30px; border: 1px solid #f3ba91; border-radius: 50%; background: rgba(255,255,255,.7); transform: none; }
body[data-route="recipes"] .recipe-card.featured .recipe-arrow .icon { width: 17px; height: 17px; }

body[data-route="scan"] .v5-scan > .v5-home-top { margin-bottom: 16px; }
body[data-route="scan"] .scan-stage { position: relative; height: min(58vw, 228px); margin-top: 0; overflow: hidden; border-radius: 24px; background: #4b2514; }
body[data-route="scan"] .scan-stage > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
body[data-route="scan"] .scan-stage::after { content: ""; position: absolute; inset: 0; border: 0; border-radius: 0; background: linear-gradient(180deg, rgba(42,22,13,.03) 45%, rgba(42,22,13,.36)); box-shadow: none; }
body[data-route="scan"] .scan-corner { position: absolute; z-index: 1; width: 30px; height: 30px; border-color: #fff; border-style: solid; border-width: 0; }
body[data-route="scan"] .scan-corner.tl { top: 21px; left: 22px; border-top-width: 4px; border-left-width: 4px; border-radius: 9px 0 0; }
body[data-route="scan"] .scan-corner.tr { top: 21px; right: 22px; border-top-width: 4px; border-right-width: 4px; border-radius: 0 9px 0 0; }
body[data-route="scan"] .scan-corner.bl { bottom: 21px; left: 22px; border-bottom-width: 4px; border-left-width: 4px; border-radius: 0 0 0 9px; }
body[data-route="scan"] .scan-corner.br { right: 22px; bottom: 21px; border-right-width: 4px; border-bottom-width: 4px; border-radius: 0 0 9px 0; }
body[data-route="scan"] .scan-tip { position: absolute; z-index: 2; left: 50%; bottom: clamp(43px, 13vw, 52px); width: min(80%, 280px); display: grid; place-items: center; gap: 3px; padding: 0; background: transparent; color: #fff; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.72); transform: translateX(-50%); }
body[data-route="scan"] .scan-tip strong { display: block; font-size: 22px; font-weight: 800; line-height: 1.25; }
body[data-route="scan"] .scan-tip small { display: block; font-size: 11px; font-weight: 600; line-height: 1.25; }
body[data-route="scan"] .capture-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
body[data-route="scan"] .capture-option { min-height: 72px; display: grid; grid-template-columns: 25px 1fr; align-items: center; gap: 5px; padding: 8px; border: 1px solid #f5e8de; border-radius: 18px; background: #fffaf7; color: var(--ink); font-size: 12px; text-align: center; }
body[data-route="scan"] .capture-option .icon { width: 25px; height: 25px; color: #f26620; }
body[data-route="scan"] .capture-option span { line-height: 1.2; }
body[data-route="scan"] .capture-option:first-child { background: linear-gradient(135deg, #ff7c2d, #f55518); color: #fff; }
body[data-route="scan"] .capture-option:first-child .icon { color: #fff; }
body[data-route="scan"] .scan-guidance { display: block; margin-top: 18px; padding: 15px 14px 10px; border: 1px solid #f5e7dc; border-radius: 22px; background: #fff; }
body[data-route="scan"] .scan-guidance h2, body[data-route="scan"] .v5-scan-recent-head h2 { margin: 0; color: var(--ink); font-size: 17px; }
body[data-route="scan"] .scan-guidance-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 10px; }
body[data-route="scan"] .guidance-row { min-height: 64px; display: grid; grid-template-columns: 32px 1fr 14px; align-items: center; gap: 7px; padding: 9px 5px; border-bottom: 1px solid #f3e8e0; color: #3f3934; font-size: 13px; }
body[data-route="scan"] .guidance-row:nth-child(odd) { border-right: 1px solid #f3e8e0; padding-right: 10px; }
body[data-route="scan"] .guidance-row:nth-child(even) { padding-left: 10px; }
body[data-route="scan"] .guidance-row:nth-last-child(-n+2) { border-bottom: 0; }
body[data-route="scan"] .guidance-row > i { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-style: normal; }
body[data-route="scan"] .guidance-row > i .icon { width: 19px; height: 19px; }
body[data-route="scan"] .guidance-row > i.good { background: #eff9e7; color: #70a953; }
body[data-route="scan"] .guidance-row > i.warn { background: #fff1e3; color: #f17a20; }
body[data-route="scan"] .guidance-row > i.blue { background: #edf4ff; color: #6e94dc; }
body[data-route="scan"] .guidance-row > i.purple { background: #f3edff; color: #956fd9; }
body[data-route="scan"] .guidance-row > .icon { width: 14px; height: 14px; color: #92877f; }
body[data-route="scan"] .v5-scan-recent-head { display: flex; align-items: center; justify-content: space-between; margin-top: 19px; }
body[data-route="scan"] .v5-scan-recent-head span { display: inline-flex; align-items: center; gap: 2px; color: #796e66; font-size: 11px; }
body[data-route="scan"] .v5-scan-recent-head .icon { width: 13px; height: 13px; }
body[data-route="scan"] .v5-scan-recent { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 9px; }
body[data-route="scan"] .v5-scan-recent button { min-width: 0; min-height: 78px; display: grid; grid-template-columns: 66px 1fr; gap: 8px; align-items: center; padding: 6px; border: 1px solid #f3e5db; border-radius: 15px; background: #fff; color: var(--ink); text-align: left; }
body[data-route="scan"] .v5-scan-recent img { width: 66px; height: 66px; border-radius: 11px; object-fit: cover; }
body[data-route="scan"] .v5-scan-recent strong, body[data-route="scan"] .v5-scan-recent small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body[data-route="scan"] .v5-scan-recent strong { font-size: 12px; }
body[data-route="scan"] .v5-scan-recent small { margin-top: 6px; color: #7d726a; font-size: 10px; }

body[data-route="fridge"] .segmented { margin-top: 22px; min-height: 56px; padding: 5px; border: 1px solid #f6e7dc; border-radius: 999px; background: #fffaf7; }
body[data-route="fridge"] .segmented button { min-height: 44px; border-radius: 999px; font-size: 16px; }
body[data-route="fridge"] .segmented button.active { color: #f2611f; background: #fff; box-shadow: 0 4px 13px rgba(105, 58, 25, .08); }
body[data-route="fridge"] .fridge-summary { margin-top: 22px; padding: 18px 8px; border: 1px solid #f6e8de; border-radius: 23px; background: #fff; }
body[data-route="fridge"] .fridge-stat { position: relative; padding: 8px 9px; border: 0; border-radius: 0; box-shadow: none; text-align: center; }
body[data-route="fridge"] .fridge-stat + .fridge-stat::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 1px; background: #f2e3d9; }
body[data-route="fridge"] .fridge-stat strong { color: var(--ink); font-size: 30px; }
body[data-route="fridge"] .fridge-stat small { margin-top: 4px; color: #675b54; font-size: 12px; }
body[data-route="fridge"] .button-row { margin-top: 18px; }
body[data-route="fridge"] .button-row > button { min-height: 55px; border-radius: 999px; }
body[data-route="fridge"] .zone-title { display: flex; align-items: center; gap: 10px; margin: 25px 0 9px; padding: 15px 14px; border: 1px solid #f6e9df; border-radius: 22px 22px 0 0; background: #fff; color: var(--ink); font-size: 23px; letter-spacing: -.04em; }
body[data-route="fridge"] .zone-title::before { content: ""; width: 11px; height: 24px; border-radius: 8px; background: linear-gradient(#74ce3b, #4eac31); }
body[data-route="fridge"] section:has(.zone-title) { overflow: hidden; border: 1px solid #f6e9df; border-radius: 22px; background: #fff; }
body[data-route="fridge"] section:has(.zone-title) .zone-title { margin: 0; border: 0; border-bottom: 1px solid #f5e9df; border-radius: 0; }
body[data-route="fridge"] .pantry-row { min-height: 79px; margin: 0 14px; }
body[data-route="fridge"] .pantry-row h3 { font-size: 18px; }
body[data-route="fridge"] .pantry-row .qty { font-size: 16px; }

  button, input, textarea, select { touch-action: manipulation; }
  button:active { opacity: .82; }
  button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(244, 97, 31, .42); outline-offset: 2px; }

  /* Fridge uses the same header hierarchy and vertical rhythm as home. */
  body[data-route="fridge"] .v5-fridge .segmented,
  body[data-route="fridge"] .v5-fridge .fridge-summary,
  body[data-route="fridge"] .v5-fridge .button-row,
  body[data-route="fridge"] .v5-fridge .care-note,
  body[data-route="fridge"] .v5-fridge .fridge-rec,
  body[data-route="fridge"] .v5-fridge section:has(.zone-title) { margin-top: 18px; }
  body[data-route="fridge"] .v5-fridge .segmented button.active { color: #f2611f; }
  body[data-route="fridge"] .v5-fridge .tag.good { background: #fff0e7; color: #e85a1d; }
  body[data-route="fridge"] .v5-fridge .care-note { border-left-color: #f26321; background: #fff8f3; }
  body[data-route="fridge"] .v5-fridge .zone-title::before { background: linear-gradient(#ff9552, #f15d1e); }
  body[data-route="fridge"] .v5-fridge .fridge-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-route="fridge"] .v5-fridge .fridge-rec { padding: 18px 16px 16px; border: 1px solid #f6e9df; border-radius: 20px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* V5 home: approved top hierarchy and content sequence */
.v5-home-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.v5-home-top > div > small { display: block; color: #d5633c; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.v5-home-top h1 { margin: 4px 0 0; color: var(--ink); font-size: 22px; letter-spacing: -.04em; }
.v5-current-member { min-width: 112px; display: grid; grid-template-columns: 1fr 14px; align-items: center; gap: 7px; padding: 2px 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.v5-current-member strong, .v5-current-member small { display: block; }
.v5-current-member strong { font-size: 13px; }
.v5-current-member small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.v5-member-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 11px; border-bottom: 1px solid #eee0d6; }
.v5-member-tab { min-width: 0; height: 36px; display: flex; align-items: center; justify-content: center; padding: 0 3px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: #6a5d55; font-size: 13px; font-weight: 800; }
.v5-member-tab.active { border-color: #f26423; color: #e9571c; }
.v5-home .v5-hero { margin-top: 18px; min-height: 220px; }
.v5-home .v5-hero-copy { min-height: 220px; }
.v5-today-head { margin-top: 26px; }
.v5-today-head h2::before, .v5-section-head h2::before { content: ""; display: inline-block; width: 6px; height: 23px; margin-right: 10px; border-radius: 6px; vertical-align: -4px; background: linear-gradient(#ff8b41, #f45c1e); }
.v5-meal-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.v5-meal-card { min-width: 0; min-height: 170px; display: flex; flex-direction: column; align-items: stretch; padding: 8px; border: 1px solid #f2e5dc; border-radius: 19px; background: #fff; color: var(--ink); text-align: left; box-shadow: 0 5px 15px rgba(97, 57, 24, .035); }
.v5-meal-top { display: grid; grid-template-columns: 22px 1fr 13px; align-items: center; gap: 3px; margin-bottom: 8px; }
.v5-meal-top .icon { width: 21px; height: 21px; color: #f7a11f; }
.v5-meal-card:nth-child(3) .v5-meal-top .icon { color: #7788da; }
.v5-meal-top strong { font-size: 15px; }
.v5-meal-top .icon:last-child { color: #6e625a; }
.v5-meal-card img { width: 100%; height: 54px; border-radius: 11px; object-fit: cover; }
.v5-meal-card > b { display: -webkit-box; margin-top: 7px; overflow: hidden; color: var(--ink); font-size: 14px; line-height: 1.2; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.v5-meal-card > small { display: -webkit-box; min-height: 16px; margin-top: 4px; overflow: hidden; color: #665b54; font-size: 10px; line-height: 1.4; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.v5-meal-card > em { width: max-content; max-width: 100%; margin-top: auto; padding: 4px 6px; overflow: hidden; border-radius: 7px; background: #fff2e9; color: #f45e1d; font-size: 12px; font-style: normal; white-space: nowrap; text-overflow: ellipsis; }
.v5-warning-card { width: 100%; min-height: 108px; display: block; margin-top: 16px; padding: 14px 16px; border: 1px solid #f3e5da; border-radius: 21px; background: #fffdfb; color: var(--ink); text-align: left; box-shadow: 0 6px 16px rgba(96, 55, 22, .035); }
.v5-warning-card strong, .v5-warning-card b, .v5-warning-card small, .v5-warning-card em { display: block; }
.v5-warning-card strong { font-size: 18px; }
.v5-warning-card b { margin-top: 4px; color: #f05a1d; font-size: 14px; }
.v5-warning-card small { display: -webkit-box; margin-top: 4px; overflow: hidden; color: #665b54; font-size: 10px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.v5-warning-card em { margin-top: 4px; color: #4f4944; font-size: 10px; font-style: normal; }
.v5-ingredient-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.v5-ingredient-row button { min-width: 0; min-height: 74px; padding: 5px 3px; border-radius: 13px; }
.v5-ingredient-row button img { width: 28px; height: 28px; border-radius: 9px; object-fit: cover; }
.v5-ingredient-row button strong { overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.v5-ingredient-row button small { font-size: 9px; }
.v5-ingredient-row .v5-more-ingredient { background: #fff5e9; }
.v5-more-ingredient span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: #c9872b; }
.v5-more-ingredient .icon { width: 30px; height: 30px; }
.bottom-nav { --nav-icon-size: clamp(25px, 7.2vw, 28px); }
.bottom-nav .nav-asset-icon { width: var(--nav-icon-size); height: var(--nav-icon-size); }

/* Home review pass: concise member tabs, two-column warning, compact navigation */
.v5-member-tabs { gap: 7px; margin-top: 13px; border-bottom: 0; }
.v5-member-tab { height: 38px; border: 1px solid #f46a29; border-radius: 999px; background: #fffaf5; color: #e95b1f; font-size: 12px; }
.v5-member-tab.active { border-color: #f15d1e; background: #f15d1e; color: #fff; }
.v5-warning-card { min-height: 122px; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 15px; align-items: center; padding: 16px; }
.v5-warning-title { min-height: 82px; display: grid; place-items: center; border-radius: 21px; background: #f26321; color: #fff; font-size: 20px; font-weight: 850; line-height: 1.25; letter-spacing: .04em; text-align: center; }
.v5-warning-copy { min-width: 0; display: block; }
.v5-warning-card strong { display: none; }
.v5-warning-card b { margin-top: 0; font-size: 15px; }
.v5-warning-card small { margin-top: 5px; font-size: 11px; line-height: 1.5; -webkit-line-clamp: 2; }
.v5-warning-card em { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; font-size: 11px; }
.v5-warning-card em .icon { width: 13px; height: 13px; }
.v5-ingredient-row button { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; }
.v5-ingredient-row button strong { margin-top: 5px; line-height: 1.15; }
.v5-ingredient-row button small { line-height: 1.1; }
.v5-ingredient-row .v5-more-ingredient { justify-content: center; gap: 4px; }
.v5-more-ingredient span { width: 28px; height: 28px; color: #f16321; background: transparent; }
.v5-more-ingredient .icon { width: 28px; height: 28px; color: #f16321; }
.v5-more-ingredient .asset-icon { background: currentColor; }
.bottom-nav { height: 70px; padding: 4px 8px max(6px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
.nav-item { min-height: 48px; gap: 2px; }
.nav-item.scan { transform: translateY(-3px); }
.nav-item.scan .nav-icon, .nav-item.scan.active .nav-icon { width: 50px; height: 50px; border-radius: 50%; box-shadow: 0 6px 14px rgba(229, 80, 19, .25), 0 0 0 6px rgba(255,255,255,.88); }
.nav-item.scan .icon { width: 24px; height: 24px; }
.v5-meal-card:nth-child(3) .v5-meal-top .icon:last-child { color: #443d37; }
.nav-item:not(.scan) .nav-asset-icon { transform: translateY(-3px); }
.nav-item[data-route="home"] .nav-asset-icon { width: var(--nav-icon-size); height: var(--nav-icon-size); }

/* Homepage module rhythm */
.v5-home .v5-hero { margin-top: 18px; }
.v5-home .v5-section-head { margin: 18px 0 10px; }
.v5-home .v5-warning-card { margin-top: 18px; }
.v5-home-top > div > small { transform: translateY(-2px); }
.v5-home-top h1 { margin-top: 1px; }
.v5-home .v5-hero-copy strong { margin-top: 0; }
.v5-section-head button { display: inline-flex; align-items: center; gap: 3px; line-height: 1; white-space: nowrap; }
.v5-section-head button .icon { flex: 0 0 auto; }

@media (max-width: 360px) {
  .v5-current-member { min-width: 104px; }
  .v5-member-tab { gap: 2px; font-size: 11px; }
  .v5-meal-card { min-height: 164px; padding: 7px; }
  .v5-meal-card img { height: 50px; }
  .v5-warning-card { min-height: 102px; }
}

/* Senior readability: larger type with room for natural text wrapping. */
.app-shell { font-size: 16px; }

.app-shell h1,
.app-shell h1.display { font-size: 30px !important; line-height: 1.24 !important; }

.app-shell h2,
.app-shell h2.display { font-size: 24px !important; line-height: 1.3 !important; }

.app-shell h3 { font-size: 19px !important; line-height: 1.35 !important; }

.app-shell :is(p, .lead, .care-note, .source-card, .bullet, .ingredient-row, .meal-row p, .pantry-row p) {
  font-size: 16px !important;
  line-height: 1.6 !important;
}

.app-shell :is(button, input, textarea, select) {
  font-size: 16px !important;
  line-height: 1.4;
}

.app-shell :is(small, .eyebrow, .subtle, .date-note, .tag, .nav-item, .recipe-meta, .recipe-ingredients, .missing) {
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.app-shell :is(.primary, .secondary-btn, .ghost-btn, .v5-link-field, .v5-generate-button) {
  font-size: 17px !important;
}

.app-shell :is(.v5-home-top h1, .detail-title h1, .result-title h1, .plan-member h1) {
  font-size: 30px !important;
}

.app-shell :is(.v5-section-head h2, .section-title h2, .scan-guidance h2, .v5-scan-recent-head h2, .plan-quote h2) {
  font-size: 24px !important;
}

.app-shell :is(.v5-hero-copy strong, .recipe-card h3, .v5-profile-name strong, .fridge-rec h3, .pantry-row h3, .meal-link) {
  font-size: 19px !important;
  line-height: 1.35 !important;
}

.app-shell :is(.v5-current-member strong, .v5-member-tab, .v5-meal-top strong, .v5-meal-card > b, .v5-warning-card b, .v5-ingredient-row button strong, .v5-scan-recent strong) {
  font-size: 16px !important;
  line-height: 1.35 !important;
}

/* Larger type must gain vertical room instead of being reduced or clipped. */
.app-shell .v5-hero,
.app-shell .v5-hero-copy { min-height: 246px; }

.app-shell .v5-meal-card { min-height: 0; }
.app-shell .v5-meal-card img { height: 62px; }
.app-shell .v5-meal-card > b,
.app-shell .v5-meal-card > small {
  min-height: 0;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.app-shell .v5-warning-card { min-height: 148px; }
.app-shell .v5-warning-card small {
  overflow: visible;
  -webkit-line-clamp: unset;
}

.app-shell .v5-ingredient-row button { min-height: 94px; }
.app-shell .v5-ingredient-row button img { width: 34px; height: 34px; }

.app-shell .recipe-card {
  height: auto !important;
  min-height: 170px !important;
}

.app-shell .recipe-card.featured { min-height: 216px !important; }
.app-shell .recipe-card-copy { overflow: visible; }
.app-shell .recipe-ingredients {
  overflow: visible;
  white-space: normal;
}
.app-shell .recipe-card p {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.app-shell .capture-option { min-height: 92px; }
.app-shell .guidance-row { min-height: 76px; }
.app-shell .v5-scan-recent button { min-height: 102px; }

.app-shell .v5-profile-row,
.app-shell .member-card { min-height: 90px; }

.app-shell .pantry-row { min-height: 96px; }
.app-shell .pantry-main { min-height: 88px; }
.app-shell .fridge-rec { min-height: 230px; }

.app-shell .sheet-member { min-height: 82px; }
.app-shell .field input,
.app-shell .field select { min-height: 54px; }

/* Scan actions keep a clear icon-first hierarchy at every supported width. */
body[data-route="scan"] .capture-option {
  grid-template-columns: 1fr;
  grid-template-rows: 25px auto;
  justify-items: center;
  align-content: center;
  gap: 7px;
}

body[data-route="scan"] .capture-option span {
  white-space: nowrap;
}

/* Featured recipe: keep the action clear of the copy and use the primary action colour. */
body[data-route="recipes"] .recipe-card.featured .recipe-card-copy {
  position: static;
}

body[data-route="recipes"] .recipe-card.featured .recipe-card-copy > :not(.recipe-arrow) {
  position: relative;
  z-index: 1;
}

body[data-route="recipes"] .recipe-card.featured .recipe-arrow {
  right: 14px;
  left: auto;
  top: auto;
  bottom: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #f26321;
  color: #fff;
  box-shadow: 0 5px 12px rgba(230, 86, 25, .24);
  transform: none;
  z-index: 2;
}

body[data-route="recipes"] .recipe-card.featured .recipe-arrow .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.join-family {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 32px 24px;
  background: var(--paper);
  color: var(--ink);
}
.join-family > small { color: var(--orange); font-weight: 800; font-size: 15px; }
.join-family h1 { margin: 0; font-size: 30px; line-height: 1.25; }
.join-family p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.join-family form { display: grid; gap: 14px; margin-top: 12px; }
.join-family label { display: grid; gap: 8px; font-size: 16px; font-weight: 800; }
.join-family input { min-height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; font: inherit; background: #fff; }
.join-family .primary { min-height: 52px; }
.join-error { color: #ba3b2c !important; font-weight: 700; }
