@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap");

:root {
  --fl-bg: #eef2ef;
  --fl-bg-deep: #e2eae5;
  --fl-surface: #ffffff;
  --fl-ink: #12261c;
  --fl-ink-soft: #4a6356;
  --fl-muted: #7a9085;
  --fl-line: #d9e5dd;
  --fl-primary: #1f6b4a;
  --fl-primary-deep: #144833;
  --fl-primary-soft: #e6f3ec;
  --fl-accent: #c4a35a;
  --fl-danger: #b54747;
  --fl-warn-bg: #fff6e8;
  --fl-warn-ink: #8a6a32;
  --fl-radius: 16px;
  --fl-radius-sm: 12px;
  --fl-shadow: 0 8px 24px rgba(18, 38, 28, 0.06);
  --fl-shadow-press: 0 2px 8px rgba(18, 38, 28, 0.08);
  --fl-font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --fl-display: "Sora", "Noto Sans SC", sans-serif;

  --van-primary-color: #1f6b4a;
  --van-success-color: #1f6b4a;
  --van-danger-color: #b54747;
  --van-tabbar-item-active-color: #1f6b4a;
  --van-nav-bar-background: transparent;
  --van-nav-bar-title-text-color: #fff;
  --van-nav-bar-icon-color: #fff;
  --van-nav-bar-text-color: #fff;
  --van-nav-bar-height: 48px;
  --van-button-primary-background: #1f6b4a;
  --van-button-primary-border-color: #1f6b4a;
  --van-button-radius: 999px;
  --van-cell-vertical-padding: 12px;
  --van-field-label-width: 6.2em;
  --van-tabbar-background: rgba(255, 255, 255, 0.92);
  --van-tabbar-height: 56px;
  --van-checkbox-checked-icon-color: #1f6b4a;
  --van-progress-color: #1f6b4a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  background:
    radial-gradient(1200px 480px at 10% -10%, rgba(31, 107, 74, 0.12), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(196, 163, 90, 0.10), transparent 50%),
    var(--fl-bg);
  color: var(--fl-ink);
  font-family: var(--fl-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#app {
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

button, .chip, .diet-pick, .fab, .sched-move, .link-del, .link-edit, .nav-action {
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

button:active,
.chip:active,
.diet-pick:active,
.fab:active,
.tpl-card:active,
.meal-row:active,
.check-item:active,
.food-item:active,
.supp-card:active {
  transform: scale(0.985);
}

/* ===== Top bar ===== */
.app-shell {
  position: relative;
}
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(160deg, #144833 0%, #1f6b4a 58%, #2a7d58 100%);
  color: #fff;
  padding-bottom: 2px;
  box-shadow: 0 8px 24px rgba(20, 72, 51, 0.22);
}
.app-topbar .van-nav-bar {
  background: transparent !important;
}
.app-topbar .van-hairline--bottom::after {
  border: none !important;
}
.nav-title-main {
  font-family: var(--fl-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}
.nav-title-sub {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.82;
  margin-top: 2px;
}
.nav-action {
  color: #fff;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.page-main {
  padding: 14px 14px 96px;
  max-width: 480px;
  margin: 0 auto;
}
.page-main--onboard {
  padding-bottom: 28px;
}

/* ===== Cards ===== */
.card-block {
  background: var(--fl-surface);
  border-radius: var(--fl-radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(217, 229, 221, 0.9);
  box-shadow: var(--fl-shadow);
  animation: cardIn 0.35s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.card-block h3,
.card-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--fl-ink);
  letter-spacing: 0.01em;
}
.card-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.card-hd h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-hd-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  background: var(--fl-primary-soft);
  color: var(--fl-primary);
  flex-shrink: 0;
}
.icon-badge--lg {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 22px;
}
.icon-badge--gold {
  background: #f7efd8;
  color: #9a7a2f;
}
.icon-badge--blue {
  background: #e8f1fb;
  color: #3a6ea5;
}

.muted {
  color: var(--fl-muted);
  font-size: 12px;
  line-height: 1.55;
}

/* ===== Login ===== */
.login-wrap {
  min-height: calc(100vh - 48px);
  padding: 20px 18px 40px;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.login-fields {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}
.login-field {
  display: block;
  background: #f7faf8;
  border: 1px solid #e8eee9;
  border-radius: 12px;
  padding: 10px 12px;
}
.login-field-label {
  display: block;
  font-size: 12px;
  color: var(--fl-muted);
  margin-bottom: 6px;
}
.login-field input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--fl-ink);
  padding: 0;
}
.login-hero {
  text-align: center;
  margin-bottom: 22px;
}
.login-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 22px;
  background: linear-gradient(145deg, #1f6b4a, #144833);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(31, 107, 74, 0.35);
  font-size: 34px;
}
.login-brand {
  font-family: var(--fl-display);
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--fl-ink);
  letter-spacing: 0.02em;
}
.login-card {
  background: var(--fl-surface);
  border-radius: 20px;
  padding: 20px 16px 18px;
  box-shadow: var(--fl-shadow);
  border: 1px solid var(--fl-line);
}
.login-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fl-ink);
  margin: 0 0 6px;
}
.auth-switch {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
}
.auth-switch a {
  color: var(--fl-primary);
  font-weight: 600;
  text-decoration: none;
}

