:root {
  --white: #ffffff;
  --canvas: #f7f8f6;
  --surface: #ffffff;
  --surface-green: #eaf2ed;
  --surface-rose: #f8ecef;
  --ink: #1c2a22;
  --muted: #657169;
  --muted-light: #8a948e;
  --line: #e0e6e1;
  --line-strong: #ccd8d0;
  --green: #1f6b4a;
  --green-dark: #174e37;
  --green-light: #e1eee6;
  --rose: #c98591;
  --rose-dark: #7e3f4b;
  --rose-line: #ead1d7;
  --shadow-soft: 0 10px 30px rgba(28, 42, 34, 0.08);
  --shadow-panel: 0 24px 70px rgba(28, 42, 34, 0.16);
  --rail-width: 248px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overflow-x: hidden;
}

body { min-height: 100dvh; background: var(--canvas); }
body.drawer-open { touch-action: none; }

button, input, textarea { font: inherit; letter-spacing: 0; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(201, 133, 145, 0.26);
  outline-offset: 2px;
}

.icon-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { width: 100%; height: 100dvh; display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); }

.side-rail {
  min-height: 0;
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-right: 1px solid var(--line);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand img, .mobile-brand img, .answer-author img, .thinking img {
  object-fit: cover;
  border: 1px solid rgba(201, 133, 145, 0.26);
}

.brand img { flex: 0 0 44px; border-radius: 8px; }
.brand span { min-width: 0; display: flex; flex-direction: column; }
.brand strong { font-size: 16px; line-height: 1.4; white-space: nowrap; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.3; }

.rail-nav { margin-top: 48px; display: grid; gap: 7px; }
.rail-item {
  width: 100%; height: 48px; padding: 0 13px;
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); background: transparent; border: 0; border-radius: 7px;
  font-weight: 600; text-align: left;
}
.rail-item svg { width: 20px; height: 20px; }
.rail-item:hover { color: var(--ink); background: #f4f7f5; }
.rail-item.is-active { color: var(--green-dark); background: var(--surface-green); }

.workspace { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; position: relative; }
.mobile-header, .bottom-nav { display: none; }

.stage { min-width: 0; min-height: 0; overflow: hidden; }
.screen { width: min(1060px, calc(100% - 72px)); height: 100%; margin: 0 auto; padding: clamp(42px, 6vh, 72px) 0 30px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.screen[hidden] { display: none; }
.profile-onboarding-screen { max-width: 760px; }
.onboarding-header { max-width: 680px; }
.onboarding-header h1 { margin: 0; font-family: "SimSun", "Songti SC", serif; font-size: clamp(30px, 4vw, 44px); line-height: 1.25; }
.onboarding-header > p:last-child { max-width: 620px; margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.onboarding-form { margin-top: 28px; }
.onboarding-card { padding: 25px 28px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.onboarding-field { margin: 0 0 22px; padding: 0; border: 0; }
.onboarding-field:last-child { margin-bottom: 0; }
.onboarding-field > label, .onboarding-field > legend { display: block; margin-bottom: 9px; color: var(--ink); font-size: 13px; font-weight: 700; }
.onboarding-field select, .onboarding-field input[type="text"], .onboarding-field input:not([type]) { width: 100%; height: 44px; padding: 0 12px; color: var(--ink); background: var(--white); border: 1px solid var(--line-strong); border-radius: 7px; outline: 0; }
.onboarding-field input:focus, .onboarding-field select:focus { border-color: rgba(31, 107, 74, .55); box-shadow: 0 0 0 3px rgba(31, 107, 74, .08); }
.onboarding-check-grid, .onboarding-budget-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.onboarding-check-grid label, .onboarding-budget-grid label { min-width: 0; }
.onboarding-check-grid input, .onboarding-budget-grid input { position: absolute; opacity: 0; pointer-events: none; }
.onboarding-check-grid span, .onboarding-budget-grid span { min-height: 42px; padding: 0 9px; display: grid; place-items: center; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 7px; font-size: 12px; cursor: pointer; text-align: center; }
.onboarding-check-grid input:checked + span, .onboarding-budget-grid input:checked + span { color: var(--green-dark); background: var(--surface-green); border-color: #b9cfbe; font-weight: 700; }
.onboarding-budget-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.onboarding-note { margin: 15px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.onboarding-footer { margin-top: 20px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.onboarding-footer span { margin-right: auto; color: var(--green); font-size: 12px; line-height: 1.5; }
.report-state { margin-top: 24px; padding: 24px; display: grid; justify-items: start; gap: 9px; background: var(--surface-green); border: 1px solid var(--line); }
.report-state strong { font-size: 16px; }
.report-state span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.report-state.is-error { background: var(--surface-rose); border-color: var(--rose-line); }
.report-stale-notice { margin-top: 14px; }
.report-stale-notice[hidden] { display: none; }
.report-stale-notice button { min-height: 38px; padding: 0 13px; color: var(--green-dark); background: var(--surface-green); border: 1px solid #b9cfbe; border-radius: 7px; font-size: 12px; font-weight: 700; cursor: pointer; }
.report-stale-notice button:disabled { cursor: wait; opacity: .65; }
.report-skeleton { width: 100%; display: grid; gap: 8px; }
.report-skeleton i { height: 10px; display: block; background: linear-gradient(90deg, #edf2ee 25%, #f8faf8 50%, #edf2ee 75%); background-size: 200% 100%; border-radius: 5px; animation: report-skeleton 1.3s ease-in-out infinite; }
.report-skeleton i:nth-child(1) { width: 72%; }
.report-skeleton i:nth-child(2) { width: 92%; animation-delay: .12s; }
.report-skeleton i:nth-child(3) { width: 55%; animation-delay: .24s; }
@keyframes report-skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.report-population-switcher { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.report-population-switcher button { min-height: 34px; padding: 0 12px; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }
.report-population-switcher button:hover, .report-population-switcher button.is-active { color: var(--green-dark); background: var(--surface-green); border-color: #b9cfbe; font-weight: 700; }
.push-target-group { margin: 20px 0 0; padding: 0; border: 0; }
.push-target-group legend { margin-bottom: 10px; font-size: 12px; font-weight: 700; }
.push-target-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.push-target-options label { min-width: 0; }
.push-target-options input { position: absolute; opacity: 0; pointer-events: none; }
.push-target-options span { min-height: 38px; padding: 5px 8px; display: grid; place-items: center; color: var(--muted); background: var(--white); border: 1px solid var(--rose-line); border-radius: 6px; font-size: 11px; text-align: center; cursor: pointer; }
.push-target-options input:checked + span { color: var(--white); background: var(--rose-dark); border-color: var(--rose-dark); font-weight: 700; }
.push-target-options input:disabled + span { cursor: not-allowed; opacity: .55; }
.push-target-hint { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }

/* The weekly report is a first-class production view; its data is rendered
   from the report adapter in app.js and never inferred from a short menu. */
.report-screen { min-height: 0; color: var(--ink); }
.share-screen { min-height: 0; color: var(--ink); }
.share-page-header { max-width: 760px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.share-page-header h1 { margin: 0; font-family: "SimSun", "Songti SC", serif; font-size: 36px; line-height: 1.3; }
.share-page-header > p:last-child { max-width: 660px; margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.share-report-card { max-width: 760px; margin-top: 28px; padding: 24px 26px; background: var(--white); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow-soft); }
.share-report-copy { display: flex; align-items: center; gap: 14px; }
.share-card-mark { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; color: var(--green); background: var(--surface-green); border-radius: 7px; }
.share-card-mark svg { width: 23px; height: 23px; }
.share-report-copy p { margin: 0 0 4px; color: var(--rose-dark); font-size: 11px; font-weight: 700; }
.share-report-copy h2 { margin: 0; font-family: "SimSun", "Songti SC", serif; font-size: 20px; line-height: 1.4; }
.share-report-copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.share-panel-state { min-height: 20px; margin: 20px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.share-link-field { margin-top: 16px; }
.share-link-field label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 11px; font-weight: 700; }
.share-link-field > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.share-link-field input { min-width: 0; height: 40px; padding: 0 11px; color: var(--muted); background: #f6f8f6; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.share-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.share-actions button { min-height: 40px; }
.share-poster-preview { margin-top: 20px; padding-top: 20px; display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 16px; align-items: center; border-top: 1px solid var(--line); }
.share-poster-preview img { width: 118px; aspect-ratio: 3 / 4; display: block; object-fit: cover; background: #eef2ef; border: 1px solid var(--line); border-radius: 5px; }
.share-poster-preview small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.share-non-distributor-hint { max-width: 760px; margin: 20px 0 0; padding: 14px 16px; color: var(--muted); background: var(--surface-green); border-left: 3px solid var(--green); font-size: 12px; line-height: 1.65; }
.share-distributor-panel { max-width: 760px; margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.share-distributor-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.share-distributor-head h2 { margin: 0; font-family: "SimSun", "Songti SC", serif; font-size: 24px; line-height: 1.35; }
.distributor-state { min-height: 22px; margin-top: 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.distributor-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.distributor-metric { min-height: 132px; padding: 22px; background: var(--white); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow-soft); }
.distributor-metric span { display: block; color: var(--muted); font-size: 12px; }
.distributor-metric strong { display: block; margin-top: 18px; color: var(--green-dark); font-size: 25px; line-height: 1.25; }
.distributor-footer { margin-top: 32px; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.distributor-footer a { color: var(--green); font-size: 13px; font-weight: 700; text-decoration: none; }
.distributor-footer small { font-size: 11px; }
.report-header { display:flex; justify-content:space-between; align-items:flex-start; gap:28px; padding-bottom:26px; border-bottom:1px solid var(--line); }
.report-header h1 { max-width:700px; margin:0; font-family:"SimSun","Songti SC",serif; font-size:clamp(30px,3.5vw,44px); line-height:1.22; }
.report-kicker { margin:0 0 9px; color:var(--rose-dark); font-size:12px; font-weight:700; }
.report-lede { max-width:700px; margin:10px 0 0; color:#66706a; font-size:14px; line-height:1.6; overflow-wrap:anywhere; }
.report-meta { margin-top:14px; color:var(--green); font-size:12px; line-height:1.7; }
.report-meta span + span::before { content:"·"; margin:0 8px; color:var(--line-strong); }
.report-stage-nav { display:grid; grid-template-columns:repeat(5,1fr); border-bottom:1px solid var(--line); }
.report-stage-nav a { padding:18px 10px 16px 0; color:var(--muted-light); text-decoration:none; font-size:12px; line-height:1.5; }
.report-stage-nav a:hover { color:var(--green); }
.report-section { padding:42px 0; border-bottom:1px solid var(--line); }
.report-section-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; }
.report-section h2 { margin:0; font-family:"SimSun","Songti SC",serif; font-size:26px; line-height:1.35; }
.report-section-heading > div > p:not(.report-kicker) { max-width:700px; margin:11px 0 0; color:var(--muted); font-size:13px; line-height:1.8; }
.primary-button { min-height:40px; padding:0 16px; color:var(--white); background:var(--green); border:1px solid var(--green); border-radius:7px; font-size:12px; font-weight:700; white-space:nowrap; }
.primary-button:hover { background:var(--green-dark); }
.report-guide-grid { display:grid; grid-template-columns:minmax(220px,.8fr) minmax(0,1.2fr); gap:36px; margin-top:26px; }
.report-guidance { padding:22px 24px; background:var(--surface-green); border-left:3px solid var(--green); }
.report-guidance h3 { margin:0; font-family:"SimSun","Songti SC",serif; font-size:18px; }
.report-guidance ul { margin:16px 0 0; padding-left:19px; color:var(--muted); font-size:13px; line-height:1.85; }
.report-food-list, .report-week-list { border-top:1px solid var(--line); }
.report-food-row { padding:15px 0; display:grid; grid-template-columns:32px minmax(0,1fr) auto; gap:12px; align-items:start; border-bottom:1px solid var(--line); }
.report-food-row > strong { color:var(--rose); font-family:Georgia,serif; font-size:17px; }
.report-food-row h3 { margin:0; font-size:15px; }
.report-food-row p { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.7; }
.report-food-actions { display:flex; gap:8px; align-items:center; }
.report-food-actions button { min-height:28px; padding:0 8px; color:var(--green); background:transparent; border:1px solid var(--line); border-radius:5px; font-size:11px; }
.report-food-actions button:hover { background:var(--surface-green); }
.report-empty { padding:22px 0; color:var(--muted-light); font-size:13px; line-height:1.7; }
.report-day { border-bottom:1px solid var(--line); }
.report-day-toggle { width:100%; padding:17px 0; display:grid; grid-template-columns:72px minmax(0,1fr) 16px; gap:12px; align-items:center; color:var(--ink); text-align:left; background:transparent; border:0; }
.report-day-toggle strong { color:var(--rose-dark); font-family:"SimSun","Songti SC",serif; font-size:17px; }
.report-day-toggle span { color:var(--muted); font-size:12px; }
.report-day-panel { display:none; padding:0 0 17px 84px; }
.report-day.is-open .report-day-panel { display:grid; gap:8px; }
.report-meal { padding:12px 14px; background:var(--white); border-left:3px solid var(--green); }
.report-meal:nth-child(2) { border-left-color:var(--rose); }
.report-meal:nth-child(3) { border-left-color:var(--blue); }
.report-meal strong { font-size:13px; }
.report-meal p { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.65; }
.report-day-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:2px; }
.report-day-actions button { min-height:29px; padding:0 9px; color:var(--green); background:transparent; border:1px solid var(--line); border-radius:5px; font-size:11px; }
.report-recipe-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:15px; margin-top:24px; }
.report-recipe { padding:19px; background:var(--white); border-top:3px solid var(--green); box-shadow:var(--shadow-soft); }
.report-recipe:nth-child(2) { border-top-color:var(--rose); }
.report-recipe:nth-child(3) { border-top-color:var(--blue); }
.report-recipe h3 { margin:0; font-family:"SimSun","Songti SC",serif; font-size:18px; }
.report-recipe small { display:block; margin:7px 0 13px; color:var(--muted-light); font-size:11px; }
.report-recipe ul { margin:0; padding-left:17px; color:var(--muted); font-size:12px; line-height:1.75; }
.report-shopping-grid { display:grid; grid-template-columns:1fr 1fr; gap:28px; margin-top:24px; }
.report-track { padding-top:15px; border-top:2px solid var(--green); }
.report-track.out-of-stock { border-top-color: var(--blue); }
.report-track.offline { border-top-color:var(--rose); }
.report-track.mall-runtime-unconfigured { border-top-color:var(--blue); }
.report-track.mall-runtime-error { border-top-color:var(--rose); }
.mall-runtime-notice { min-height:76px; margin:12px 0 0; padding:20px 15px; background:var(--white); border:1px solid var(--line); border-radius:8px; box-shadow:var(--shadow-soft); }
.report-track h3 { margin:0; font-family:"SimSun","Songti SC",serif; font-size:19px; }
.report-purchase-list { margin:12px 0 0; padding:0; display:grid; gap:10px; list-style:none; }
.report-purchase-item { min-width:0; }
.mall-product-card { width:100%; min-width:0; min-height:76px; padding:14px 15px; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center; background:var(--white); border:1px solid var(--line); border-radius:8px; box-shadow:var(--shadow-soft); }
.mall-product-card.offline, .mall-product-card.out-of-stock { grid-template-columns:20px minmax(0,1fr) auto; }
.mall-product-card strong { font-size:13px; }
.mall-product-info { min-width:0; display:grid; align-content:center; gap:3px; }
.mall-product-name { color:var(--ink); font-size:16px; font-weight:700; line-height:1.35; overflow-wrap:anywhere; }
.mall-product-price { color:var(--rose-dark); font-size:14px; font-weight:700; line-height:1.35; }
.mall-product-meta, .mall-product-status { display:block; color:var(--muted); font-size:12px; line-height:1.45; overflow-wrap:anywhere; }
.mall-product-status { color:var(--muted-light); }
.mall-product-check { width:17px; height:17px; margin:0; accent-color:var(--green); }
.mall-product-buy-btn { min-width:88px; min-height:36px; padding:0 13px; color:var(--white); background:var(--green); border:1px solid var(--green); border-radius:7px; font-size:12px; font-weight:700; white-space:nowrap; }
.mall-product-buy-btn:hover { background:var(--green-dark); border-color:var(--green-dark); }
.mall-product-buy-btn.is-disabled, .mall-product-buy-btn:disabled { color:var(--muted-light); background:#eef1ee; border-color:var(--line); cursor:not-allowed; }
.mini-program-open-tag { display:block; width:auto; min-width:88px; min-height:36px; padding:0; border:0; background:transparent; }
.mini-program-open-tag .mall-product-buy-btn { width:100%; }
.report-subscription-card { margin-top:28px; padding:25px 28px; display:flex; align-items:center; justify-content:space-between; gap:24px; background:var(--surface-green); border:1px solid var(--line-strong); }
.report-subscription-card h3 { margin:0; font-family:"SimSun","Songti SC",serif; font-size:20px; }
.report-subscription-card p:not(.report-kicker) { max-width:650px; margin:9px 0 0; color:var(--muted); font-size:12px; line-height:1.75; }
.report-subscription-card small { display:block; margin-top:7px; color:var(--muted-light); font-size:11px; }
.report-footer-note { padding:25px 0 0; color:var(--muted); font-size:12px; line-height:1.7; }
.report-footer-note strong { color:var(--ink); }
.report-footer-note .text-button { margin-left:12px; }
.text-button { padding:0; color:var(--green); background:transparent; border:0; font-size:12px; font-weight:700; }
.report-share-row { margin-top:16px; display:flex; align-items:center; gap:12px; }
.report-evidence-panel { margin-top:16px; padding:16px 18px; background:var(--surface-green); border:1px solid var(--line); }
.report-evidence-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.report-evidence-head .icon-button { width:28px; height:28px; font-size:18px; }
.report-evidence-list { margin:12px 0 0; padding:0; list-style:none; }
.report-evidence-list li { padding:10px 0; border-top:1px solid var(--line); }
.report-evidence-list strong, .report-evidence-list small, .report-evidence-list a, .report-evidence-local { display:block; }
.report-evidence-list small { margin-top:4px; color:var(--muted); font-size:11px; }
.report-evidence-list .report-evidence-source { margin-top:7px; color:var(--green); font-size:12px; font-weight:700; overflow-wrap:anywhere; }
.report-evidence-local { margin-top:7px; color:var(--muted); font-size:12px; }
.report-evidence-list .report-evidence-scope { margin-top:7px; color:var(--muted); font-size:11px; }
.report-copyright-footer { margin:24px 0 8px; padding:12px 0; color: #999; font-size: 12px; line-height:1.5; text-align:center; overflow-wrap:anywhere; }
.report-copyright-footer span + span::before { content:" · "; }
.report-active .composer-wrap, .share-active .composer-wrap { display:none; }

.screen-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.assistant-intro { max-width: 780px; }
.time-greeting { margin: 0 0 8px; color: var(--rose-dark); font-size: 14px; font-weight: 700; }
.section-heading p { margin: 0 0 8px; color: var(--green); font-size: 14px; font-weight: 700; }
.assistant-intro h1, .section-heading h1 { margin: 0; letter-spacing: 0; }
.assistant-intro h1 { max-width: 650px; font-family: "SimSun", "Songti SC", serif; font-size: clamp(32px, 3.3vw, 43px); line-height: 1.22; font-weight: 700; }
.assistant-intro p:last-child { max-width: 680px; margin: 13px 0 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.home-head time { flex: 0 0 auto; margin-top: 3px; color: var(--muted); font-size: 13px; }

.home-report-entry { min-width: 0; margin-top: 26px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--surface-green); border: 1px solid var(--line); }
.home-report-entry p { min-width: 0; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; word-break: normal; }
.home-report-actions { min-width: 0; flex: 0 0 auto; }
.home-report-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.dev-login-button { color: var(--muted); }
.first-visit-guide { margin-top: 14px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--surface-rose); border: 1px solid var(--rose-line); }
.first-visit-guide h2 { margin: 2px 0 5px; font-family: "SimSun", "Songti SC", serif; font-size: 20px; line-height: 1.35; }
.first-visit-guide p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.first-visit-guide .first-visit-kicker { color: var(--rose-dark); font-size: 12px; font-weight: 700; }
.first-visit-guide .primary-button { flex: 0 0 auto; }
.home-shortcuts { margin-top: 28px; }
.home-section-heading { margin-bottom: 12px; }
.home-section-heading h2 { margin: 0; font-family: "SimSun", "Songti SC", serif; font-size: 22px; line-height: 1.4; }
.home-section-heading > p:not(.home-section-kicker) { max-width: 42em; margin: 6px 0 0; color: #6e756f; font-size: 14px; line-height: 1.6; }
.home-section-heading .home-section-kicker { margin: 0 0 5px; color: var(--rose-dark); font-size: 12px; font-weight: 700; }

.quick-topics { margin-top: clamp(38px, 6vh, 60px); display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quick-topics button {
  min-width: 0; min-height: 108px; padding: 20px 22px;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  text-align: left; background: transparent; border: 0; border-right: 1px solid var(--line);
}
.quick-topics button:last-child { border-right: 0; }
.quick-topics button:hover { background: rgba(255, 255, 255, 0.64); }
.quick-topics button > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.quick-topics strong { font-size: 16px; line-height: 1.4; }
.quick-topics small { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.topic-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; }
.topic-icon-warm { color: var(--rose-dark); background: var(--surface-rose); }
.topic-icon-blue { color: var(--green); background: var(--surface-green); }
.topic-icon-rose { color: var(--rose-dark); background: #f5e3e7; }
.topic-arrow { color: var(--muted-light); font-size: 20px; transition: transform 160ms ease; }
.quick-topics button:hover .topic-arrow { transform: translateX(3px); color: var(--green); }

.today-note {
  width: min(760px, 100%); margin-top: clamp(32px, 5vh, 52px); padding-left: 22px;
  border-left: 3px solid var(--rose);
}
.note-heading { display: flex; align-items: flex-start; gap: 12px; }
.note-heading > svg { width: 23px; height: 23px; margin-top: 2px; color: var(--green); }
.note-heading span { color: var(--rose-dark); font-size: 12px; font-weight: 700; }
.note-heading h2 { margin: 4px 0 0; font-size: 19px; line-height: 1.45; }
.today-note > p { margin: 14px 0 0 35px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.today-note > button { margin: 15px 0 0 35px; padding: 0; color: var(--green); background: transparent; border: 0; font-size: 13px; font-weight: 700; }
.composer {
  z-index: 4; width: min(1060px, calc(100% - 72px)); margin: 0 auto; padding: 16px 0 24px;
  background: var(--canvas);
}
.composer[hidden] { display: none; }
.composer > label { display: block; margin: 0 0 8px 4px; color: var(--muted); font-size: 12px; }
.composer-box {
  height: 64px; padding: 9px 9px 9px 20px; display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 28px rgba(27, 55, 37, 0.08);
}
.composer-box:focus-within { border-color: rgba(31, 107, 74, 0.55); box-shadow: 0 0 0 4px rgba(31, 107, 74, 0.08), 0 8px 28px rgba(28, 42, 34, 0.08); }
.composer textarea { min-width: 0; flex: 1; max-height: 86px; padding: 7px 0; resize: none; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 14px; line-height: 1.55; }
.composer textarea::placeholder { color: #9ca69f; }
.composer button { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; color: var(--white); background: var(--green); border: 0; border-radius: 7px; }
.composer button:hover { background: var(--green-dark); }

.section-heading { min-height: 60px; display: flex; align-items: flex-start; gap: 14px; }
.section-heading h1 { font-size: 30px; line-height: 1.25; }
.back-button { margin-left: -8px; margin-top: 11px; }
.online-state { margin-left: auto; margin-top: 15px; color: var(--muted); font-size: 12px; }
.online-state::before { content: ""; width: 7px; height: 7px; margin-right: 7px; display: inline-block; background: #4ca66e; border-radius: 50%; }
.icon-button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 7px; }
.icon-button:hover { color: var(--ink); background: rgba(255,255,255,.7); }
.icon-button svg { width: 21px; height: 21px; }

.conversation { max-width: 830px; margin: 38px auto 0; }
.user-message { width: fit-content; max-width: min(620px, 78%); margin-left: auto; padding: 14px 17px; background: var(--green-light); border-radius: 8px 2px 8px 8px; font-size: 14px; line-height: 1.7; }
.thinking { min-height: 44px; margin-top: 26px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.thinking img { width: 36px; height: 36px; margin-right: 4px; border-radius: 8px; }
.thinking i { width: 4px; height: 4px; margin-left: -3px; background: var(--green); border-radius: 50%; animation: pulse 900ms infinite ease-in-out; }
.thinking i:nth-last-child(2) { animation-delay: 120ms; }
.thinking i:last-child { animation-delay: 240ms; }
@keyframes pulse { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }

.assistant-answer { margin-top: 26px; display: grid; grid-template-columns: 170px minmax(0, 1fr); background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-soft); overflow: hidden; }
.answer-author { padding: 24px 18px; background: var(--surface-green); border-right: 1px solid var(--line); }
.answer-author img { width: 42px; height: 42px; border-radius: 8px; }
.answer-author div { margin-top: 13px; display: flex; flex-direction: column; }
.answer-author strong { font-size: 14px; }
.answer-author span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.answer-copy { padding: 25px 28px; }
.answer-copy > p { margin: 0; color: #364139; font-size: 14px; line-height: 1.8; }
.meal-list { margin-top: 20px; border-top: 1px solid var(--line); }
.meal-row { min-height: 58px; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.meal-row small { color: var(--muted); font-size: 11px; }
.meal-row strong { font-size: 14px; }
.meal-row span { color: var(--muted); font-size: 12px; }
.answer-foot { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.answer-foot > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.answer-foot svg { width: 17px; height: 17px; }
.answer-foot b { color: var(--ink); font-weight: 600; }
.answer-foot button, .quiet-button { min-height: 38px; padding: 0 15px; color: var(--green); background: transparent; border: 1px solid var(--line-strong); border-radius: 7px; font-size: 12px; font-weight: 700; }
.answer-foot button:hover, .quiet-button:hover { background: var(--surface-green); border-color: #b9cfbe; }

.plan-heading { align-items: center; justify-content: space-between; }
.quiet-button { display: flex; align-items: center; gap: 7px; }
.quiet-button svg { width: 17px; height: 17px; }
.week-tabs { margin-top: 34px; display: grid; grid-template-columns: repeat(7, 1fr); background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.week-tabs button { min-width: 0; height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: transparent; border: 0; border-right: 1px solid var(--line); }
.week-tabs button:last-child { border-right: 0; }
.week-tabs small { color: var(--muted); font-size: 11px; }
.week-tabs strong { font-size: 14px; }
.week-tabs button:hover { background: #f7f9f7; }
.week-tabs button.is-active { color: var(--white); background: var(--green); }
.week-tabs button.is-active small { color: rgba(255,255,255,.72); }

.day-plan { margin-top: 22px; display: grid; grid-template-columns: minmax(210px, .72fr) minmax(0, 1.55fr); background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.day-summary { padding: 28px; display: flex; flex-direction: column; justify-content: space-between; background: var(--surface-green); border-right: 1px solid var(--line); }
.day-summary span { color: var(--muted); font-size: 12px; }
.day-summary h2 { margin: 8px 0 0; font-family: "SimSun", "Songti SC", serif; font-size: 24px; }
.day-summary p { margin: 38px 0 0; display: flex; flex-direction: column; gap: 7px; }
.day-summary p strong { color: var(--green-dark); font-size: 14px; }
.meal-schedule { padding: 5px 26px; }
.schedule-row { min-height: 74px; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.schedule-row:last-child { border-bottom: 0; }
.schedule-row > span:first-child { color: var(--muted); font-size: 12px; }
.schedule-row strong { display: block; font-size: 14px; line-height: 1.45; }
.schedule-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.schedule-row > span:last-child { color: var(--muted); font-size: 12px; white-space: nowrap; }
.plan-actions { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.plan-actions p { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.plan-actions p svg { width: 17px; height: 17px; color: var(--green); }
.plan-actions > button, .save-preferences { min-height: 44px; padding: 0 22px; color: var(--white); background: var(--green); border: 0; border-radius: 7px; font-size: 13px; font-weight: 700; }
.plan-actions > button:hover, .save-preferences:hover { background: var(--green-dark); }

.gender-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.gender-options label { min-width: 0; }
.gender-options input { position: absolute; opacity: 0; pointer-events: none; }
.gender-options span { height: 45px; display: grid; place-items: center; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 7px; font-size: 13px; cursor: pointer; }
.gender-options input:checked + span { color: var(--rose-dark); background: var(--surface-rose); border-color: var(--rose-line); font-weight: 700; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(17, 31, 22, .28); backdrop-filter: blur(2px); opacity: 0; transition: opacity 180ms ease; }
.drawer-backdrop.is-visible { opacity: 1; }
.preferences-drawer { position: fixed; z-index: 20; top: 0; right: 0; width: min(460px, 100%); height: 100dvh; padding: 28px 30px; overflow: auto; background: var(--white); box-shadow: var(--shadow-panel); transform: translateX(102%); transition: transform 220ms ease; }
.preferences-drawer.is-open { transform: translateX(0); }
.drawer-handle { display: none; }
.preferences-drawer header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.preferences-drawer header p { margin: 0 0 7px; color: var(--rose-dark); font-size: 12px; font-weight: 700; }
.preferences-drawer header h2 { margin: 0; font-size: 25px; }
.preferences-drawer form { margin-top: 30px; }
.preference-row { padding: 19px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.preference-row > div:first-child { display: flex; flex-direction: column; }
.preference-row strong, .toggle-row strong { font-size: 14px; }
.preference-row span, .toggle-row small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.stepper { height: 38px; display: grid; grid-template-columns: 38px 34px 38px; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.stepper button { height: 100%; padding: 0; background: #f7f9f7; border: 0; font-size: 18px; }
.stepper output { text-align: center; font-size: 13px; font-weight: 700; }
.preferences-drawer fieldset { margin: 26px 0 0; padding: 0; border: 0; }
.preferences-drawer legend, .text-field > span { margin-bottom: 12px; font-size: 13px; font-weight: 700; }
.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.segmented-control label { min-width: 0; }
.segmented-control input, .checkbox-grid input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { height: 42px; display: grid; place-items: center; color: var(--muted); background: var(--white); border-right: 1px solid var(--line); font-size: 11px; cursor: pointer; }
.segmented-control label:last-child span { border-right: 0; }
.segmented-control input:checked + span { color: var(--rose-dark); background: var(--surface-rose); font-weight: 700; }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.checkbox-grid span { height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; font-size: 12px; cursor: pointer; }
.checkbox-grid i { width: 15px; height: 15px; border: 1px solid var(--line-strong); border-radius: 3px; }
.checkbox-grid input:checked + span { color: var(--rose-dark); background: var(--surface-rose); border-color: var(--rose-line); }
.checkbox-grid input:checked + span i { position: relative; background: var(--green); border-color: var(--green); }
.checkbox-grid input:checked + span i::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.text-field { margin-top: 26px; display: flex; flex-direction: column; }
.text-field input { height: 44px; padding: 0 13px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; outline: 0; }
.text-field input:focus { border-color: rgba(201, 133, 145, .72); }
.toggle-row { margin-top: 26px; padding: 17px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); }
.toggle-row > span { display: flex; flex-direction: column; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row > i { position: relative; width: 43px; height: 24px; flex: 0 0 43px; background: #c8d0ca; border-radius: 12px; transition: background 160ms ease; cursor: pointer; }
.toggle-row > i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: var(--white); border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.15); transition: transform 160ms ease; }
.toggle-row input:checked + i { background: var(--green); }
.toggle-row input:checked + i::after { transform: translateX(19px); }
.push-settings { margin: 28px -30px 0; padding: 22px 30px 24px; background: var(--surface-rose); border-top: 1px solid var(--rose-line); border-bottom: 1px solid var(--rose-line); }
.push-settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.push-settings-head > div { min-width: 0; display: flex; flex-direction: column; }
.push-settings-head strong { font-size: 15px; line-height: 1.4; }
.push-settings-head span { margin-top: 5px; color: var(--rose-dark); font-size: 11px; line-height: 1.45; }
.push-settings-head button { flex: 0 0 auto; padding: 2px 0; color: var(--green); background: transparent; border: 0; font-size: 12px; font-weight: 700; }
.push-settings-head button:hover { color: var(--green-dark); }
.push-frequency { margin-top: 20px !important; }
.push-frequency legend { margin-bottom: 10px; }
.push-segments { border-color: var(--rose-line); }
.push-segments span { border-color: var(--rose-line); }
.push-segments input:checked + span { color: var(--white); background: var(--rose-dark); }
.push-details { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--rose-line); }
.identity-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; align-items: end; }
.compact-field { min-width: 0; display: flex; flex-direction: column; }
.compact-field > span, .compact-gender legend { margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.compact-field input { width: 100%; height: 42px; padding: 0 12px; color: var(--ink); background: var(--white); border: 1px solid var(--rose-line); border-radius: 7px; outline: 0; }
.compact-field input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(201, 133, 145, .14); }
.compact-field input::placeholder { color: var(--muted-light); }
.compact-gender { min-width: 0; margin: 0 !important; }
.compact-gender .gender-options { gap: 7px; }
.compact-gender .gender-options span { height: 42px; border-color: var(--rose-line); font-size: 12px; }
.push-channel { margin-top: 18px !important; padding: 16px 0 0; border-top-color: var(--rose-line); }
.push-channel small { color: #806a70; }
.save-preferences { width: 100%; margin-top: 20px; }

.toast { position: fixed; z-index: 40; left: 50%; bottom: 28px; min-width: 220px; max-width: calc(100% - 32px); padding: 13px 18px; transform: translateX(-50%); color: var(--white); background: #223329; border-radius: 7px; box-shadow: var(--shadow-panel); text-align: center; font-size: 13px; }

@media (max-width: 860px) {
  .app-shell { display: block; }
  .side-rail { display: none; }
  .workspace { height: 100dvh; grid-template-rows: 62px minmax(0, 1fr) auto 64px; background: var(--canvas); }
  .mobile-header { z-index: 7; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
  .mobile-brand { padding: 0; display: flex; align-items: center; gap: 10px; background: transparent; border: 0; font-size: 15px; font-weight: 700; }
  .mobile-brand img { width: 38px; height: 38px; border-radius: 8px; }
  .stage { overflow: hidden; }
  .screen { width: 100%; padding: 17px 19px 12px; }
  .profile-onboarding-screen { padding-top: 28px; }
  .onboarding-header h1 { font-size: 29px; }
  .onboarding-header > p:last-child { font-size: 13px; line-height: 1.65; }
  .onboarding-form { margin-top: 20px; }
  .onboarding-card { padding: 19px 16px; }
  .onboarding-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .onboarding-budget-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .onboarding-footer { align-items: stretch; flex-direction: column; gap: 9px; }
  .onboarding-footer span { margin-right: 0; }
  .screen-head { display: block; }
  .time-greeting { margin-top: 11px; }
  .assistant-intro h1 { font-size: 26px; line-height: 1.25; }
  .assistant-intro p:last-child { margin-top: 8px; font-size: 12px; line-height: 1.6; }
  .home-head time { display: none; }
  .home-report-entry { margin-top: 18px; padding: 13px 14px; align-items: flex-start; }
  .home-report-entry { flex-direction: column; }
  .home-report-entry p { width: 100%; }
  .home-report-entry p { font-size: 11px; }
  .home-report-actions { width: 100%; justify-content: flex-start; }
  .home-report-entry .primary-button { min-height: 34px; padding: 0 11px; font-size: 11px; }
  .first-visit-guide { margin-top: 12px; padding: 14px; align-items: flex-start; flex-direction: column; gap: 11px; }
  .first-visit-guide h2 { font-size: 18px; }
  .first-visit-guide p { font-size: 12px; }
  .first-visit-guide .primary-button { min-height: 34px; padding: 0 11px; font-size: 11px; }
  .home-shortcuts { margin-top: 20px; }
  .home-section-heading h2 { font-size: 19px; }
  .home-section-heading > p:not(.home-section-kicker) { margin-top: 5px; font-size: 13px; line-height: 1.55; }
  .quick-topics { margin-top: 14px; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
  .quick-topics button { min-height: 58px; padding: 8px 2px; grid-template-columns: 36px minmax(0, 1fr) auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .quick-topics button:last-child { border-bottom: 0; }
  .topic-icon { width: 38px; height: 38px; }
  .topic-icon svg { width: 19px; height: 19px; }
  .quick-topics strong { font-size: 14px; }
  .quick-topics small { margin-top: 3px; font-size: 11px; }
  .today-note { margin-top: 17px; padding-left: 15px; }
  .note-heading > svg { display: none; }
  .note-heading h2 { font-size: 16px; }
  .today-note > p { margin: 8px 0 0; font-size: 12px; line-height: 1.6; }
  .today-note > button { margin: 8px 0 0; font-size: 12px; }
  .composer { width: 100%; padding: 10px 14px 12px; background: var(--white); border-top: 1px solid var(--line); }
  .composer > label { display: none; }
  .composer-box { height: 50px; padding: 5px 5px 5px 14px; background: #f6f8f6; box-shadow: none; }
  .composer textarea { font-size: 13px; }
  .composer button { width: 40px; height: 40px; flex-basis: 40px; }
  .bottom-nav { grid-row: 4; z-index: 6; padding: 3px 12px max(3px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); background: var(--white); border-top: 1px solid var(--line); }
  .bottom-nav button { min-width: 0; padding: 4px 0 3px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); background: transparent; border: 0; font-size: 10px; }
  .bottom-nav svg { width: 20px; height: 20px; }
  .bottom-nav button.is-active { color: var(--green); }
  .bottom-nav button:focus-visible { outline: 0; background: var(--surface-green); border-radius: 7px; }

  .section-heading { min-height: 48px; }
  .section-heading h1 { font-size: 22px; }
  .section-heading p { margin-bottom: 4px; font-size: 11px; }
  .back-button { margin-top: 2px; margin-left: -9px; }
  .online-state { display: none; }
  .report-header { display:block; }
  .report-header h1, .report-lede { max-width:100%; overflow-wrap:anywhere; }
  .report-lede { margin-top:10px; font-size:14px; line-height:1.6; }
  .report-header .quiet-button { margin-top:18px; }
  .report-state { padding: 19px 16px; }
  .report-population-switcher { margin-top: 15px; }
  .report-population-switcher button { flex: 1 1 calc(33.333% - 8px); padding: 0 7px; font-size: 11px; }
  .report-stage-nav { margin-right:-19px; overflow:auto; grid-template-columns:repeat(5,minmax(116px,1fr)); scrollbar-width:none; }
  .report-stage-nav::-webkit-scrollbar { display:none; }
  .report-stage-nav a { padding-top:14px; padding-bottom:13px; }
  .report-section { padding:31px 0; }
  .report-section-heading { display:block; }
  .report-section-heading .primary-button { width:100%; margin-top:17px; }
  .report-section h2 { font-size:22px; }
  .report-guide-grid, .report-shopping-grid { grid-template-columns:1fr; gap:23px; }
  .report-food-row { grid-template-columns:27px minmax(0,1fr); }
  .report-food-actions { grid-column:2; }
  .report-recipe-grid { grid-template-columns:1fr; }
  .report-day-toggle { grid-template-columns:61px minmax(0,1fr) 14px; gap:9px; }
  .report-day-panel { padding-left:70px; }
  .report-subscription-card { display:block; padding:21px 19px; }
  .report-subscription-card .primary-button { width:100%; margin-top:16px; }
  .report-footer-note .text-button { display:block; margin:9px 0 0; padding:0; }
  .conversation { margin-top: 25px; }
  .share-page-header { padding-bottom: 19px; }
  .share-page-header h1 { font-size: 26px; }
  .share-page-header > p:last-child { margin-top: 9px; font-size: 12px; line-height: 1.65; }
  .share-report-card { margin-top: 18px; padding: 19px 16px; }
  .share-report-copy { align-items: flex-start; gap: 11px; }
  .share-card-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .share-report-copy h2 { font-size: 18px; }
  .share-link-field > div { grid-template-columns: 1fr; }
  .share-actions { display: grid; grid-template-columns: 1fr; }
  .share-actions button { width: 100%; }
  .share-poster-preview { grid-template-columns: 92px minmax(0, 1fr); gap: 12px; }
  .share-poster-preview img { width: 92px; }
  .share-distributor-panel { margin-top: 24px; padding-top: 22px; }
  .share-distributor-head { align-items: flex-start; }
  .share-distributor-head h2 { font-size: 21px; }
  .distributor-metrics { gap: 7px; margin-top: 18px; }
  .distributor-metric { min-height: 96px; padding: 13px 9px; }
  .distributor-metric strong { margin-top: 12px; font-size: 17px; overflow-wrap: anywhere; }
  .distributor-footer { margin-top: 20px; align-items: flex-start; flex-direction: column; gap: 7px; }
  .user-message { max-width: 88%; padding: 11px 13px; font-size: 12px; }
  .thinking { margin-top: 20px; font-size: 11px; }
  .assistant-answer { margin-top: 20px; display: block; }
  .answer-author { padding: 14px 15px; display: flex; align-items: center; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .answer-author img { width: 36px; height: 36px; }
  .answer-author div { margin: 0; }
  .answer-author strong { font-size: 12px; }
  .answer-author span { font-size: 10px; }
  .answer-copy { padding: 17px 16px; }
  .answer-copy > p { font-size: 12px; line-height: 1.75; }
  .meal-list { margin-top: 14px; }
  .meal-row { min-height: 50px; grid-template-columns: 48px minmax(0, 1fr) auto; }
  .meal-row strong { font-size: 12px; }
  .meal-row span { font-size: 10px; }
  .answer-foot { margin-top: 15px; }
  .answer-foot button { min-height: 34px; padding: 0 10px; font-size: 10px; }

  .plan-heading { align-items: center; }
  .quiet-button { min-height: 34px; padding: 0 9px; font-size: 10px; }
  .week-tabs { margin-top: 23px; }
  .week-tabs button { height: 55px; }
  .week-tabs small { font-size: 9px; }
  .week-tabs strong { font-size: 12px; }
  .day-plan { margin-top: 15px; display: block; }
  .day-summary { padding: 18px; display: flex; flex-direction: row; align-items: flex-end; border-right: 0; border-bottom: 1px solid var(--line); }
  .day-summary h2 { margin-top: 5px; font-size: 19px; }
  .day-summary p { margin: 0; text-align: right; }
  .day-summary p strong { font-size: 11px; }
  .day-summary p span { font-size: 9px; }
  .meal-schedule { padding: 1px 15px; }
  .schedule-row { min-height: 60px; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px; }
  .schedule-row strong { font-size: 12px; }
  .schedule-row small, .schedule-row > span:first-child, .schedule-row > span:last-child { font-size: 10px; }
  .plan-actions { margin-top: 14px; display: block; }
  .plan-actions p { font-size: 10px; line-height: 1.5; }
  .plan-actions > button { width: 100%; margin-top: 12px; }

  .preferences-drawer { top: auto; bottom: 0; width: 100%; height: min(82dvh, 700px); padding: 13px 20px max(22px, env(safe-area-inset-bottom)); border-radius: 8px 8px 0 0; transform: translateY(102%); }
  .preferences-drawer.is-open { transform: translateY(0); }
  .drawer-handle { width: 42px; height: 4px; margin: 0 auto 18px; display: block; background: #d1d9d3; border-radius: 2px; }
  .preferences-drawer header h2 { font-size: 22px; }
  .preferences-drawer form { margin-top: 22px; }
  .preference-row { padding: 15px 0; }
  .preferences-drawer fieldset, .text-field, .toggle-row { margin-top: 21px; }
  .push-settings { margin: 24px -20px 0; padding: 20px 20px 22px; }
  .push-frequency { margin-top: 18px !important; }
  .push-details { margin-top: 18px; padding-top: 18px; }
  .push-target-options { gap: 6px; }
  .push-target-options span { min-height: 36px; padding: 4px 5px; font-size: 10px; }
  .identity-grid { gap: 9px; }
  .toast { bottom: 146px; }
}

@media (max-width: 380px), (max-height: 720px) and (max-width: 860px) {
  .screen { padding: 18px 15px 12px; }
  .time-greeting { margin-top: 12px; }
  .assistant-intro h1 { font-size: 24px; }
  .assistant-intro p:last-child { display: none; }
  .home-report-entry { padding: 11px 12px; gap: 10px; }
  .home-report-entry p { font-size: 10px; }
  .home-report-entry .primary-button { padding: 0 9px; font-size: 10px; }
  .home-shortcuts { margin-top: 17px; }
  .quick-topics { margin-top: 13px; }
  .quick-topics button { min-height: 62px; }
  .today-note { margin-top: 17px; }
  .report-stage-nav { margin-right: -15px; }
  .report-section h2 { font-size: 20px; }
  .report-food-row { gap: 9px; }
  .report-food-actions { gap: 6px; }
  .report-food-actions button { padding: 0 7px; font-size: 10px; }
  .report-day-toggle { grid-template-columns: 54px minmax(0, 1fr) 12px; gap: 7px; }
  .report-day-panel { padding-left: 61px; }
  .report-subscription-card { padding-left: 15px; padding-right: 15px; }
}

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

/* Formal application compatibility: approved shell plus the real Agent output. */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.brand { width: 100%; padding: 0; background: transparent; border: 0; text-align: left; }
.service-state { margin-top: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.state-dot { width: 7px; height: 7px; background: #aab4ad; border-radius: 50%; }
.service-state.ready .state-dot { background: #4ca66e; }
.service-state.error .state-dot { background: var(--rose-dark); }
.composer-wrap { min-width: 0; background: var(--canvas); }
.composer-box .input-count { flex: 0 0 auto; color: var(--muted-light); font-size: 10px; }
.composer-box .stop-button { color: var(--muted); background: #f0f3f1; }
.composer-box .stop-button span { width: 11px; height: 11px; background: currentColor; border-radius: 2px; }
.composer-box .send-button:disabled { cursor: default; background: #9eafa4; }
.composer-box .send-button svg { width: 20px; height: 20px; }

.chat-screen { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.message-scroller { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.message-list { width: min(830px, 100%); margin: 28px auto 0; padding: 0 0 42px; display: flex; flex-direction: column; gap: 22px; }
.message { min-width: 0; display: flex; align-items: flex-start; gap: 11px; animation: message-in 180ms ease both; }
.message.user { justify-content: flex-end; }
.assistant-avatar { width: 36px; height: 36px; flex: 0 0 36px; object-fit: cover; border: 1px solid var(--rose-line); border-radius: 8px; }
.message-content { min-width: 0; max-width: calc(100% - 48px); }
.message.assistant .message-content { padding: 16px 18px; background: var(--white); border: 1px solid var(--line); border-radius: 3px 8px 8px 8px; box-shadow: 0 4px 18px rgba(28, 42, 34, .05); }
.message.user .message-content { max-width: min(620px, 82%); padding: 12px 16px; color: #26372d; background: var(--green-light); border: 1px solid #cfe0d4; border-radius: 8px 2px 8px 8px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.assistant.welcome-message .message-content { padding: 15px 17px; color: var(--muted); background: var(--surface-green); box-shadow: none; }
.assistant-copy { color: #344139; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.welcome-title { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.45; }
.welcome-copy { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.welcome-chips, .action-list { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.prompt-chip, .action-button, .retry-button { min-height: 36px; padding: 7px 12px; color: var(--green-dark); background: var(--white); border: 1px solid var(--line-strong); border-radius: 7px; font-size: 12px; font-weight: 600; }
.prompt-chip:hover, .action-button:hover, .retry-button:hover { background: var(--surface-green); border-color: #aec8b5; }
.assistant-result { min-width: 0; }
.assumption-list { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 7px; color: var(--muted); background: #f5f7f5; border: 1px solid var(--line); border-radius: 4px; font-size: 10px; }
.menu-overview { margin-top: 15px; padding: 12px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.menu-overview strong, .products-heading { font-size: 13px; }
.dish-names { margin-top: 4px; color: #435047; font-size: 13px; line-height: 1.55; }
.total-time { flex: 0 0 auto; color: var(--rose-dark); font-size: 11px; font-weight: 700; white-space: nowrap; }
.result-details, .dish-details, .product-details { margin-top: 10px; border: 0; }
.result-details > summary, .dish-details > summary, .product-details > summary { width: fit-content; padding: 4px 0; color: var(--green); cursor: pointer; font-size: 12px; font-weight: 700; }
.dish-list, .product-list { margin-top: 10px; display: grid; gap: 10px; }
.dish-card, .product-card { min-width: 0; padding: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 7px; }
.dish-head, .product-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dish-head h3, .product-head h3 { margin: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.dish-time, .stock-pill { flex: 0 0 auto; padding: 2px 6px; border-radius: 4px; font-size: 10px; white-space: nowrap; }
.dish-time { color: var(--rose-dark); background: var(--surface-rose); }
.stock-pill.in_stock { color: var(--green-dark); background: var(--green-light); }
.stock-pill.low_stock { color: #7d5b22; background: #fbf1d9; }
.stock-pill.out_of_stock { color: #813e4a; background: var(--surface-rose); }
.dish-note, .product-meta { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.child-note { margin: 9px 0 0; padding: 8px 9px; color: #76521f; background: #fbf2dd; border-radius: 5px; font-size: 11px; line-height: 1.55; }
.ingredient-grid { margin: 9px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; list-style: none; }
.ingredient-grid li { min-width: 0; padding-bottom: 3px; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--line); font-size: 11px; }
.ingredient-grid li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.ingredient-grid li span:last-child { flex: 0 0 auto; color: var(--muted); }
.step-list, .evidence-list { margin: 8px 0 0; padding-left: 20px; color: #47524b; font-size: 11px; line-height: 1.65; }
.step-list li + li, .evidence-list li + li { margin-top: 5px; }
.step-key { display: block; color: var(--rose-dark); font-size: 10px; }
.products-section { margin-top: 14px; }
.products-heading { margin: 0 0 7px; }
.product-image { display: block; width: 100%; max-height: 180px; margin: -2px 0 10px; object-fit: cover; border-radius: 5px; background: #f4f6f4; }
.product-price { margin: 8px 0 0; color: #8a3d4b; font-size: 17px; font-weight: 700; }
.product-link { text-decoration: none; cursor: pointer; }
.report-card { margin-top: 12px; padding: 13px 14px; background: var(--green-light); border: 1px solid #c7dccd; border-radius: 7px; }
.report-card strong { font-size: 13px; }
.report-card p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.report-actions { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 8px; }
.report-actions a { text-decoration: none; }
.quality-details { margin-top: 8px; border-top: 1px solid var(--line); }
.action-button.cart { color: var(--white); background: var(--green); border-color: var(--green); }
.assistant-note { margin-top: 10px; padding: 9px 11px; color: var(--muted); background: #f5f7f5; border-left: 3px solid #aebbb2; border-radius: 0 5px 5px 0; font-size: 11px; line-height: 1.6; }
.reference-notes { margin: 12px 0 0; color: var(--muted-light); font-size: 11px; line-height: 1.6; }
.reference-notes span { color: var(--muted); margin-right: 6px; }
.medical-response { padding: 12px 14px; background: #eef5f6; border: 1px solid #d2e2e4; border-left: 4px solid #789da3; border-radius: 7px; }
.typing-dots { height: 30px; display: flex; align-items: center; gap: 5px; }
.typing-dots span { width: 6px; height: 6px; background: var(--green); border-radius: 50%; animation: typing 1.2s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: .14s; }
.typing-dots span:nth-child(3) { animation-delay: .28s; }
.error-message { color: #7d3e49; }
.generation-label { width: fit-content; margin-top: 11px; padding-top: 7px; color: var(--muted-light); border-top: 1px solid var(--line); font-size: 10px; }
.business-contact-card { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 250px); gap: 16px; align-items: center; padding: 14px; background: #f7f9f7; border: 1px solid var(--line); border-radius: 7px; }
.business-contact-copy h3 { margin: 0; font-size: 14px; }
.business-contact-copy p { margin: 8px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.business-contact-phone { color: var(--green); font-size: 17px; font-weight: 700; text-decoration: none; }
.business-contact-image { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: 5px; }

.profile-panel { position: fixed; z-index: 20; top: 0; right: 0; width: min(460px, 100%); height: 100dvh; padding: 28px 30px; overflow: auto; overscroll-behavior: contain; background: var(--white); box-shadow: var(--shadow-panel); transform: translateX(102%); transition: transform 220ms ease; outline: 0; }
.profile-panel.is-open { transform: translateX(0); }
.profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.profile-head p { margin: 0 0 7px; color: var(--rose-dark); font-size: 12px; font-weight: 700; }
.profile-head h2 { margin: 0; font-size: 25px; }
#profileForm { margin-top: 24px; }
.profile-subtitle { margin: 0 0 21px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.field { margin-bottom: 17px; }
.field label, .equipment-field legend { margin-bottom: 7px; display: block; color: #455148; font-size: 12px; font-weight: 700; }
.field-status { margin-left: 5px; color: var(--muted-light); font-size: 10px; font-weight: 400; }
.field-status.is-provided { color: var(--green); }
.field-status.is-dirty { color: var(--rose-dark); font-weight: 700; }
.field input, .field select { width: 100%; height: 43px; padding: 8px 11px; color: var(--ink); background: var(--white); border: 1px solid var(--line-strong); border-radius: 7px; }
.equipment-field { margin: 0 0 18px; padding: 0; border: 0; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.check-grid label { min-height: 38px; margin: 0; padding: 6px 8px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; font-weight: 500; }
.check-grid input { width: 14px; height: 14px; accent-color: var(--green); }
.more-settings { margin-top: 3px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.more-settings > summary { padding: 14px 0; color: var(--green); cursor: pointer; font-size: 12px; font-weight: 700; }
.more-settings-body { padding-top: 8px; }
.subscription-panel { margin: 26px -30px 0; padding: 22px 30px 24px; background: var(--surface-rose); border-top: 1px solid var(--rose-line); border-bottom: 1px solid var(--rose-line); }
.subscription-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.subscription-head > div { min-width: 0; display: flex; flex-direction: column; }
.subscription-head strong { font-size: 15px; }
.subscription-head span { margin-top: 5px; color: var(--rose-dark); font-size: 11px; line-height: 1.45; }
.subscription-head button { flex: 0 0 auto; padding: 2px 0; color: var(--green); background: transparent; border: 0; font-size: 11px; font-weight: 700; }
.push-frequency { margin: 20px 0 0; padding: 0; border: 0; }
.push-frequency legend { margin-bottom: 10px; font-size: 12px; font-weight: 700; }
.push-segments { border-color: var(--rose-line); }
.push-segments span { border-color: var(--rose-line); }
.push-segments input:checked + span { color: var(--white); background: var(--rose-dark); }
.push-details { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--rose-line); }
#subscriptionControls { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 8px; }
.wechat-subscribe-open-tag { width: 100%; height: 38px; display: block; overflow: visible; line-height: 0; }
.wechat-subscribe-button, .wechat-subscribe-fallback { min-height: 38px; padding: 7px 12px; color: var(--green-dark); background: var(--white); border: 1px solid #b9cdbf; border-radius: 7px; font-size: 11px; font-weight: 700; }
.wechat-subscribe-fallback { color: var(--muted); border-color: var(--rose-line); }
.profile-footer { margin-top: 20px; padding-bottom: max(4px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.save-state { min-height: 18px; flex: 1; color: var(--green); font-size: 11px; }
.save-button { min-width: 104px; min-height: 43px; padding: 7px 17px; color: var(--white); background: var(--green); border: 1px solid var(--green); border-radius: 7px; font-size: 12px; font-weight: 700; }
.save-button:disabled { cursor: default; opacity: .55; }

.poster-dialog { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; }
.poster-dialog-backdrop { position: absolute; inset: 0; background: rgba(19, 34, 24, .45); }
.poster-dialog-panel { position: relative; width: min(430px, 100%); max-height: min(92dvh, 820px); padding: 20px; overflow: auto; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-panel); }
.poster-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.poster-dialog-head h2 { margin: 0; font-size: 20px; }
.eyebrow { margin: 0 0 4px; color: var(--rose-dark); font-size: 11px; font-weight: 700; }
.poster-preview-wrap { display: grid; place-items: center; min-height: 220px; padding: 10px; background: #eef2ef; border: 1px solid var(--line); }
.poster-preview { display: block; width: min(100%, 340px); height: auto; max-height: 62dvh; object-fit: contain; }
.poster-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.poster-dialog-actions .action-button { flex: 1 1 120px; text-align: center; text-decoration: none; }
.debug-panel { position: fixed; z-index: 50; right: 12px; bottom: 12px; width: min(520px, calc(100vw - 24px)); max-height: 45vh; padding: 8px 10px; overflow: auto; color: #d8e6d9; background: #172019; border-radius: 6px; font: 11px/1.45 Consolas, monospace; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes message-in { from { transform: translateY(5px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 860px) {
  .composer-wrap { background: var(--white); }
  .message-list { margin-top: 20px; padding-bottom: 26px; gap: 17px; }
  .message.assistant .message-content { padding: 13px 14px; }
  .assistant-avatar { width: 31px; height: 31px; flex-basis: 31px; }
  .message-content { max-width: calc(100% - 41px); }
  .message.user .message-content { max-width: 90%; font-size: 12px; }
  .ingredient-grid { grid-template-columns: 1fr; }
  .menu-overview { flex-direction: column; gap: 7px; }
  .business-contact-card { grid-template-columns: 1fr; }
  .input-count { display: none; }
  .profile-panel { top: auto; bottom: 0; width: 100%; height: min(82dvh, 700px); padding: 13px 20px max(22px, env(safe-area-inset-bottom)); border-radius: 8px 8px 0 0; transform: translateY(102%); }
  .profile-panel.is-open { transform: translateY(0); }
  .profile-head h2 { font-size: 22px; }
  #profileForm { margin-top: 21px; }
  .subscription-panel { margin: 24px -20px 0; padding: 20px 20px 22px; }
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toast { bottom: 146px; }
  .poster-dialog { align-items: end; padding: 0; }
  .poster-dialog-panel { width: 100%; max-height: 94dvh; border-radius: 8px 8px 0 0; }
}
