/* Scheme 2 foundations and page-specific visual restoration. */
body.reference-ui {
  --ref-brand: #138b68;
  --ref-strong: #086c51;
  --ref-mint: #edf8f4;
  --ref-ink: #13352e;
  --ref-muted: #677b76;
  --ref-line: #e7efeb;
  --ref-coral: #ef8977;
  background: #f3f8f5;
  color: var(--ref-ink);
}
.reference-ui .ref-icon { display: block; width: 22px; height: 22px; flex: 0 0 22px; object-fit: contain; }
.reference-ui button:focus-visible,
.reference-ui summary:focus-visible { outline: 3px solid #8bcdb3; outline-offset: 3px; }
.reference-ui button { letter-spacing: 0; }
.reference-ui #homeIntakeValue,
.reference-ui .route-kcal,
.reference-ui .recipe-meta { font-variant-numeric: tabular-nums; }
.reference-ui #recipeSheet button:disabled { opacity: .5; cursor: wait; }
.reference-ui #recipeSheet .ref-capture.primary { border-radius: 18px; }
.reference-ui .bottom-nav .nav-item img { width: 23px; height: 23px; filter: grayscale(1); opacity: .6; }
.reference-ui .bottom-nav .nav-item.active img { filter: none; opacity: 1; }
.reference-ui .brand-mark { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.reference-ui .brand-mark img { width: 36px; height: 38px; filter: none; object-fit: contain; }

body.app-page.reference-ui .screen { padding: 22px 32px calc(110px + env(safe-area-inset-bottom)); }
body.app-page.reference-ui .topbar { position: relative; align-items: flex-start; min-height: 90px; margin-bottom: 12px; padding-bottom: 8px; border: 0; }
body.app-page.reference-ui[data-active-tab="home"] .topbar { background: url('./assets/brand/h5-home-canopy.png') top right / 160px auto no-repeat; }
.reference-ui .brand-lockup { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 5px 8px; flex: 1; }
body.app-page.reference-ui .brand-mark { width: 28px; height: 30px; min-height: 0; }
body.app-page.reference-ui .brand-mark img { width: 28px; height: 30px; filter: none; }
body.app-page.reference-ui .brand-lockup .kicker { align-self: center; margin: 0; color: #174839; font-size: 16px; font-weight: 650; }
.reference-ui .ref-greeting { grid-column: 1 / -1; margin-top: 6px; padding-right: 48px; }
body.app-page.reference-ui .topbar h1 { font-size: 25px; font-weight: 650; line-height: 1.35; }
.reference-ui .home-date { display: block; margin-top: 5px; color: var(--ref-muted); font-size: 13px; }
.reference-ui .ref-home-leaves { position: absolute; right: 0; bottom: -12px; width: 50px; height: 58px; object-fit: contain; }
.reference-ui:not([data-active-tab="home"]) .ref-home-leaves { display: none; }
body.app-page.reference-ui .score-hero { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 18px; min-height: 0; margin: 0 0 12px; padding: 12px 18px; border: 0; border-radius: 10px; background: #f0f9f5; }
.reference-ui .ref-health-heading { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 14px; font-weight: 600; }
.reference-ui .ref-route-badge { padding: 2px 9px; border-radius: 14px; background: #e1f2df; color: #287647; font-size: 12px; }
body.app-page.reference-ui .score-ring { width: 82px; height: 82px; border: 5px solid #bce6d4; border-top-color: #20a677; border-right-color: #20a677; background: transparent; color: var(--ref-ink); }
body.app-page.reference-ui .score-ring span { font-size: 32px; line-height: 1.15; }
.reference-ui .score-ring small { font-size: 12px; color: var(--ref-muted); }
.reference-ui .score-copy { align-self: center; min-width: 0; border-left: 1px solid #dcece4; padding-left: 18px; }
.reference-ui .intake-progress { margin: 0; gap: 9px; }
.reference-ui .intake-progress-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.reference-ui .intake-progress-heading > span { font-size: 14px; }
.reference-ui .intake-progress-heading strong { font-size: 13px; font-weight: 400; color: var(--ref-muted); }
.reference-ui #homeIntakeValue { color: var(--ref-ink); font-size: 29px; font-weight: 650; }
.reference-ui .intake-progress-track { height: 6px; background: #e0ece6; }
.reference-ui #homeIntakeProgressFill { background: #1c9c73; }
body.app-page.reference-ui #homePanel .quick-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin: 0 0 14px; }
body.app-page.reference-ui #homePanel .action { display: flex; align-items: center; justify-content: center; flex-direction: row; gap: 9px; grid-column: auto; min-width: 0; min-height: 56px; padding: 10px 12px; border: 0; border-radius: 24px; background: #edf8f4; color: #117558; box-shadow: none; font-size: 16px; }
body.app-page.reference-ui #homePanel .action.primary { background: #199d78; color: white; }
body.app-page.reference-ui #homePanel .action-icon { display: flex; align-items: center; justify-content: center; width: 22px; height: 24px; padding: 0; border-radius: 0; background: transparent; }
body.app-page.reference-ui #homePanel .action-icon img { width: 22px; height: 22px; filter: none; }
body.app-page.reference-ui #homePanel .map-card { margin: 0; padding: 0; border: 0; border-radius: 0; background: white; box-shadow: none; }
.reference-ui #homePanel .section-head { min-height: 38px; margin: 0 0 7px; }
body.app-page.reference-ui #homePanel .section-head h2 { display: flex; align-items: center; gap: 7px; font-size: 18px; font-weight: 650; }
.reference-ui #homePanel .section-head h2 .ref-icon { width: 18px; height: 18px; flex-basis: 18px; }
.reference-ui #homePanel .ref-calendar-link { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: #fff; }
.reference-ui #homePanel .route { gap: 0; margin: 0; padding: 0; }
.reference-ui #homePanel .route::before { display: none; }
body.app-page.reference-ui #homePanel .route-item { display: block; min-height: 0; margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--ref-line); border-radius: 0; background: white; box-shadow: none; }
.reference-ui .ref-meal-open { display: grid; grid-template-columns: 72px minmax(0,1fr) auto 14px; align-items: center; gap: 16px; width: 100%; min-height: 78px; padding: 9px 0; background: white; color: var(--ref-ink); text-align: left; }
.reference-ui #homePanel .route-thumb { display: block; width: 72px; height: 60px; overflow: hidden; border-radius: 8px; background: #edf8f4; }
.reference-ui #homePanel .route-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reference-ui #homePanel .route-thumb.is-placeholder img { padding: 20px; object-fit: contain; }
.reference-ui #homePanel .route-copy { min-width: 0; }
.reference-ui .ref-meal-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: #75817c; font-size: 12px; }
.reference-ui .ref-meal-type { display: inline-block; padding: 1px 7px; border-radius: 12px; background: #edf8f2; color: #247554; font-size: 11px; }
.reference-ui #homePanel .route-copy strong { display: block; margin-top: 6px; color: var(--ref-ink); font-size: 15px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.reference-ui #homePanel .route-kcal { white-space: nowrap; color: #177f61; font-size: 17px; font-weight: 600; }
.reference-ui .route-kcal small { color: #74817d; font-size: 11px; font-weight: 400; }
.reference-ui .ref-row-chevron { width: 14px; height: 18px; opacity: .65; }
.reference-ui .ref-home-details { margin-top: 18px; border-top: 1px solid var(--ref-line); }
.reference-ui .ref-home-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 7px 0; list-style: none; cursor: pointer; color: #2a6a53; font-size: 14px; }
.reference-ui summary::-webkit-details-marker { display: none; }
.reference-ui .ref-home-details > summary img { width: 18px; height: 18px; }
.reference-ui .ref-home-details[open] > summary img { transform: rotate(90deg); }
.reference-ui .ref-route-notes { font-size: 13px; }
.reference-ui .ref-recipe-panel { background: #fff; }
.reference-ui #recipeSheet .sheet-head { background: #edf8f4 url('./assets/brand/h5-recipe-leaves.png') right top / auto 58px no-repeat; }
.reference-ui #recipeSheet .sheet-head h2 { max-width: 70%; color: var(--ref-ink); font-size: 22px; font-weight: 650; }
.reference-ui #recipeSheet .sheet-head [data-close] { min-width: 44px; min-height: 44px; border: 1px solid #d8e8df; background: #fff; color: #35664e; }
.reference-ui .ref-capture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.reference-ui .ref-capture { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; overflow: hidden; border-radius: 18px; background: #edf8f4; color: #13795c; font-size: 16px; cursor: pointer; }
.reference-ui .ref-capture.primary { background: #138b68; color: white; }
.reference-ui .ref-capture input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.reference-ui .ref-capture:focus-within { outline: 3px solid #8bcdb3; outline-offset: 3px; }
.reference-ui .ref-favorites { position: relative; padding: 10px 12px; border-radius: 8px; background: #edf8f4; }
.reference-ui .ref-favorite-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reference-ui .ref-favorite-heading h3 { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin: 0; font-size: 15px; }
.reference-ui #useFavoriteIngredients { position: absolute; bottom: 10px; right: 12px; min-width: 70px; min-height: 44px; padding: 7px 12px; border: 1px solid #4f9e80; border-radius: 20px; background: transparent; color: #13795c; font-size: 14px; }
.reference-ui .ref-favorite-note { margin: 0; font-size: 12px; color: #5c7568; line-height: 1.5; }
.reference-ui #recipeFavorites { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; margin-top: 5px; padding-right: 80px; }
.reference-ui .ref-favorite-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 0; color: #245340; font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.reference-ui .ref-favorite-item img { width: 30px; height: 34px; object-fit: contain; }
.reference-ui #recipeSheet .ingredient-card { position: relative; margin-top: 8px; padding: 0; border: 0; background: white; }
.reference-ui #recipeSheet .ingredient-card > .ref-section-heading { display: flex; align-items: center; min-height: 44px; margin: 0; padding-right: 170px; }
.reference-ui .ref-section-heading { margin: 12px 0 6px; font-size: 16px; font-weight: 650; color: #205243; }
.reference-ui #ingredientChips { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.reference-ui #ingredientChips > .empty-note,.reference-ui #ingredientChips > .loading-line { grid-column: 1 / -1; }
.reference-ui #ingredientChips .ingredient-chip { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 4px 3px; border: 1px solid #dfeae4; border-radius: 14px; background: white; color: #697d72; font-size: 13px; }
.reference-ui #ingredientChips .ingredient-chip.selected { background: #edf8f4; border-color: #bddfce; color: #1e634a; }
.reference-ui .ingredient-chip img { width: 22px; height: 26px; object-fit: contain; }
.reference-ui .ingredient-chip small { display: block; font-size: 12px; }
.reference-ui #recipeSheet .manual-ingredients { display: flex; align-items: flex-end; gap: 10px; margin: 12px 0; }
.reference-ui #recipeSheet .manual-ingredients .form-field { flex: 1; min-width: 0; }
.reference-ui #recipeSheet .manual-ingredients .form-field > span { font-size: 12px; }
.reference-ui #recipeSheet .manual-ingredients input { width: 100%; min-height: 44px; font-size: 14px; }
.reference-ui #recipeSheet .manual-ingredients button { min-height: 44px; padding: 6px 10px; white-space: nowrap; font-size: 13px; }
.reference-ui .ref-recipe-options { border-bottom: 1px solid var(--ref-line); }
.reference-ui .ref-recipe-options > summary { position: absolute; top: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 44px; list-style: none; color: #447561; font-size: 12px; cursor: pointer; }
.reference-ui .ref-recipe-options > summary .ref-icon { width: 16px; height: 16px; flex-basis: 16px; }
.reference-ui .ref-recipe-options[open] > summary .ref-icon { transform: rotate(90deg); }
.reference-ui #recipeSheet .chip-row { gap: 7px; margin: 10px 0 16px; }
.reference-ui #recipeSheet .chip-row .chip { min-height: 44px; padding: 8px 14px; border-radius: 18px; font-size: 13px; }
.reference-ui #recipeSourceStatus { min-height: 0; margin: 4px 0; color: #5f7367; font-size: 12px; line-height: 1.5; }
.reference-ui #recipeList { gap: 0; }
.reference-ui #recipeSheet .recipe-card { margin: 0; padding: 10px 0; border: 0; border-bottom: 1px solid var(--ref-line); border-radius: 0; background: white; box-shadow: none; }
.reference-ui .ref-recipe-main { display: grid; grid-template-columns: 122px minmax(0,1fr); gap: 14px; }
.reference-ui .ref-dish-image { position: relative; width: 122px; height: 94px; overflow: hidden; border-radius: 8px; background: #edf8f4; }
.reference-ui .ref-dish-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reference-ui .ref-dish-image > span { position: absolute; right: 0; bottom: 0; padding: 1px 5px; background: #ffffffeb; color: #637467; font-size: 11px; }
.reference-ui .ref-dish-copy { min-width: 0; }
.reference-ui #recipeSheet .recipe-title-row { display: flex; align-items: flex-start; gap: 6px; }
.reference-ui #recipeSheet .recipe-title-row > strong { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.reference-ui #recipeSheet .mini-action { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 4px; border: 0; background: white; color: #68806e; font-size: 12px; }
.reference-ui #recipeSheet .mini-action .ref-icon { width: 16px; height: 16px; flex-basis: 16px; }
.reference-ui #recipeSheet .mini-action.active { background: #edf8f0; color: #0b754f; }
.reference-ui #recipeSheet .recipe-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.reference-ui #recipeSheet .recipe-meta span { padding: 0; border: 0; background: white; color: #637c6d; font-size: 12px; }
.reference-ui #recipeSheet .ref-dish-ingredients,.reference-ui #recipeSheet .ref-recipe-warning { margin: 6px 0 0; color: #6c8074; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.reference-ui #recipeSheet .ref-recipe-warning { color: #8b7152; }
.reference-ui #recipeSheet .recipe-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.reference-ui #recipeSheet .recipe-actions button { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 6px 9px; border: 1px solid #c7e2d4; border-radius: 16px; background: white; color: #1d7754; font-size: 13px; }
.reference-ui #recipeSheet .recipe-actions .ref-icon { width: 16px; height: 16px; flex-basis: 16px; }
.reference-ui #recipeSheet .recipe-actions .muted-action { border-color: transparent; background: #f2f7f3; color: #718476; }
.reference-ui #recipeSheet .ref-recipe-steps { padding: 0 12px; background: #f5faf7; color: #526d5e; font-size: 13px; line-height: 1.7; }
.reference-ui #recipeSheet .ref-recipe-steps[hidden] { display: none; }
.reference-ui #refreshRecipes { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; margin: 16px 0; border-radius: 18px; background: #138b68; color: white; font-size: 16px; }
.reference-ui #shoppingCard { padding: 0; border: 0; border-radius: 8px; background: #edf8f4; }
.reference-ui #shoppingCard > summary { min-height: 48px; margin: 0; padding: 10px 16px; cursor: pointer; list-style: none; }
.reference-ui #shoppingCard h2 { font-size: 17px; }
.reference-ui #shoppingList { padding: 0 16px 14px; }
@media (min-width: 768px) {
  .reference-ui .ref-recipe-main { grid-template-columns: 172px minmax(0,1fr); }
  .reference-ui .ref-dish-image { width: 172px; height: 120px; }
  .reference-ui #recipeSheet .recipe-card { position: relative; padding-right: 170px; min-height: 150px; }
  .reference-ui #recipeSheet .recipe-actions { position: absolute; right: 0; top: 22px; max-width: 156px; }
}
@media (max-width: 600px) {
  body.app-page.reference-ui .screen { padding: 14px 18px calc(90px + env(safe-area-inset-bottom)); }
  body.app-page.reference-ui .topbar { min-height: 70px; margin-bottom: 4px; padding-bottom: 4px; }
  body.app-page.reference-ui .brand-mark,body.app-page.reference-ui .brand-mark img { width: 20px; height: 22px; }
  body.app-page.reference-ui .brand-lockup { grid-template-columns: 20px minmax(0,1fr); row-gap: 2px; }
  body.app-page.reference-ui .brand-lockup .kicker { font-size: 12px; }
  .reference-ui .ref-greeting { margin-top: 4px; }
  body.app-page.reference-ui .topbar h1 { font-size: 20px; }
  .reference-ui .home-date { margin-top: 2px; font-size: 12px; }
  body.app-page.reference-ui #homePanel { padding-top: 6px; }
  body.app-page.reference-ui .score-hero { grid-template-columns: 76px minmax(0,1fr); gap: 6px 12px; padding: 10px 14px; }
  body.app-page.reference-ui .score-ring { width: 70px; height: 70px; }
  .reference-ui .score-copy { padding-left: 12px; }
  .reference-ui #homeIntakeValue { font-size: 26px; }
  body.app-page.reference-ui #homePanel .quick-actions { gap: 8px; }
  body.app-page.reference-ui #homePanel .action { gap: 5px; min-height: 44px; padding: 8px 7px; font-size: 14px; }
  body.app-page.reference-ui #homePanel .action-icon,.reference-ui #homePanel .action-icon img { width: 19px; height: 19px; }
  .reference-ui .ref-meal-open { grid-template-columns: 64px minmax(0,1fr) auto 12px; gap: 10px; min-height: 64px; padding: 7px 0; }
  .reference-ui #homePanel .route-thumb { width: 64px; height: 48px; }
  .reference-ui #homePanel .route-copy strong { margin-top: 3px; font-size: 13px; }
  .reference-ui #homePanel .route-kcal { font-size: 15px; }
  .reference-ui .ref-meal-meta { gap: 5px; }
  .reference-ui .ref-meal-type { font-size: 11px; padding: 1px 5px; }
  .reference-ui #homePanel .section-head { position: relative; min-height: 30px; margin-bottom: 4px; }
  body.app-page.reference-ui #homePanel .section-head h2 { font-size: 15px; }
  .reference-ui #homePanel .ref-calendar-link { position: absolute; right: -10px; top: -7px; }
  .reference-ui .bottom-nav .nav-item img { width: 21px; height: 21px; }
  body.app-page.reference-ui .bottom-nav { padding-top: 5px; padding-bottom: calc(5px + env(safe-area-inset-bottom)); }
  body.app-page.reference-ui .bottom-nav .nav-item { min-height: 48px; padding: 3px; font-size: 11px; }
  body.app-page.reference-ui #recipeSheet .sheet-panel { width: 100%; max-height: 100dvh; padding: 0 18px calc(24px + env(safe-area-inset-bottom)); }
  body.app-page.reference-ui #recipeSheet .sheet-head { margin: 0 -18px; padding: 7px 18px; }
  .reference-ui .ref-recipe-main { grid-template-columns: 100px minmax(0,1fr); gap: 12px; }
  .reference-ui .ref-dish-image { width: 100px; height: 71px; }
  .reference-ui #recipeSheet .recipe-title-row > strong { font-size: 15px; }
  .reference-ui #recipeSheet .mini-action { flex-direction: column; gap: 2px; margin-top: -4px; }
  .reference-ui #recipeSheet .manual-ingredients .form-field > span { display: none; }
  .reference-ui .ref-favorite-heading { align-items: flex-start; gap: 6px; }
}

/* Batch 6: shared identity must keep the reference artwork's original colors. */
body.brand-page .brand img[src*="assets/brand/"],
body.brand-page .preview-top > img[src*="assets/brand/"],
body.admin-page .sidebar > .brand > img[src*="assets/brand/"],
body.report-page .brand img[src*="assets/brand/"],
body.wecom-page img[src*="assets/brand/"] { filter: none; object-fit: contain; }
body.admin-page #adminNav .nav-icon { width: 19px; height: 19px; flex-basis: 19px; opacity: .9; }
body.admin-page .metric-icon { width: 38px; height: 38px; }
body.admin-page .metric-icon img { width: 23px; height: 23px; object-fit: contain; }
body.admin-page .panel-head h2 { font-size: 21px; }
body.admin-page .table-wrap { border: 1px solid var(--line); border-radius: 6px; }
body.admin-page td, body.admin-page th { font-size: 14px; line-height: 1.5; }
body.admin-page th { background: #f3f8f5; color: #526c5f; font-weight: 600; }
body.admin-page tbody tr:hover { background: #f5faf7; }
body.admin-page .metric-grid .metric-card { min-height: 154px; }
body.admin-page .metric-grid .metric-card strong { font-weight: 650; }
body.admin-page #aiConfig .ai-config-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 18px 0; }
body.admin-page .ref-provider-card { padding: 18px; border: 1px solid #dfebe3; border-radius: 8px; background: #fff; }
body.admin-page .ref-provider-card h3 { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; color: #254c3c; font-size: 17px; font-weight: 600; }
body.admin-page .ref-provider-rank { padding: 3px 12px; border-radius: 14px; background: #e5f5ec; color: #138b68; font-size: 12px; }
body.admin-page .ref-provider-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 20px; }
body.admin-page .ref-provider-fields > div,
body.admin-page .ref-provider-fields label { display: grid; min-width: 0; gap: 8px; }
body.admin-page .ref-provider-fields span { color: #71877b; font-size: 12px; }
body.admin-page .ref-provider-fields strong { overflow-wrap: anywhere; color: #2b4b3c; font-size: 13px; font-weight: 500; }
body.admin-page .ref-provider-fields input { width: 100%; min-width: 0; min-height: 42px; }
body.admin-page .ref-provider-state { margin: 12px 0 0; color: #7e7558; font-size: 12px; }
body.admin-page .popup-preview { background: #f4faf6; }
body.admin-page .popup-preview-card { border-color: #dcebe1; box-shadow: none; }
body.admin-page .popup-preview-card > img { background: #edf7f1; }
body.admin-page .ref-poster-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; aspect-ratio: 3 / 4; background: #edf7f1; color: #63816e; font-size: 14px; }
body.admin-page .ref-poster-empty > img { width: 40px; height: 40px; aspect-ratio: 1; background: transparent; object-fit: contain; }
body.brand-page .preview-actions img[src*="assets/brand/"] { filter: none; object-fit: contain; }

body.app-page.reference-ui:not([data-active-tab="home"]) .topbar {
  min-height: 76px; margin-bottom: 10px;
  background: url('./assets/brand/h5-home-canopy.png') top right / 145px auto no-repeat;
}
.reference-ui #calendarPanel .calendar-weekdays { margin: 0; padding: 7px 0; color: #68877a; font-size: 12px; }
.reference-ui #calendarGrid { gap: 0; padding: 0 4px 8px; border-radius: 0 0 8px 8px; background: #f9fcfa; }
.reference-ui #calendarGrid .day { min-height: 44px; height: 44px; padding: 2px; border: 0; border-radius: 50%; font-size: 13px; }
.reference-ui #calendarGrid .day.selected { background: #138b68; color: #fff; box-shadow: inset 0 0 0 4px #e3f3eb; }
.reference-ui #calendarGrid .day.today:not(.selected) { color: #087351; box-shadow: inset 0 0 0 1px #6fbea2; }
.reference-ui #calendarMonthSummary { gap: 0; margin: 10px 0 12px; padding: 10px 4px; border-radius: 8px; background: #edf8f4; }
.reference-ui #calendarMonthSummary article { flex-direction: column; gap: 3px; padding: 0 3px; text-align: center; }
.reference-ui #calendarMonthSummary .month-summary-copy { align-items: center; }
.reference-ui #calendarMonthSummary .month-summary-icon { width: 22px; height: 22px; background: transparent; }
.reference-ui #calendarMonthSummary .month-summary-icon img { width: 20px; height: 20px; }
.reference-ui #calendarMonthSummary small { font-size: 11px; }
.reference-ui #calendarMonthSummary strong { font-size: 12px; }
.reference-ui #dayDetail { margin-top: 0; padding: 12px; border: 1px solid #e5eee8; border-radius: 8px; background: #fff; }
.reference-ui #dayDetail > strong { font-size: 14px; }
.reference-ui #dayDetail > p { margin: 5px 0; color: #61796e; font-size: 12px; }
.reference-ui #dayDetail ul { margin: 5px 0 0; padding: 0; list-style: none; }
.reference-ui #dayDetail li.ref-calendar-meal { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #edf3ef; font-size: 12px; }
.reference-ui #dayDetail li.ref-calendar-meal:last-child { border-bottom: 0; }
.reference-ui .ref-calendar-meal > img { width: 44px; height: 36px; border-radius: 5px; object-fit: cover; }
.reference-ui .ref-calendar-meal > img.is-placeholder { padding: 9px; object-fit: contain; background: #edf8f4; }
.reference-ui .ref-calendar-meal time { display: block; color: #75877e; font-size: 11px; }
.reference-ui .ref-calendar-meal b { white-space: nowrap; font-size: 12px; font-weight: 550; }
.reference-ui #calendarPanel .nutrition-quick-search { margin-top: 12px; padding: 12px; border: 0; background: #edf8f4; }
.reference-ui #calendarPanel .nutrition-quick-search h2 { font-size: 16px; }
.reference-ui #calendarPanel .nutrition-quick-search .section-head > span { font-size: 11px; }

.reference-ui #reportPanel > .section-head,
.reference-ui #socialPanel > .section-head { margin: 0 0 8px; }
.reference-ui #reportPanel > .section-head > div,
.reference-ui #socialPanel > .section-head > div { display: none; }
.reference-ui #reportPanel > .section-head { display: none; }
.reference-ui #reportPanel .report-tabs { display: flex; gap: 0; margin: 0 0 12px; padding: 3px; border-radius: 8px; background: #edf7f2; }
.reference-ui #reportPanel .report-tabs button { flex: 1; min-height: 38px; padding: 6px; border: 0; background: transparent; font-size: 13px; }
.reference-ui #reportPanel .report-tabs button.selected { background: #138b68; color: #fff; }
.reference-ui #reportContent .report-card { margin: 10px 0; padding: 14px; border: 1px solid #e6eee9; border-radius: 8px; box-shadow: none; }
.reference-ui #reportContent .report-card.soft { background: #f1f9f5; }
.reference-ui #reportContent .report-card > strong { font-size: 15px; font-weight: 600; }
.reference-ui #reportContent .report-card > p { margin: 6px 0; font-size: 13px; line-height: 1.6; }
.reference-ui .ref-report-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 12px 3px; border-radius: 8px; background: #edf8f4; }
.reference-ui .ref-report-metrics > div { display: flex; flex-direction: column; align-items: center; gap: 4px; border-right: 1px solid #dceee4; text-align: center; }
.reference-ui .ref-report-metrics > div:last-child { border-right: 0; }
.reference-ui .ref-report-metrics img { width: 20px; height: 20px; }
.reference-ui .ref-report-metrics strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.reference-ui .ref-report-metrics span { color: #698175; font-size: 11px; }
.reference-ui .trend-list.ref-trend-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin: 12px 0 0; padding: 0; overflow: visible; }
.reference-ui .ref-trend-chart .ref-trend-column { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 0; border: 0; background: transparent; }
.reference-ui .ref-trend-column > strong { font-size: 11px; font-weight: 550; }
.reference-ui .ref-trend-column .ref-trend-track { display: flex; align-items: flex-end; width: 100%; height: 100px; min-width: 0; padding: 0 3px; border: 0; border-bottom: 1px solid #dae9e1; border-radius: 0; background: #f5faf7; }
.reference-ui .ref-trend-track i { display: block; width: 100%; min-width: 0; margin: 0; border-radius: 3px 3px 0 0; background: #22a17c; }
.reference-ui .ref-trend-column b { margin-top: 5px; font-size: 10px; font-weight: 500; white-space: nowrap; }
.reference-ui .ref-trend-column > small { font-size: 10px; color: #71877b; white-space: nowrap; }
.reference-ui .recipe-mini-list > article { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; padding: 10px 0; }
.reference-ui .recipe-mini-list figure { position: relative; width: 80px; margin: 0; }
.reference-ui .recipe-mini-list img { display: block; width: 80px; height: 60px; border-radius: 6px; object-fit: cover; }
.reference-ui .recipe-mini-list figcaption { margin-top: 3px; color: #6d8075; font-size: 10px; }
.reference-ui .recipe-mini-list p, .reference-ui .recipe-mini-list small { font-size: 12px; line-height: 1.6; }

.reference-ui #pointsPanel { position: relative; }
.reference-ui #pointsPanel > .section-head { min-height: 40px; margin-bottom: 8px; }
.reference-ui #pointsPanel > .section-head .kicker { display: none; }
.reference-ui #pointsPanel > .section-head h2 { font-size: 16px; }
.reference-ui #pointsContent .points-hero { gap: 12px; padding: 18px; border: 0; border-radius: 8px; background: #138b68; color: #fff; }
.reference-ui #pointsContent .points-hero span, .reference-ui #pointsContent .points-hero p { color: #def4e8; font-size: 12px; }
.reference-ui #pointsContent .points-hero strong { color: #fff; font-size: 27px; font-weight: 600; }
.reference-ui #pointsContent .points-hero p { margin: 0; }
.reference-ui .ref-points-progress { grid-column: 1 / -1; width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 5px; background: #78c4a9; accent-color: #d2f2e4; }
.reference-ui .ref-points-progress::-webkit-progress-bar { background: #6fbea4; }
.reference-ui .ref-points-progress::-webkit-progress-value { background: #d6f4e7; }
.reference-ui #pointsContent .task-list { gap: 0; margin-top: 12px; }
.reference-ui #pointsContent .task-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; min-height: 74px; padding: 10px 0; border: 0; border-bottom: 1px solid #e7efeb; border-radius: 0; background: #fff; text-align: left; }
.reference-ui .ref-task-icon { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: #edf8f3; object-fit: contain; }
.reference-ui #pointsContent .task-item span { font-size: 14px; }
.reference-ui #pointsContent .task-item small { display: block; margin-top: 4px; color: #7a8a81; font-size: 11px; font-weight: 400; line-height: 1.5; }
.reference-ui #pointsContent .task-item strong { color: #138b68; font-size: 12px; font-weight: 600; }
.reference-ui .ref-points-rules { margin: 14px 0; padding: 12px; border-radius: 8px; background: #f3f9f5; color: #3a6652; font-size: 13px; }
.reference-ui .ref-points-rules summary { cursor: pointer; min-height: 28px; }
.reference-ui .ref-points-rules p { margin: 6px 0 0; line-height: 1.7; }
.reference-ui #socialPanel .social-intro { margin: 8px 0 12px; font-size: 13px; line-height: 1.6; }
.reference-ui #socialPanel .poll-composer { gap: 6px; margin: 0 0 14px; padding: 14px; border: 0; border-radius: 8px; background: #edf8f4; }
.reference-ui #socialPanel .poll-composer input { min-height: 44px; padding: 8px 10px; background: #fff; }
.reference-ui #socialPanel .poll-field-label { margin-top: 6px; font-size: 12px; }
.reference-ui #socialPanel .poll-form-hint { margin: 4px 0; font-size: 12px; }
.reference-ui #socialPanel .poll-form-status:empty { display: none; }
.reference-ui #socialPanel .poll-submit { min-height: 44px; margin-top: 4px; border-radius: 22px; }

body.app-page.reference-ui #mealSheet .sheet-head,
body.app-page.reference-ui #exerciseSheet .sheet-head,
body.app-page.reference-ui #profileSheet .sheet-head { background: #fff url('./assets/brand/h5-recipe-leaves.png') top right / 100px auto no-repeat; }
.reference-ui #mealSheet .close-button,
.reference-ui #exerciseSheet .close-button,
.reference-ui #profileSheet .close-button { min-width: 44px; min-height: 44px; border: 1px solid #dfebe4; background: #fff; color: #237455; }
.reference-ui #mealSheet .upload-box { min-height: 112px; padding: 12px; border: 1px dashed #a6d1bd; border-radius: 8px; background: #edf8f4; }
.reference-ui #mealSheet .upload-box > span { font-size: 15px; }
.reference-ui #mealSheet .upload-box > small { font-size: 12px; }
.reference-ui #mealPreview { max-height: 180px; margin-top: 10px; border-radius: 8px; }
.reference-ui #mealPreview img { width: 100%; height: 180px; object-fit: cover; }
.reference-ui #mealPreview:empty { display: none; }
.reference-ui #mealSheet .recognition-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; padding: 14px; border-radius: 8px; background: #f4faf7; }
.reference-ui #mealRecognitionStatus, .reference-ui #mealRecognitionMessage,
.reference-ui #mealNutrition, .reference-ui #mealItems, .reference-ui #portionOptions { grid-column: 1 / -1; }
.reference-ui #mealRecognitionMessage { margin: 0; font-size: 12px; }
.reference-ui #mealSheet .form-field { min-width: 0; margin: 0; font-size: 13px; }
.reference-ui #portionOptions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
.reference-ui #portionOptions button { min-height: 44px; padding: 6px 3px; border: 0; border-radius: 22px; font-size: 13px; }
.reference-ui #portionOptions button.selected { background: #138b68; color: #fff; }
.reference-ui #exerciseSheet .exercise-grid { gap: 8px; margin-top: 10px; }
.reference-ui #exerciseGrid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 78px; padding: 10px 4px; border: 1px solid transparent; border-radius: 8px; background: #edf8f4; color: #255c49; font-size: 14px; font-weight: 500; }
.reference-ui #exerciseGrid img { width: 26px; height: 26px; object-fit: contain; }
.reference-ui #exerciseGrid [aria-pressed="true"] { border-color: #138b68; background: #dff2e9; color: #086c51; box-shadow: inset 0 0 0 1px #138b68; }
.reference-ui #exerciseDurationOptions { gap: 8px; margin: 7px 0 14px; }
.reference-ui #exerciseDurationOptions button { min-height: 44px; padding: 6px 4px; border: 0; border-radius: 22px; background: #edf8f4; font-size: 13px; }
.reference-ui #exerciseDurationOptions [aria-pressed="true"] { background: #138b68; color: #fff; }
.reference-ui #exerciseSheet .exercise-custom { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reference-ui #exerciseSheet .exercise-custom label { min-width: 0; font-size: 13px; }
.reference-ui #exerciseSheet .exercise-estimate-note { font-size: 12px; line-height: 1.6; }
.reference-ui #exerciseNotice:empty, .reference-ui #profileStatus:empty { display: none; }
.reference-ui #profileDetails { padding: 12px; border: 0; border-radius: 8px; background: #f0f8f4; }
.reference-ui #profileDetails > summary { min-height: 44px; padding: 0 0 8px; color: #235b47; }
.reference-ui #profileDetails > summary > span { font-size: 14px; }
.reference-ui #profileDetails > summary > small { font-size: 11px; }
.reference-ui #profileDetails .profile-card { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.reference-ui #profileDetails .profile-card label { min-width: 0; font-size: 12px; }
.reference-ui #profileDetails .profile-card input,
.reference-ui #profileDetails .profile-card select,
.reference-ui #profileDetails .profile-card textarea,
.reference-ui #exerciseSheet input,
.reference-ui #exerciseSheet select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #dcebe2; border-radius: 6px; background: #fff; font-size: 15px; }
.reference-ui #profileDetails .condition-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.reference-ui #profileDetails .condition-list button { min-height: 36px; padding: 5px 9px; border: 1px solid #d8e9df; border-radius: 18px; background: #fff; font-size: 12px; }
.reference-ui #profileDetails .condition-list button.active { background: #138b68; color: #fff; }
.reference-ui #profileDetails .profile-card input,
.reference-ui #profileDetails .profile-card select { height: 44px; }

body.wecom-page { background: #f5fbf8 url('./assets/brand/h5-home-canopy.png') top right / 260px auto no-repeat; }
body.wecom-page .wecom-header { border-bottom: 0; }
body.wecom-page .wecom-brand .kicker { color: #719181; font-size: 12px; }
body.wecom-page .wecom-status { border: 0; background: #eaf6ef; }
body.wecom-page .wecom-features { margin-top: 18px; }
body.wecom-page .wecom-features article { gap: 9px; padding: 10px 0; }
body.wecom-page .wecom-features article img { width: 22px; height: 22px; }
body.wecom-page .wecom-button { border-radius: 24px; }
body.wecom-page .wecom-service { padding: 14px; border-radius: 8px; background: #eaf6ef; }
body.wecom-page .wecom-preview img { border-radius: 8px; }
body.report-page .paper .hero { background: #edf8f2 url('./assets/brand/h5-home-canopy.png') right top / 180px auto no-repeat; }
body.report-page .paper .summary { gap: 0; padding: 14px; margin: 0; background: #f2faf6; }
body.report-page .paper .summary article { min-width: 0; padding: 10px; border: 0; border-right: 1px solid #dfede4; border-radius: 0; background: transparent; }
body.report-page .paper .summary strong { font-size: 20px; font-weight: 600; }
body.brand-page .hero-food-image { opacity: 1; }
body.brand-page .hero-panel::before { background: linear-gradient(90deg, rgba(255,255,255,.97), rgba(255,255,255,.68) 39%, rgba(255,255,255,.05) 62%); }

@media (max-width: 640px) {
  body.admin-page .ref-provider-fields { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  body.app-page.reference-ui:not([data-active-tab="home"]) .topbar { min-height: 76px; }
  body.app-page.reference-ui #mealSheet .sheet-panel,
  body.app-page.reference-ui #exerciseSheet .sheet-panel,
  body.app-page.reference-ui #profileSheet .sheet-panel { padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); }
  body.app-page.reference-ui #mealSheet .sheet-head,
  body.app-page.reference-ui #exerciseSheet .sheet-head,
  body.app-page.reference-ui #profileSheet .sheet-head { top: -12px; min-height: 52px; margin-bottom: 10px; padding: 4px 0; }
  .reference-ui #mealSheet .sheet-panel:has(#mealPreview img) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; column-gap: 10px; }
  .reference-ui #mealSheet .sheet-panel:has(#mealPreview img) > .grabber,
  .reference-ui #mealSheet .sheet-panel:has(#mealPreview img) > .sheet-head,
  .reference-ui #mealSheet .sheet-panel:has(#mealPreview img) > .recognition-card,
  .reference-ui #mealSheet .sheet-panel:has(#mealPreview img) > #saveMeal { grid-column: 1 / -1; }
  .reference-ui #mealSheet .sheet-panel:has(#mealPreview img) .upload-box { grid-column: 2; grid-row: 3; margin: 0; }
  .reference-ui #mealSheet .sheet-panel:has(#mealPreview img) #mealPreview { grid-column: 1; grid-row: 3; margin: 0; height: 148px; }
  .reference-ui #mealSheet .sheet-panel:has(#mealPreview img) #mealPreview img { height: 148px; }
  .reference-ui #mealSheet .sheet-panel:has(#mealPreview img) > .recognition-card { grid-row: 4; }
  .reference-ui #mealSheet .sheet-panel:has(#mealPreview img) > #saveMeal { grid-row: 5; }
  body.wecom-page .wecom-header { justify-content: center; min-height: 68px; }
  body.wecom-page .wecom-header > span { display: none; }
  body.wecom-page .wecom-shell { min-height: auto; padding-top: 14px; gap: 24px; }
  body.wecom-page .wecom-brand { display: block; text-align: center; }
  body.wecom-page .wecom-card h1 { font-size: 26px; }
  body.wecom-page .wecom-lead { margin-top: 16px; font-size: 14px; }
  body.wecom-page .wecom-preview { margin-top: 0; }
  body.wecom-page .wecom-preview img { max-height: 240px; object-fit: cover; }
  body.report-page .paper { width: calc(100% - 24px); margin: 14px 12px; }
  body.report-page .paper .hero { gap: 12px; padding: 22px 16px; }
  body.report-page .hero h1 { font-size: 22px; }
  body.report-page .hero #guide { font-size: 12px; }
  body.report-page .paper .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; }
  body.report-page .paper .summary article:nth-child(even) { border-right: 0; }
  body.report-page .paper .summary strong { font-size: 18px; }
  body.report-page .paper .summary span { font-size: 12px; }
  body.brand-page .hero-panel::before { background: rgba(255,255,255,.78); }
}