/* ===== Save hint ===== */
.save-hint {
  position: sticky;
  top: 52px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(230, 243, 236, 0.95);
  color: var(--fl-primary);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  border: 1px solid #cfe6d9;
  backdrop-filter: blur(8px);
  animation: hintIn 0.25s ease;
}
@keyframes hintIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* ===== Today: chips / diet ===== */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid var(--fl-line);
  background: #f7faf8;
  color: var(--fl-ink-soft);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chip.active {
  background: var(--fl-primary);
  border-color: var(--fl-primary);
  color: #fff;
  box-shadow: 0 6px 14px rgba(31, 107, 74, 0.28);
}

.diet-pick-row {
  display: grid;
  gap: 8px;
}
.diet-pick {
  text-align: left;
  border: 1.5px solid var(--fl-line);
  background: #f8fbf9;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
}
.diet-pick.active {
  border-color: var(--fl-primary);
  background: var(--fl-primary-soft);
  box-shadow: inset 0 0 0 1px rgba(31, 107, 74, 0.15);
}
.diet-pick-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
  color: var(--fl-ink);
}
.diet-pick-body {
  flex: 1;
  min-width: 0;
}
.diet-suggest {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f6f8f6;
  border: 1px dashed #cfdcd4;
}
.diet-suggest-line {
  font-size: 12px;
  color: var(--fl-ink-soft);
  padding: 5px 0;
  line-height: 1.45;
  display: flex;
  gap: 8px;
}
.diet-suggest-line b {
  color: var(--fl-primary);
  min-width: 3.2em;
  flex-shrink: 0;
}

.label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fl-muted);
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 8px;
}
.label-row + .chip-row,
.label-row + .diet-pick-row {
  margin-bottom: 2px;
}
.section-gap {
  margin-top: 14px;
}

/* ===== Intake ring ===== */
.intake-row {
  display: flex;
  gap: 16px;
  align-items: center;
}
.ring-simple {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 9px solid #e4eee8;
  border-top-color: var(--fl-primary);
  border-right-color: #6fb893;
  display: grid;
  place-content: center;
  text-align: center;
  flex-shrink: 0;
  background: linear-gradient(180deg, #f7fbf9, #fff);
  box-shadow: inset 0 0 0 1px rgba(31, 107, 74, 0.04);
}
.ring-pct {
  font-family: var(--fl-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--fl-primary);
  line-height: 1.1;
}
.intake-side {
  flex: 1;
}
.intake-remain {
  text-align: left;
}
.intake-remain .num {
  font-family: var(--fl-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--fl-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.macro-item {
  margin-top: 12px;
}
.macro-item .label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 5px;
  color: var(--fl-ink-soft);
  font-weight: 500;
}

/* ===== Meals ===== */
.card-block--flush {
  padding: 4px 0 8px;
}
.section-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 4px;
}
.section-hd h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.meal-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f4f2;
  cursor: pointer;
}
.meal-row:last-child {
  border-bottom: none;
}
.meal-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--fl-primary-soft);
  color: var(--fl-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 18px;
}
.meal-main {
  flex: 1;
  min-width: 0;
}
.meal-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--fl-ink);
}
.meal-lines {
  margin-top: 6px;
  display: grid;
  gap: 4px;
}
.meal-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  background: #f5f8f6;
  border-radius: 10px;
  padding: 7px 10px;
  color: var(--fl-ink-soft);
}
.link-del {
  border: 0;
  background: transparent;
  color: var(--fl-danger);
  font-size: 12px;
  padding: 0;
  font-weight: 600;
}
.link-edit {
  border: 0;
  background: var(--fl-primary-soft);
  color: var(--fl-primary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  font-weight: 600;
}

/* ===== Check items ===== */
.check-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f4f2;
}
.check-item:last-child {
  border-bottom: none;
}
.check-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.train-detail-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
  background: #f6f9f7;
  border-radius: 12px;
  padding: 4px 8px;
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(145deg, #2a7d58, #144833);
  color: #fff;
  font-size: 0;
  box-shadow: 0 10px 24px rgba(31, 107, 74, 0.4);
  z-index: 40;
  display: grid;
  place-items: center;
}
.fab .van-icon {
  font-size: 26px !important;
}

/* ===== Stats / dash ===== */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-box {
  background: linear-gradient(180deg, #f8fbf9, #f3f7f4);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  border: 1px solid #e6eee9;
}
.stat-box .label {
  font-size: 12px;
  color: var(--fl-muted);
  font-weight: 500;
}
.stat-box .value {
  font-family: var(--fl-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--fl-ink);
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.stat-box .unit {
  font-size: 12px;
  font-weight: 500;
  margin-left: 2px;
  color: var(--fl-muted);
}
.chart-svg {
  width: 100%;
  height: 110px;
  margin-top: 12px;
  background: #f7faf8;
  border-radius: 12px;
  padding: 8px;
}
.weight-chart-wrap {
  margin-top: 12px;
}
.chart-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.chart-svg--axes {
  height: 200px;
  padding: 6px 4px 2px;
  display: block;
}
.chart-grid {
  stroke: #e3ece7;
  stroke-width: 1;
}
.chart-axis {
  stroke: #9bb5a6;
  stroke-width: 1.2;
}
.chart-line {
  stroke: #1f6b4a;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-dot {
  fill: #1f6b4a;
  stroke: #fff;
  stroke-width: 1.2;
}
.chart-label {
  fill: #6b7f74;
  font-size: 10px;
}
.chart-unit {
  margin-top: 4px;
  font-size: 11px;
  color: var(--fl-muted);
  text-align: right;
}
.plateau-tip {
  background: var(--fl-warn-bg);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--fl-warn-ink);
  border: 1px solid #f0e2c4;
  line-height: 1.55;
}

/* ===== Plan ===== */
.plan-summary {
  background:
    linear-gradient(145deg, rgba(31, 107, 74, 0.08), transparent 50%),
    var(--fl-surface);
}
.plan-summary-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.plan-story {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fl-muted);
  max-width: 42em;
}
.plan-calorie-line {
  background: rgba(247, 250, 248, 0.95);
  border: 1px solid #e8f0eb;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 650;
  color: var(--fl-ink);
  line-height: 1.45;
}
.plan-now-name {
  margin-top: 8px;
  font-size: 12px;
  color: var(--fl-muted);
}
.plan-lib-hd {
  cursor: pointer;
  user-select: none;
}
.plan-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.plan-meta-grid > div {
  background: rgba(247, 250, 248, 0.95);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #e8f0eb;
}
.plan-meta-grid span {
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
  color: var(--fl-muted);
}
.plan-meta-grid b {
  font-family: var(--fl-display);
  font-size: 15px;
  color: var(--fl-ink);
  font-weight: 700;
}

.tpl-card {
  margin-bottom: 10px;
  border-radius: 14px;
  background: #f7faf8;
  border: 1.5px solid var(--fl-line);
  padding: 14px;
  cursor: pointer;
}
.tpl-card.selected {
  border-color: var(--fl-primary);
  background: var(--fl-primary-soft);
  box-shadow: 0 0 0 1px rgba(31, 107, 74, 0.12);
}
.tpl-card-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.tpl-card-hd strong {
  font-size: 14px;
}
.tpl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.plan-pane {
  margin-top: 12px;
}
.macro-day-card {
  background: #f7faf8;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid #e8eee9;
}
.macro-day-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.macro-day-vals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
}
.macro-day-vals b {
  display: block;
  font-family: var(--fl-display);
  font-size: 16px;
  color: var(--fl-primary);
  font-weight: 700;
}
.macro-day-vals span {
  font-size: 11px;
  color: var(--fl-muted);
}

.sched-list {
  display: grid;
  gap: 8px;
}
.sched-row {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--fl-line);
  border-radius: 14px;
  background: #fff;
  align-items: stretch;
  touch-action: pan-y;
}
.sched-row.dragging {
  opacity: 0.85;
  border-color: var(--fl-primary);
  background: var(--fl-primary-soft);
  box-shadow: var(--fl-shadow);
}
.sched-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.drag-handle {
  cursor: grab;
  font-size: 20px;
  line-height: 1;
  color: var(--fl-primary);
  user-select: none;
  padding: 6px 8px;
  touch-action: none;
  border-radius: 8px;
  background: var(--fl-primary-soft);
}
.sched-move {
  width: 30px;
  height: 30px;
  border: 1px solid var(--fl-line);
  border-radius: 9px;
  background: #f7faf8;
  color: var(--fl-ink);
  font-size: 14px;
  line-height: 1;
  padding: 0;
  font-weight: 700;
}
.sched-body {
  flex: 1;
  min-width: 0;
}
.sched-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.sched-select {
  max-width: 58%;
  border: 1px solid var(--fl-line);
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
  font-size: 13px;
  color: var(--fl-ink);
}
.sched-ex {
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.4;
}
.move-edit-block {
  margin-bottom: 8px;
}

.supp-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: #f7faf8;
  border: 1px solid #e4eee8;
  cursor: pointer;
}
.supp-card-main {
  flex: 1;
  min-width: 0;
}
.supp-card-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

/* ===== Account ===== */
.account-card {
  background:
    linear-gradient(135deg, rgba(31, 107, 74, 0.1), transparent 55%),
    var(--fl-surface);
}
.account-card .account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, #1f6b4a, #144833);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.account-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--fl-ink);
  margin-bottom: 4px;
  font-family: var(--fl-display);
}

/* ===== Food popup ===== */
.meal-popup .food-toolbar {
  flex: 0 0 auto !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 8px 0 12px !important;
}
.meal-popup .food-search.van-search {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
.meal-popup .food-search .van-search__content {
  flex: 1 1 auto !important;
  width: 100% !important;
  background: #fff;
  border: 1px solid var(--fl-line);
}
.meal-popup .food-cats {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 0 2px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: static !important;
  float: none !important;
}
.food-cats::-webkit-scrollbar {
  display: none;
}
.food-cat-chip {
  flex: 0 0 auto;
  border: 1px solid #d7e3db;
  background: #fff;
  color: var(--fl-ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}
.food-cat-chip.active {
  background: var(--fl-primary);
  border-color: var(--fl-primary);
  color: #fff;
  font-weight: 600;
}
.food-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}
.food-list--tall {
  max-height: none;
  flex: 1;
  min-height: 180px;
}
.meal-popup {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px 14px 0;
  box-sizing: border-box;
  background: #f8faf9;
}
.meal-popup-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.meal-popup-hd h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.meal-popup-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.meal-popup-ft {
  flex-shrink: 0;
  padding: 12px 0 calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #e8eee9;
  background: #fff;
  margin: 0 -14px;
  padding-left: 14px;
  padding-right: 14px;
}
.meal-picked {
  margin-bottom: 8px;
}
.meal-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}
.food-item {
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 6px;
  background: #fff;
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(18, 38, 28, 0.04);
}
.food-item.active {
  background: var(--fl-primary-soft);
  border-color: var(--fl-primary);
}

.onboard-steps {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--fl-surface);
  border-radius: var(--fl-radius);
  border: 1px solid var(--fl-line);
}

/* ===== Tabbar ===== */
.van-tabbar {
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(217, 229, 221, 0.8);
  box-shadow: 0 -6px 20px rgba(18, 38, 28, 0.05);
}
.van-tabbar-item__text {
  font-size: 11px !important;
  font-weight: 600;
  margin-top: 2px;
}

/* ===== Empty / misc ===== */
.empty-soft {
  text-align: center;
  padding: 18px 8px;
  color: var(--fl-muted);
  font-size: 13px;
}
.btn-stack {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.field-card {
  background: #f7faf8;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid #e8eee9;
}
.field-card .van-cell {
  background: transparent;
}

.notice-soft {
  margin-bottom: 10px;
  border-radius: 12px !important;
  overflow: hidden;
}

.select-native {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--fl-ink);
  outline: none;
  font-family: inherit;
}

.vip-lock-mask {
  position: relative;
}
.vip-lock-mask::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  border-radius: inherit;
  backdrop-filter: blur(1px);
}
.vip-lock-tip {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px;
  color: var(--fl-primary);
  font-weight: 700;
  font-size: 13px;
}
.tpl-card.is-locked {
  opacity: 0.72;
  position: relative;
}
.tpl-card.is-locked .tpl-lock {
  margin-left: 4px;
  color: #9a7a2f;
}
.chip.is-locked,
.diet-pick.is-locked {
  opacity: 0.65;
}
.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.vip-badge--on {
  background: #f7efd8;
  color: #9a7a2f;
}
.vip-badge--off {
  background: #eef2ef;
  color: #7a9085;
}
.vip-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e8f5ee, #f7efd8);
  border: 1px solid #d9e5dd;
  margin-bottom: 12px;
}

.day-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 0 12px;
  padding: 4px;
  background: #e8f0eb;
  border-radius: 14px;
}
.day-seg-item {
  border: none;
  background: transparent;
  color: #5f7569;
  font-size: 15px;
  font-weight: 650;
  padding: 10px 12px;
  border-radius: 11px;
  cursor: pointer;
}
.day-seg-item.on {
  background: #fff;
  color: #144833;
  box-shadow: 0 2px 8px rgba(20, 72, 51, 0.08);
}

.note-box {
  margin-top: 14px;
  border: 1.5px dashed #7fbf98;
  background: linear-gradient(180deg, #f3faf6 0%, #fff 55%);
  border-radius: 14px;
  padding: 12px 12px 10px;
}
.note-box-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #1f6b4a;
  font-size: 14px;
  font-weight: 700;
}
.note-box-hd .van-icon {
  font-size: 16px;
}
.note-box-hd em {
  margin-left: auto;
  font-style: normal;
  font-weight: 600;
  font-size: 12px;
  color: #fff;
  background: #1f6b4a;
  border-radius: 999px;
  padding: 3px 8px;
}
.note-box-input {
  width: 100%;
  min-height: 96px;
  border: 1px solid #d5e8dc;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: #144833;
  background: #fff;
  resize: vertical;
  box-sizing: border-box;
}
.note-box-input:focus {
  outline: 2px solid rgba(31, 107, 74, 0.22);
  border-color: #1f6b4a;
}
.note-box-input::placeholder {
  color: #8aa394;
}

.report-seg { display:flex; gap:8px; align-items:center; }
.report-bullets { margin:0; padding-left:18px; }
.report-bullets li { margin:4px 0; line-height:1.45; color:#3d5348; }
.report-canvas-hidden { position:fixed; left:-9999px; top:0; width:750px; height:1280px; }

.yesterday-card .yesterday-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.yesterday-kpis > div {
  background: #fff;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.yesterday-kpis b {
  display: block;
  margin-top: 4px;
  color: #1f6b4a;
  font-size: 16px;
}
.today-quick .weight-hero {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px 18px;
  margin-bottom: 14px;
  border: 1px solid #d9e5dd;
}
.progress-strip {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}
.progress-pill {
  flex: 1;
  background: #e6f3ec;
  border: 1px solid #cfe4d8;
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}
.progress-pill strong {
  display: block;
  color: #1f6b4a;
  font-size: 18px;
  line-height: 1.2;
}
.progress-pill span {
  display: block;
  margin-top: 4px;
  color: #7a9085;
  font-size: 11px;
}
.today-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #eef8f2, #f7fbf8);
  border: 1px solid #d5e8dd;
  border-radius: 14px;
  color: #144833;
  font-size: 14px;
  line-height: 1.45;
}
.today-tip .van-icon {
  margin-top: 2px;
  color: #1f6b4a;
  flex-shrink: 0;
}
.weight-hero-label {
  color: #7a9085;
  font-size: 13px;
  margin-bottom: 6px;
}
.weight-hero-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 40px;
  font-weight: 700;
  color: #144833;
  background: transparent;
  line-height: 1.1;
}
.carb-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 14px;
}
.carb-chip {
  border: 1px solid #d9e5dd;
  background: #fff;
  border-radius: 14px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.carb-chip strong { color: #144833; font-size: 16px; }
.carb-chip span { color: #7a9085; font-size: 12px; }
.carb-chip.active {
  border-color: #1f6b4a;
  background: #e6f3ec;
  box-shadow: 0 0 0 1px #1f6b4a inset;
}
.quick-toggles {
  display: flex;
  gap: 18px;
  margin: 4px 0 12px;
  padding: 4px 2px;
}
.today-more {
  margin: 0 0 24px;
  border-radius: 16px;
  overflow: hidden;
}

.weight-hero--sm { padding: 10px 14px 12px; margin-bottom: 12px; }
.weight-hero--sm .weight-hero-input { font-size: 28px; }
