:root {
  --bg: #f4f2e9;
  --bg-deep: #ebe9de;
  --surface: #fffdf8;
  --surface-2: #f8f7f0;
  --surface-3: #f0efe6;
  --ink: #1c2921;
  --ink-soft: #3c4b41;
  --muted: #748078;
  --muted-2: #99a29b;
  --line: rgba(28, 41, 33, 0.09);
  --line-strong: rgba(28, 41, 33, 0.16);
  --green: #2c674b;
  --green-deep: #204e39;
  --green-soft: #e3efe5;
  --lime: #c9ef72;
  --lime-deep: #a9d451;
  --lime-soft: #f0f8da;
  --coral: #cf634d;
  --coral-soft: #fae9e4;
  --amber: #b67a2d;
  --amber-soft: #f7ecd8;
  --blue: #4d7b8f;
  --blue-soft: #e5eff2;
  --violet: #75658f;
  --violet-soft: #eee9f4;
  --shadow-sm: 0 1px 2px rgba(28, 41, 33, 0.04), 0 5px 18px rgba(28, 41, 33, 0.035);
  --shadow-md: 0 2px 4px rgba(28, 41, 33, 0.04), 0 16px 44px rgba(28, 41, 33, 0.08);
  --shadow-lg: 0 30px 80px rgba(20, 36, 26, 0.2);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-width: 470px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg-deep); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(201, 239, 114, 0.13), transparent 60%),
    radial-gradient(800px 600px at 100% 100%, rgba(44, 103, 75, 0.08), transparent 55%),
    var(--bg-deep);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
svg { display: block; }
::selection { background: var(--lime); color: var(--green-deep); }

.app-root {
  width: 100%;
  max-width: var(--app-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  isolation: isolate;
}
@media (min-width: 700px) {
  .app-root {
    min-height: calc(100dvh - 36px);
    margin: 18px auto;
    border-radius: 38px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), var(--shadow-lg);
    overflow: clip;
  }
}

.boot-splash {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.boot-mark {
  width: 78px; height: 78px; border-radius: 26px;
  display: grid; place-items: center;
  background: var(--green); color: var(--lime);
  font-size: 34px; font-weight: 700;
  animation: breathe 1.6s ease-in-out infinite;
}
@media (min-width: 700px) { .boot-splash { min-height: calc(100dvh - 36px); } }

/* ---------- shared type ---------- */
h1, h2, h3, h4, p { margin: 0; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.muted { color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }
.display {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}
.icon { width: 22px; height: 22px; flex: 0 0 auto; }
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 28px; height: 28px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- layout ---------- */
.app-shell { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(104px + var(--safe-bottom)); }
@media (min-width: 700px) { .app-shell { min-height: calc(100dvh - 36px); } }
.page { padding: 0 18px; animation: pageIn 0.32s cubic-bezier(.2,.8,.2,1); }
.page-head { padding: calc(18px + var(--safe-top)) 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.04em; font-weight: 800; }
.page-head .sub { margin-top: 5px; font-size: 13px; color: var(--muted); }
.page-head-actions { display: flex; align-items: center; gap: 8px; }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; padding: 0 2px; }
.section-head h2 { font-size: 17px; letter-spacing: -0.02em; font-weight: 750; }
.section-head .link {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12.5px; font-weight: 650; color: var(--green);
  padding: 5px 2px;
}
.section-head .link .icon { width: 14px; height: 14px; }

.card {
  background: var(--surface);
  border: 1px solid rgba(28, 41, 33, 0.065);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }
.divider { height: 1px; background: var(--line); margin: 13px 0; }

/* ---------- buttons ---------- */
.btn {
  min-height: 50px; border-radius: 16px; padding: 0 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  transition: transform .15s ease, background .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(0.975); }
.btn .icon { width: 19px; height: 19px; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 7px 18px rgba(44, 103, 75, .18); }
.btn-primary:hover { background: var(--green-deep); }
.btn-lime { background: var(--lime); color: var(--green-deep); }
.btn-lime:hover { background: #bde75f; }
.btn-soft { background: var(--green-soft); color: var(--green); }
.btn-ghost { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.btn-danger { background: var(--coral-soft); color: var(--coral); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; border-radius: 12px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft); transition: background .2s ease, transform .15s ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn.plain { background: transparent; border-color: transparent; }
.text-link { color: var(--green); font-size: 13px; font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.text-link .icon { width: 15px; height: 15px; }
.arrow-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
}
.arrow-btn:disabled { opacity: .3; }

/* ---------- pills / tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 25px; padding: 0 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pill .icon { width: 12px; height: 12px; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.lime { background: var(--lime-soft); color: #50751e; }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.coral { background: var(--coral-soft); color: var(--coral); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }
.pill.neutral { background: var(--surface-2); color: var(--muted); }

/* ---------- top bar / brand ---------- */
.home-head {
  padding: calc(16px + var(--safe-top)) 0 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 39px; height: 39px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--green); color: var(--lime);
  font-size: 18px; font-weight: 800; letter-spacing: -0.04em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 5px 14px rgba(44,103,75,.16);
}
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.brand-tag { font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; margin-top: 3px; }
.avatar-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center;
  font-weight: 800; color: var(--green); font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.greeting { padding: 18px 2px 14px; }
.greeting h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.045em; }
.greeting p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.greeting .accent { color: var(--green); }

/* ---------- date bar ---------- */
.date-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px; border-radius: 999px;
  background: rgba(255, 253, 248, .78);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  backdrop-filter: blur(12px);
}
.date-bar .date-center { text-align: center; flex: 1; }
.date-bar .date-main { font-size: 14px; font-weight: 750; letter-spacing: -0.01em; }
.date-bar .date-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.date-bar .arrow-btn { background: transparent; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 20px 19px 16px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(300px 200px at 100% 0%, rgba(201, 239, 114, .24), transparent 70%),
    linear-gradient(145deg, #24573f 0%, #1d4935 100%);
  color: #f4f8ef;
  box-shadow: 0 18px 42px rgba(31, 72, 52, .22);
  border: 1px solid rgba(255, 255, 255, .07);
}
.hero::after {
  content: ""; position: absolute; right: -82px; bottom: -120px;
  width: 260px; height: 260px; border-radius: 50%;
  border: 1px solid rgba(201, 239, 114, .16);
  box-shadow: 0 0 0 32px rgba(201, 239, 114, .035), 0 0 0 68px rgba(201, 239, 114, .025);
  pointer-events: none;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.hero-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; color: rgba(244,248,239,.7); letter-spacing: .02em; }
.hero-label .icon { width: 15px; height: 15px; color: var(--lime); }
.hero-date { font-size: 10.5px; color: rgba(244,248,239,.54); }
.hero-main { display: flex; align-items: center; gap: 14px; margin: 8px 0 4px; position: relative; z-index: 1; }
.energy-ring { width: 140px; height: 140px; flex: 0 0 auto; position: relative; }
.energy-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.energy-ring .track { stroke: rgba(255,255,255,.11); }
.energy-ring .bar { stroke: var(--lime); transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1), stroke .3s ease; filter: drop-shadow(0 0 6px rgba(201,239,114,.25)); }
.energy-ring .bar.over { stroke: #ffb69d; filter: drop-shadow(0 0 6px rgba(255,182,157,.25)); }
.energy-ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.energy-number { font-family: var(--font-display); font-size: 39px; font-weight: 800; letter-spacing: -0.06em; line-height: 1; }
.energy-unit { font-size: 10px; color: rgba(244,248,239,.58); margin-top: 5px; letter-spacing: .08em; }
.energy-status { font-size: 10px; font-weight: 700; color: var(--lime); margin-top: 6px; }
.energy-status.over { color: #ffb69d; }
.hero-copy { flex: 1; min-width: 0; }
.hero-copy .kicker { font-size: 10.5px; color: rgba(244,248,239,.56); margin-bottom: 5px; }
.hero-copy h2 { font-size: 21px; line-height: 1.28; font-weight: 750; letter-spacing: -0.03em; }
.hero-copy p { font-size: 11.5px; line-height: 1.55; color: rgba(244,248,239,.65); margin-top: 7px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; margin-top: 11px; padding-top: 13px;
  border-top: 1px solid rgba(255,255,255,.09);
  position: relative; z-index: 1;
}
.hero-stat { padding: 0 10px; border-left: 1px solid rgba(255,255,255,.08); }
.hero-stat:first-child { padding-left: 0; border-left: 0; }
.hero-stat .label { font-size: 10px; color: rgba(244,248,239,.52); }
.hero-stat .value { margin-top: 4px; font-family: var(--font-display); font-size: 18px; font-weight: 750; letter-spacing: -0.03em; }
.hero-stat .value small { font-size: 9.5px; font-weight: 500; color: rgba(244,248,239,.46); margin-left: 2px; }
.hero-progress { margin-top: 13px; position: relative; z-index: 1; }
.hero-progress-meta { display: flex; justify-content: space-between; font-size: 10px; color: rgba(244,248,239,.56); margin-bottom: 6px; }
.hero-progress-track { height: 5px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.hero-progress-fill { height: 100%; border-radius: inherit; background: var(--lime); transition: width .7s ease; }
.hero-progress-fill.over { background: #ffb69d; }

/* ---------- quick actions ---------- */
.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 12px; }
.quick-btn {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 19px; padding: 13px 8px 11px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  box-shadow: var(--shadow-sm); transition: transform .15s ease;
}
.quick-btn:active { transform: scale(.965); }
.quick-ico { width: 35px; height: 35px; border-radius: 12px; display: grid; place-items: center; }
.quick-ico .icon { width: 19px; height: 19px; }
.quick-ico.green { background: var(--green-soft); color: var(--green); }
.quick-ico.lime { background: var(--lime-soft); color: #5a7e24; }
.quick-ico.coral { background: var(--coral-soft); color: var(--coral); }
.quick-btn span { font-size: 12px; font-weight: 650; color: var(--ink-soft); }

/* ---------- weight card ---------- */
.weight-card { padding: 17px 17px 14px; }
.weight-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.weight-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.weight-value { display: flex; align-items: baseline; gap: 5px; margin-top: 3px; }
.weight-value strong { font-family: var(--font-display); font-size: 34px; letter-spacing: -0.055em; line-height: 1; font-weight: 800; }
.weight-value span { font-size: 11px; color: var(--muted); }
.weight-meta { display: flex; align-items: center; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.weight-spark { width: 112px; height: 46px; margin-top: 4px; }
.weight-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 9px; }
.weight-foot { font-size: 10.5px; color: var(--muted); line-height: 1.5; }

/* ---------- meal list ---------- */
.meal-card { padding: 6px 15px; }
.meal-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.meal-row:last-child { border-bottom: 0; }
.meal-ico {
  width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center; background: var(--surface-2);
  font-size: 18px; flex: 0 0 auto;
}
.meal-body { flex: 1; min-width: 0; }
.meal-name { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.meal-items { font-size: 10.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-kcal { font-family: var(--font-display); font-size: 14px; font-weight: 700; white-space: nowrap; }
.meal-kcal small { font-size: 9px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.meal-add {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--green); flex: 0 0 auto;
}
.meal-add .icon { width: 15px; height: 15px; }
.meal-total-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 2px 1px; border-top: 1px dashed var(--line-strong); margin-top: 2px;
  font-size: 11px; color: var(--muted);
}
.meal-total-row strong { color: var(--ink); font-size: 13px; font-family: var(--font-display); }
.food-photo-row { display: flex; gap: 7px; margin: 9px 0 2px; overflow-x: auto; scrollbar-width: none; padding-bottom: 3px; }
.food-photo-row::-webkit-scrollbar { display: none; }
.food-thumb { width: 62px; height: 62px; border-radius: 13px; object-fit: cover; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.4); background: var(--surface-2); }
.food-thumb-empty { display: grid; place-items: center; color: var(--muted-2); }

/* ---------- week chart ---------- */
.week-card { padding: 17px; }
.week-summary { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.week-summary .big { font-family: var(--font-display); font-size: 23px; font-weight: 800; letter-spacing: -0.04em; }
.week-chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 110px; padding-top: 8px; }
.week-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.week-bar-wrap { height: 74px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.week-bar { width: 100%; max-width: 22px; min-height: 4px; border-radius: 7px 7px 3px 3px; background: var(--green-soft); transition: height .5s ease; position: relative; }
.week-bar.on { background: var(--green); }
.week-bar.over { background: var(--coral); }
.week-bar.none { background: var(--surface-3); }
.week-day .d { font-size: 9.5px; color: var(--muted); }
.week-day .v { font-size: 8.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.week-day.today .d { color: var(--green); font-weight: 800; }
.week-legend { display: flex; justify-content: space-between; margin-top: 9px; color: var(--muted); font-size: 9.5px; }

/* ---------- coach note ---------- */
.coach { display: flex; gap: 12px; padding: 15px; background: linear-gradient(135deg, #f1f7e3, #faf9ef); border: 1px solid rgba(87, 122, 38, .12); }
.coach-ico { width: 34px; height: 34px; border-radius: 11px; background: var(--lime); color: var(--green-deep); display: grid; place-items: center; flex: 0 0 auto; }
.coach-ico .icon { width: 18px; height: 18px; }
.coach h3 { font-size: 12.5px; font-weight: 750; margin-bottom: 4px; }
.coach p { font-size: 11px; line-height: 1.6; color: var(--muted); }

/* ---------- bottom nav ---------- */
.tabbar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: var(--app-width);
  padding: 7px 10px calc(7px + var(--safe-bottom));
  background: rgba(255, 253, 248, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.2);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
}
@media (min-width: 700px) {
  .tabbar { bottom: 18px; border-radius: 0 0 38px 38px; overflow: hidden; }
}
.tab-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 48px; padding: 6px 0 3px; color: var(--muted-2);
  transition: color .2s ease;
}
.tab-btn .icon { width: 22px; height: 22px; }
.tab-btn span { font-size: 9.5px; font-weight: 650; }
.tab-btn.active { color: var(--green); }
.tab-camera {
  width: 56px; height: 56px; border-radius: 20px; margin: -19px auto 0;
  background: var(--green); color: var(--lime);
  display: grid; place-items: center;
  box-shadow: 0 9px 22px rgba(44, 103, 75, .28), inset 0 1px 0 rgba(255,255,255,.16);
  transition: transform .18s ease;
}
.tab-camera:active { transform: scale(.94); }
.tab-camera .icon { width: 25px; height: 25px; }

/* ---------- page top + date nav ---------- */
.page-top { padding-top: calc(12px + var(--safe-top)); }
.page-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page-nav h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.04em; }
.page-nav .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.page-nav-side { display: flex; gap: 5px; }
.back-title { display: flex; align-items: center; gap: 8px; }
.back-title h1 { font-size: 18px; }
.date-nav { display: flex; align-items: center; gap: 7px; margin: 13px 0; }
.date-nav .date-pill {
  flex: 1; height: 44px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow-sm);
}
.date-nav .date-pill .icon { width: 16px; height: 16px; color: var(--green); }
.today-chip { height: 34px; padding: 0 13px; border-radius: 11px; background: var(--green-soft); color: var(--green); font-size: 11.5px; font-weight: 700; }

/* ---------- food page ---------- */
.food-summary { padding: 18px; display: flex; align-items: center; gap: 18px; background: linear-gradient(140deg, #fffdf8, #f8f7ed); }
.food-summary-ring { width: 94px; height: 94px; flex: 0 0 auto; position: relative; }
.food-summary-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.food-summary-ring .track { stroke: var(--surface-3); }
.food-summary-ring .bar { stroke: var(--green); transition: stroke-dashoffset .6s ease; }
.food-summary-ring.center { display: grid; place-items: center; }
.food-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.food-ring-label strong { font-family: var(--font-display); font-size: 23px; letter-spacing: -0.05em; font-weight: 800; }
.food-ring-label span { font-size: 8.5px; color: var(--muted); margin-top: 1px; }
.food-summary-copy { flex: 1; min-width: 0; }
.food-summary-copy h2 { font-size: 16px; font-weight: 750; letter-spacing: -0.02em; }
.food-summary-copy p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.macro-row { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.macro {
  padding: 6px 8px; border-radius: 8px; background: var(--surface-2);
  font-size: 9.5px; color: var(--muted);
}
.macro strong { color: var(--ink-soft); font-size: 10.5px; font-weight: 750; margin-left: 3px; }
.meal-block { margin-top: 12px; overflow: hidden; }
.meal-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 15px 10px; }
.meal-block-title { display: flex; align-items: center; gap: 8px; }
.meal-block-title .e { font-size: 15px; }
.meal-block-title h3 { font-size: 13.5px; font-weight: 750; }
.meal-block-title .hint { font-size: 9.5px; color: var(--muted-2); margin-left: 2px; }
.meal-block-kcal { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--muted); }
.add-meal-btn { display: inline-flex; align-items: center; gap: 2px; color: var(--green); font-size: 11px; font-weight: 700; padding: 5px; }
.add-meal-btn .icon { width: 15px; height: 15px; }
.food-entry { display: flex; align-items: center; gap: 10px; padding: 10px 15px 11px; border-top: 1px solid var(--line); }
.food-entry-photo { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: var(--surface-2); }
.food-entry-photo.empty { display: grid; place-items: center; color: var(--muted-2); }
.food-entry-body { flex: 1; min-width: 0; }
.food-entry-name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.food-entry-desc { font-size: 9.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.food-entry-kcal { font-family: var(--font-display); font-size: 12.5px; font-weight: 750; white-space: nowrap; }
.food-entry-kcal small { display: block; font-size: 8px; color: var(--muted); font-weight: 500; text-align: right; margin-top: 2px; }
.empty-meal { padding: 4px 15px 15px; color: var(--muted-2); font-size: 11px; }
.dashed-add {
  margin: 0 15px 14px; padding: 11px; border: 1px dashed var(--line-strong);
  border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--green); font-size: 11.5px; font-weight: 650; width: calc(100% - 30px);
}
.dashed-add .icon { width: 15px; height: 15px; }

/* ---------- exercise page ---------- */
.burn-card { padding: 17px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: linear-gradient(135deg, #f2f7e7, #fffdf8); }
.burn-copy .label { font-size: 10.5px; color: var(--muted); }
.burn-copy .value { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.055em; margin-top: 1px; }
.burn-copy .value small { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.burn-copy p { font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.burn-donut { width: 76px; height: 76px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; background: conic-gradient(var(--green) var(--p, 0%), var(--surface-3) 0); position: relative; }
.burn-donut::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fbfcf5; }
.burn-donut span { position: relative; z-index: 1; font-size: 10px; font-weight: 750; color: var(--green); text-align: center; line-height: 1.3; }
.filter-row { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding: 2px 1px 4px; }
.filter-row::-webkit-scrollbar { display: none; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 11px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  font-size: 11.5px; font-weight: 650; transition: all .18s ease;
}
.chip.active { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(44,103,75,.16); }
.exercise-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.exercise-card {
  text-align: left; padding: 14px; border-radius: 19px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 5px; min-height: 136px;
  transition: transform .15s ease, border .2s ease;
}
.exercise-card:active { transform: scale(.97); }
.exercise-card .ex-ico { width: 37px; height: 37px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 3px; }
.exercise-card .ex-ico .icon { width: 21px; height: 21px; }
.ex-cardio { background: var(--green-soft); color: var(--green); }
.ex-strength { background: var(--coral-soft); color: var(--coral); }
.ex-resistance { background: var(--violet-soft); color: var(--violet); }
.exercise-card h3 { font-size: 13px; font-weight: 750; letter-spacing: -0.01em; }
.exercise-card p { font-size: 9.5px; color: var(--muted); line-height: 1.45; }
.exercise-card .ex-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 9px; color: var(--muted-2); }
.exercise-card .ex-meta strong { color: var(--green); font-size: 10px; font-weight: 750; }
.workout-list { padding: 4px 15px; }
.workout-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.workout-row:last-child { border-bottom: 0; }
.workout-ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: 0 0 auto; }
.workout-ico .icon { width: 18px; height: 18px; }
.workout-body { flex: 1; min-width: 0; }
.workout-body h4 { font-size: 12.5px; font-weight: 700; }
.workout-body p { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.workout-kcal { font-family: var(--font-display); font-size: 12px; font-weight: 700; }
.plan-card { padding: 16px; background: linear-gradient(140deg, #264f3b, #1c3f2e); color: #f4f8ef; border: 0; overflow: hidden; position: relative; }
.plan-card::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; border: 1px solid rgba(201,239,114,.15); right: -50px; top: -60px; }
.plan-head { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.plan-head h3 { font-size: 13px; font-weight: 750; }
.plan-head .pill { background: rgba(201,239,114,.14); color: var(--lime); }
.plan-items { display: grid; gap: 8px; margin-top: 12px; position: relative; z-index: 1; }
.plan-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,.065); }
.plan-num { width: 21px; height: 21px; border-radius: 7px; background: rgba(201,239,114,.16); color: var(--lime); display: grid; place-items: center; font-size: 9.5px; font-weight: 800; }
.plan-item h4 { font-size: 11.5px; font-weight: 700; }
.plan-item p { font-size: 9px; color: rgba(244,248,239,.56); margin-top: 2px; }

/* ---------- profile ---------- */
.profile-hero { padding: 20px; position: relative; overflow: hidden; background: linear-gradient(140deg, #264f3b, #1c3f2e); color: #f4f8ef; border: 0; }
.profile-hero::after { content: ""; position: absolute; width: 180px; height: 180px; border: 1px solid rgba(201,239,114,.13); border-radius: 50%; right: -70px; bottom: -90px; }
.profile-top { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.profile-avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--lime); color: var(--green-deep); display: grid; place-items: center; font-size: 21px; font-weight: 800; }
.profile-top h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.profile-top p { font-size: 10.5px; color: rgba(244,248,239,.58); margin-top: 4px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.09); position: relative; z-index: 1; }
.profile-stat { border-left: 1px solid rgba(255,255,255,.08); padding-left: 12px; }
.profile-stat:first-child { border-left: 0; padding-left: 0; }
.profile-stat .k { font-size: 9.5px; color: rgba(244,248,239,.52); }
.profile-stat .v { font-family: var(--font-display); font-size: 19px; font-weight: 750; margin-top: 3px; }
.profile-stat .v small { font-size: 9px; font-weight: 500; color: rgba(244,248,239,.48); margin-left: 2px; }
.menu-card { padding: 4px 15px; }
.menu-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.menu-row:last-child { border-bottom: 0; }
.menu-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-soft); flex: 0 0 auto; }
.menu-ico .icon { width: 17px; height: 17px; }
.menu-body { flex: 1; }
.menu-body h3 { font-size: 12.5px; font-weight: 650; }
.menu-body p { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.menu-row > .icon { width: 16px; height: 16px; color: var(--muted-2); }
.menu-row.danger .menu-body h3 { color: var(--coral); }

/* ---------- charts ---------- */
.chart-card { padding: 17px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.chart-head h3 { font-size: 12px; color: var(--muted); font-weight: 650; }
.chart-head .chart-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.05em; margin-top: 2px; }
.chart-head .chart-value small { font-size: 10px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented { flex: 0 0 auto; }
.segmented button { height: 27px; padding: 0 9px; border-radius: 7px; font-size: 9.5px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.line-chart { width: 100%; height: 170px; margin-top: 8px; }
.chart-axis { display: flex; justify-content: space-between; font-size: 8.5px; color: var(--muted-2); padding: 0 3px; }
.weight-list { padding: 2px 15px; }
.weight-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.weight-row:last-child { border-bottom: 0; }
.weight-date { width: 56px; flex: 0 0 auto; }
.weight-date strong { display: block; font-size: 11px; font-weight: 700; }
.weight-date span { font-size: 9px; color: var(--muted); }
.weight-spark-mini { flex: 1; height: 22px; opacity: .55; }
.weight-row .w { font-family: var(--font-display); font-size: 14px; font-weight: 750; white-space: nowrap; }
.weight-row .w small { font-size: 8px; color: var(--muted); font-weight: 500; }
.weight-row .delta { width: 48px; text-align: right; font-size: 9.5px; color: var(--muted); }
.weight-row .delta.down { color: var(--green); }
.weight-row .delta.up { color: var(--coral); }
.weight-row .row-menu { color: var(--muted-2); width: 28px; height: 34px; display: grid; place-items: center; }

/* ---------- empty state ---------- */
.empty { padding: 34px 20px; text-align: center; }
.empty-ico { width: 58px; height: 58px; border-radius: 20px; margin: 0 auto 12px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.empty-ico .icon { width: 27px; height: 27px; }
.empty h3 { font-size: 14px; font-weight: 750; }
.empty p { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 5px auto 0; max-width: 240px; }
.empty .btn { margin-top: 15px; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label, .field-label { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 650; margin-bottom: 7px; padding: 0 2px; }
.field label .optional { font-weight: 400; color: var(--muted-2); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; border-radius: 15px; border: 1px solid var(--line-strong);
  background: var(--surface); padding: 0 14px; font-size: 16px; font-weight: 600;
  outline: none; transition: border .2s ease, box-shadow .2s ease;
  -webkit-appearance: none; appearance: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(44,103,75,.1); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); font-weight: 400; }
.input-suffix { position: absolute; right: 14px; font-size: 11px; color: var(--muted); pointer-events: none; }
.input.has-suffix { padding-right: 44px; }
.input-num { font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; }
.textarea { padding: 13px 14px; min-height: 86px; resize: vertical; line-height: 1.5; font-size: 14px; font-weight: 400; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23748078' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.field-hint { font-size: 10px; color: var(--muted); margin-top: 6px; line-height: 1.45; padding: 0 2px; }
.field-error { font-size: 10.5px; color: var(--coral); margin-top: 5px; }
.input-error { border-color: var(--coral); }
.chip-select { display: flex; gap: 7px; flex-wrap: wrap; }
.choice-chip {
  flex: 1; min-width: 74px; min-height: 44px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line-strong);
  font-size: 12.5px; font-weight: 650; color: var(--muted); padding: 0 10px;
}
.choice-chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.stepper { display: flex; align-items: center; gap: 10px; }
.step-btn { width: 44px; height: 44px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--green); flex: 0 0 auto; }
.step-btn:active { background: var(--green-soft); }
.step-btn .icon { width: 18px; height: 18px; }
.stepper .input { text-align: center; }
.switch { position: relative; width: 46px; height: 27px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); transition: background .2s ease; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.14); transition: transform .2s ease; }
.switch.on { background: var(--green); border-color: var(--green); }
.switch.on::after { transform: translateX(19px); }

/* ---------- onboarding ---------- */
.onboard {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: calc(18px + var(--safe-top)) 22px calc(20px + var(--safe-bottom));
  position: relative; overflow: hidden;
  background:
    radial-gradient(500px 350px at 100% 0%, rgba(201,239,114,.25), transparent 65%),
    radial-gradient(420px 340px at -10% 100%, rgba(44,103,75,.08), transparent 65%),
    var(--bg);
}
@media (min-width: 700px) { .onboard { min-height: calc(100dvh - 36px); } }
.onboard::before {
  content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%;
  border: 1px solid rgba(44,103,75,.07); top: 90px; right: -130px; pointer-events: none;
}
.onboard-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.onboard-brand { display: flex; align-items: center; gap: 9px; }
.onboard-brand .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 16px; }
.onboard-brand span { font-size: 15px; font-weight: 800; letter-spacing: -0.03em; }
.onboard-step-label { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.onboard-progress { display: flex; gap: 5px; margin-top: 16px; position: relative; z-index: 1; }
.onboard-progress i { height: 3px; flex: 1; border-radius: 99px; background: rgba(44,103,75,.12); transition: background .3s ease; }
.onboard-progress i.on { background: var(--green); }
.onboard-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 22px 0; position: relative; z-index: 1; }
.onboard-foot { position: relative; z-index: 1; }
.onboard-skip { color: var(--muted); font-size: 11px; padding: 8px; }
.onboard h1 { font-size: 33px; line-height: 1.2; letter-spacing: -0.055em; font-weight: 820; }
.onboard h1 .accent { color: var(--green); }
.onboard .lead { font-size: 12.5px; line-height: 1.65; color: var(--muted); margin-top: 10px; max-width: 320px; }
.onboard .step-title { font-size: 26px; line-height: 1.25; letter-spacing: -0.05em; font-weight: 800; }
.onboard .step-sub { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 6px; }
.onboard-form { margin-top: 22px; }
.welcome-art { position: relative; height: 228px; margin: 22px 0 12px; display: flex; align-items: center; justify-content: center; }
.welcome-orbit { position: absolute; width: 208px; height: 208px; border-radius: 50%; border: 1px solid rgba(44,103,75,.12); }
.welcome-orbit.two { width: 260px; height: 260px; border-color: rgba(44,103,75,.06); }
.welcome-orb {
  width: 160px; height: 160px; border-radius: 50%;
  background: linear-gradient(145deg, #2c674b, #1d4935);
  display: grid; place-items: center; color: var(--lime);
  box-shadow: 0 22px 46px rgba(33, 76, 55, .25);
  position: relative;
}
.welcome-orb .big-leaf { width: 70px; height: 70px; }
.welcome-orb::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 1px solid rgba(201,239,114,.18); }
.float-chip {
  position: absolute; padding: 8px 11px; border-radius: 12px;
  background: rgba(255,253,248,.92); border: 1px solid var(--line);
  box-shadow: var(--shadow-md); font-size: 10px; font-weight: 700; color: var(--ink-soft);
  display: flex; align-items: center; gap: 5px;
  backdrop-filter: blur(8px);
}
.float-chip .icon { width: 13px; height: 13px; color: var(--green); }
.float-chip.a { top: 18px; left: 2px; animation: floaty 4.4s ease-in-out infinite; }
.float-chip.b { right: -2px; top: 62px; animation: floaty 5s ease-in-out .5s infinite; }
.float-chip.c { left: 20px; bottom: 16px; animation: floaty 4.7s ease-in-out .9s infinite; }
.welcome-points { display: grid; gap: 9px; margin-top: 12px; }
.welcome-point { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--ink-soft); }
.welcome-point .dot { width: 23px; height: 23px; border-radius: 8px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex: 0 0 auto; }
.welcome-point .dot .icon { width: 13px; height: 13px; }
.onboard-actions { display: flex; gap: 9px; margin-top: 18px; }
.onboard-actions .btn { flex: 1; }
.onboard-actions .btn-back { flex: 0 0 54px; padding: 0; }
.goal-grid { display: grid; gap: 8px; }
.goal-card {
  display: flex; align-items: center; gap: 12px; padding: 13px;
  border-radius: 15px; background: var(--surface); border: 1px solid var(--line-strong);
  text-align: left; transition: all .18s ease;
}
.goal-card.active { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.goal-emoji { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }
.goal-card.active .goal-emoji { background: rgba(255,255,255,.7); }
.goal-card h3 { font-size: 12.5px; font-weight: 750; }
.goal-card p { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.goal-check { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; color: transparent; flex: 0 0 auto; }
.goal-card.active .goal-check { background: var(--green); border-color: var(--green); color: #fff; }
.goal-check .icon { width: 12px; height: 12px; }
.activity-list { display: grid; gap: 7px; }
.activity-option { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.activity-option.active { border-color: var(--green); background: var(--green-soft); }
.activity-option .radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: 0 0 auto; display: grid; place-items: center; }
.activity-option.active .radio { border-color: var(--green); background: var(--green); }
.activity-option.active .radio::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.activity-option h3 { font-size: 11.5px; font-weight: 700; }
.activity-option p { font-size: 9px; color: var(--muted); margin-top: 1px; }
.result-hero { text-align: center; padding: 12px 0 4px; }
.result-eyebrow { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 9.5px; font-weight: 750; }
.result-big { font-family: var(--font-display); font-size: 58px; font-weight: 820; letter-spacing: -0.07em; line-height: 1.05; margin-top: 10px; }
.result-big small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 5px; }
.result-caption { font-size: 11px; color: var(--muted); margin-top: 4px; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 18px; }
.stat-tile { padding: 11px 9px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.stat-tile .k { font-size: 8.5px; color: var(--muted); }
.stat-tile .v { font-family: var(--font-display); font-size: 17px; font-weight: 750; margin-top: 2px; letter-spacing: -0.03em; }
.stat-tile .v small { font-size: 8px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.slider-wrap { margin-top: 17px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; }
.slider-head span { font-size: 10.5px; color: var(--muted); }
.slider-head strong { font-family: var(--font-display); font-size: 18px; font-weight: 750; color: var(--green); }
input[type="range"] { width: 100%; height: 28px; -webkit-appearance: none; background: transparent; margin-top: 3px; }
input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(to right, var(--green) var(--p, 40%), var(--surface-3) var(--p, 40%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 23px; height: 23px; border-radius: 50%; background: var(--surface); border: 2px solid var(--green); box-shadow: 0 2px 7px rgba(0,0,0,.14); margin-top: -9px; }
.slider-ticks { display: flex; justify-content: space-between; font-size: 8.5px; color: var(--muted-2); margin-top: -1px; }
.safety-note { display: flex; gap: 7px; margin-top: 10px; padding: 9px 10px; border-radius: 10px; background: var(--amber-soft); color: #7d5b25; font-size: 9.5px; line-height: 1.5; }
.safety-note .icon { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }

/* ---------- sheets ---------- */
#overlay-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.sheet-overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 30, 23, 0); pointer-events: auto;
  transition: background .28s ease;
  padding: 0;
}
@media (min-width: 700px) { .sheet-overlay { padding: 18px; align-items: center; } }
.sheet-overlay.open { background: rgba(20, 30, 23, .48); }
.sheet {
  width: 100%; max-width: var(--app-width); max-height: 88vh; max-height: 88dvh;
  background: var(--bg); border-radius: 26px 26px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(102%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  overflow: hidden; box-shadow: 0 -12px 40px rgba(0,0,0,.1);
}
.sheet-overlay.open .sheet { transform: translateY(0); }
@media (min-width: 700px) { .sheet { border-radius: 28px; max-height: 88dvh; box-shadow: var(--shadow-lg); } }
.sheet.full { height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
@media (min-width: 700px) { .sheet.full { height: calc(100dvh - 36px); max-height: calc(100dvh - 36px); border-radius: 28px; } }
.sheet-grab { width: 34px; height: 4px; border-radius: 99px; background: var(--line-strong); margin: 8px auto 0; flex: 0 0 auto; }
.sheet.full .sheet-grab { display: none; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px 10px; flex: 0 0 auto;
}
.sheet.full .sheet-head { padding-top: calc(14px + var(--safe-top)); }
.sheet-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.035em; }
.sheet-head p { font-size: 10px; color: var(--muted); margin-top: 2px; }
.sheet-close { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); flex: 0 0 auto; }
.sheet-close .icon { width: 17px; height: 17px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 18px calc(22px + var(--safe-bottom)); flex: 1; overscroll-behavior: contain; }
.sheet.full .sheet-body { padding-bottom: calc(24px + var(--safe-bottom)); }
.sheet-foot { flex: 0 0 auto; padding: 10px 18px calc(12px + var(--safe-bottom)); background: linear-gradient(to top, var(--bg) 70%, rgba(244,242,233,0)); border-top: 1px solid var(--line); }
.sheet.full .sheet-foot { background: var(--bg); }
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .btn { flex: 1; }

/* ---------- analyzer ---------- */
.analyzer { padding-bottom: 12px; }
.picker {
  border: 1.5px dashed rgba(44,103,75,.24); border-radius: 22px;
  background: linear-gradient(145deg, rgba(227,239,229,.55), rgba(255,253,248,.8));
  min-height: 252px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 18px; text-align: center; position: relative; overflow: hidden;
}
.picker-ico { width: 58px; height: 58px; border-radius: 20px; background: var(--green); color: var(--lime); display: grid; place-items: center; margin-bottom: 13px; box-shadow: 0 9px 20px rgba(44,103,75,.18); }
.picker-ico .icon { width: 27px; height: 27px; }
.picker h3 { font-size: 15px; font-weight: 750; letter-spacing: -0.02em; }
.picker p { font-size: 10.5px; color: var(--muted); line-height: 1.6; margin-top: 5px; max-width: 260px; }
.picker-actions { display: flex; gap: 8px; margin-top: 17px; width: 100%; max-width: 280px; }
.picker-actions .btn { flex: 1; min-height: 45px; }
.photo-preview-wrap { position: relative; border-radius: 21px; overflow: hidden; background: #1b241e; aspect-ratio: 4/3; }
.photo-preview-wrap img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-wrap .replace { position: absolute; right: 10px; bottom: 10px; background: rgba(20,30,23,.68); color: #fff; backdrop-filter: blur(8px); font-size: 10.5px; font-weight: 650; padding: 7px 10px; border-radius: 9px; display: flex; align-items: center; gap: 4px; }
.photo-preview-wrap .replace .icon { width: 13px; height: 13px; }
.photo-badge { position: absolute; left: 10px; top: 10px; background: rgba(201,239,114,.94); color: var(--green-deep); font-size: 9px; font-weight: 800; padding: 5px 8px; border-radius: 7px; }
.analyze-tip { display: flex; gap: 8px; align-items: flex-start; margin-top: 11px; font-size: 9.5px; line-height: 1.55; color: var(--muted); padding: 0 2px; }
.analyze-tip .icon { width: 14px; height: 14px; color: var(--green); flex: 0 0 auto; margin-top: 1px; }
.analysis-loading { padding: 18px 0 6px; }
.scan-card { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 4/3; background: #1b241e; }
.scan-card img { width: 100%; height: 100%; object-fit: cover; opacity: .72; }
.scan-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--lime); box-shadow: 0 0 18px 3px rgba(201,239,114,.55); animation: scan 2.2s ease-in-out infinite; }
.scan-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px); background-size: 44px 44px; opacity: .42; }
.scan-caption { position: absolute; left: 12px; bottom: 12px; right: 12px; display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 10px; background: rgba(20,30,23,.66); backdrop-filter: blur(8px); color: #fff; font-size: 10.5px; }
.scan-caption .dot-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); animation: pulse 1.3s ease-in-out infinite; }
.loading-steps { display: grid; gap: 8px; margin-top: 16px; }
.loading-step { display: flex; align-items: center; gap: 9px; font-size: 10.5px; color: var(--muted-2); transition: color .3s ease; }
.loading-step .ls-ico { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; flex: 0 0 auto; }
.loading-step .ls-ico .icon { width: 11px; height: 11px; }
.loading-step.done { color: var(--green); }
.loading-step.done .ls-ico { background: var(--green-soft); border-color: transparent; }
.loading-step.active { color: var(--ink); font-weight: 650; }
.loading-step.active .ls-ico { border-color: var(--green); border-right-color: transparent; animation: spin 1s linear infinite; }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 13px 0 10px; }
.result-head h3 { font-size: 14px; font-weight: 800; letter-spacing: -0.02em; }
.result-head p { font-size: 9.5px; color: var(--muted); margin-top: 3px; }
.result-total { text-align: right; flex: 0 0 auto; }
.result-total strong { font-family: var(--font-display); font-size: 28px; font-weight: 820; letter-spacing: -0.06em; color: var(--green); line-height: 1; }
.result-total span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 2px; }
.analysis-note { padding: 10px 11px; border-radius: 11px; background: var(--green-soft); color: #345a44; font-size: 9.5px; line-height: 1.55; margin-bottom: 11px; display: flex; gap: 7px; }
.analysis-note .icon { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }
.item-list { display: grid; gap: 7px; }
.analysis-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 11px; }
.ai-item-top { display: flex; align-items: flex-start; gap: 8px; }
.ai-item-name { flex: 1; min-width: 0; }
.ai-item-name input { width: 100%; border: 0; background: transparent; font-size: 12.5px; font-weight: 700; padding: 0; outline: none; }
.ai-item-name p { font-size: 8.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.ai-item-kcal { font-family: var(--font-display); font-size: 13px; font-weight: 750; white-space: nowrap; }
.ai-item-kcal small { font-size: 8px; color: var(--muted); font-weight: 500; }
.ai-item-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.grams-control { display: flex; align-items: center; gap: 5px; background: var(--surface-2); border-radius: 8px; padding: 2px; }
.grams-control button { width: 25px; height: 25px; border-radius: 6px; background: var(--surface); display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.grams-control input { width: 47px; text-align: center; border: 0; background: transparent; font-size: 11px; font-weight: 700; outline: none; }
.grams-control .g { font-size: 8.5px; color: var(--muted); padding-right: 3px; }
.item-confidence { font-size: 8px; color: var(--muted-2); }
.item-confidence.high { color: var(--green); }
.ai-item-delete { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--muted-2); }
.ai-item-delete .icon { width: 14px; height: 14px; }
.ai-add-row { display: flex; gap: 7px; margin-top: 8px; }
.ai-add-row .btn { flex: 1; min-height: 40px; font-size: 11px; }
.analysis-assumptions { margin-top: 9px; padding: 9px 11px; border-radius: 10px; border: 1px dashed var(--line-strong); }
.analysis-assumptions p { font-size: 8.5px; color: var(--muted); line-height: 1.55; }
.analysis-assumptions strong { color: var(--ink-soft); font-weight: 700; }
.meal-picker { display: flex; gap: 5px; margin-top: 4px; }
.meal-picker button { flex: 1; min-height: 35px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); font-size: 10px; font-weight: 650; color: var(--muted); }
.meal-picker button.active { background: var(--green); border-color: var(--green); color: #fff; }
.section-mini-title { font-size: 10px; color: var(--muted); font-weight: 650; margin: 14px 0 7px; }
.ai-config-cta { padding: 20px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; text-align: center; }
.ai-config-cta .ico { width: 49px; height: 49px; border-radius: 15px; background: var(--lime-soft); color: #567d20; display: grid; place-items: center; margin: 0 auto 10px; }
.ai-config-cta .ico .icon { width: 23px; height: 23px; }
.ai-config-cta h3 { font-size: 14px; font-weight: 750; }
.ai-config-cta p { font-size: 10px; color: var(--muted); line-height: 1.6; margin: 5px auto 13px; max-width: 280px; }
.ai-config-cta .btn { min-height: 44px; font-size: 12px; }
.error-box { padding: 15px; border-radius: 15px; background: var(--coral-soft); color: #8c3e2d; font-size: 11px; line-height: 1.6; display: flex; gap: 9px; }
.error-box .icon { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.error-detail { margin-top: 7px; font-size: 8.5px; opacity: .7; word-break: break-word; max-height: 72px; overflow-y: auto; }
.manual-search { display: flex; gap: 7px; margin-top: 8px; }
.manual-search .input { min-height: 42px; font-size: 13px; border-radius: 11px; }
.manual-results { display: grid; gap: 5px; margin-top: 8px; max-height: 250px; overflow-y: auto; }
.food-result { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-align: left; }
.food-result .fe { font-size: 16px; }
.food-result .fn { flex: 1; font-size: 11px; font-weight: 650; }
.food-result .fk { font-size: 9px; color: var(--muted); }
.food-result .icon { width: 14px; height: 14px; color: var(--green); }
.demo-note { margin-top: 10px; padding: 10px; border-radius: 11px; background: var(--surface-2); font-size: 9px; color: var(--muted); line-height: 1.55; }

/* ---------- exercise detail ---------- */
.exercise-detail-head { display: flex; gap: 13px; align-items: flex-start; padding: 5px 0 14px; }
.exercise-detail-icon { width: 62px; height: 62px; border-radius: 19px; display: grid; place-items: center; flex: 0 0 auto; }
.exercise-detail-icon .icon { width: 31px; height: 31px; }
.exercise-detail-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.04em; }
.exercise-detail-head p { font-size: 10.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.detail-desc { font-size: 11.5px; line-height: 1.7; color: var(--ink-soft); }
.cue-list { display: grid; gap: 7px; margin-top: 10px; }
.cue { display: flex; gap: 8px; font-size: 10.5px; line-height: 1.55; color: var(--ink-soft); }
.cue .n { width: 18px; height: 18px; border-radius: 6px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 8.5px; font-weight: 800; flex: 0 0 auto; margin-top: 1px; }
.duration-card { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; padding: 14px; margin-top: 14px; }
.duration-card .label { font-size: 10px; color: var(--muted); font-weight: 650; }
.duration-input-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 8px; }
.duration-presets { display: flex; gap: 5px; margin-top: 8px; }
.duration-presets button { flex: 1; height: 31px; border-radius: 8px; background: var(--surface-2); border: 1px solid transparent; font-size: 10px; font-weight: 650; color: var(--muted); }
.duration-presets button.active { background: var(--green-soft); color: var(--green); border-color: rgba(44,103,75,.14); }
.burn-preview { display: flex; align-items: baseline; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.burn-preview span { font-size: 10px; color: var(--muted); }
.burn-preview strong { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.04em; color: var(--green); }
.burn-preview strong small { font-size: 9px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.notice { padding: 10px 11px; border-radius: 11px; background: var(--amber-soft); color: #74531f; font-size: 9.5px; line-height: 1.55; display: flex; gap: 7px; margin-top: 10px; }
.notice .icon { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }

/* ---------- AI settings ---------- */
.settings-note { padding: 12px; border-radius: 13px; background: var(--blue-soft); color: #375e6d; font-size: 9.5px; line-height: 1.6; display: flex; gap: 8px; margin-bottom: 14px; }
.settings-note .icon { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 13px; }
.preset-btn { padding: 9px 10px; text-align: left; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.preset-btn.active { border-color: var(--green); background: var(--green-soft); }
.preset-btn strong { display: block; font-size: 10px; font-weight: 750; }
.preset-btn span { display: block; font-size: 8px; color: var(--muted); margin-top: 2px; }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 52px; }
.pass-toggle { position: absolute; right: 5px; height: 40px; padding: 0 10px; font-size: 9.5px; font-weight: 700; color: var(--green); }
.settings-section { margin-top: 18px; }
.settings-section-title { font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; padding-left: 2px; }
.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 4px 13px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row h3 { font-size: 12px; font-weight: 650; }
.settings-row p { font-size: 9px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.settings-row .value { font-size: 10px; color: var(--muted); text-align: right; }
.settings-row button.value, .settings-row .action { color: var(--green); font-weight: 650; font-size: 10.5px; padding: 6px; }
.about-card { text-align: center; padding: 20px 16px; }
.about-mark { width: 52px; height: 52px; border-radius: 17px; background: var(--green); color: var(--lime); display: grid; place-items: center; font-size: 24px; font-weight: 800; margin: 0 auto 9px; }
.about-card h3 { font-size: 16px; font-weight: 800; }
.about-card p { font-size: 9.5px; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.about-card .ver { font-size: 8.5px; color: var(--muted-2); margin-top: 8px; }

/* ---------- toast ---------- */
.toast-root { position: fixed; left: 0; right: 0; bottom: calc(92px + var(--safe-bottom)); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 7px; pointer-events: none; padding: 0 20px; }
.toast {
  background: rgba(28, 41, 33, .94); color: #fff; backdrop-filter: blur(14px);
  border-radius: 12px; padding: 10px 14px; font-size: 11px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); display: flex; align-items: center; gap: 7px;
  animation: toastIn .26s cubic-bezier(.2,.8,.2,1);
  max-width: 350px;
}
.toast.out { animation: toastOut .22s ease forwards; }
.toast .icon { width: 15px; height: 15px; color: var(--lime); }
.toast.error .icon { color: #ffb69d; }

/* ---------- misc ---------- */
.fade-in { animation: fadeIn .35s ease both; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #efeee5 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
.inline-note { font-size: 9.5px; color: var(--muted); line-height: 1.55; }
.padded { padding-left: 2px; padding-right: 2px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.w-full { width: 100%; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.record-note { font-size: 8.5px; color: var(--muted-2); text-align: center; padding: 11px 10px 2px; line-height: 1.6; }
.date-input-native { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }

/* ---------- keyframes ---------- */
@keyframes breathe { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(44,103,75,.18); } 50% { transform: scale(1.04); box-shadow: 0 0 0 18px rgba(44,103,75,0); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes pageIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes scan { 0%,100% { top: 8%; opacity: .4; } 50% { top: 88%; opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: .4; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- fixes and small screens ---------- */
[hidden] { display: none !important; }
.date-pill { min-width: 0; }
.date-pill span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onboard { overflow-x: hidden; overflow-y: auto; }
.btn-spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  display: inline-block; animation: spin .8s linear infinite;
}
.menu-row a { color: var(--green); font-weight: 650; }
@media (max-width: 360px) {
  .page { padding: 0 14px; }
  .hero { padding: 17px 15px 14px; }
  .energy-ring { width: 120px; height: 120px; }
  .energy-number { font-size: 34px; }
  .hero-copy h2 { font-size: 18px; }
  .hero-stats .value { font-size: 16px; }
  .quick-btn span { font-size: 11px; }
  .date-nav .date-pill { font-size: 11.5px; }
  .date-nav .date-pill .icon { width: 14px; height: 14px; }
  .today-chip { padding: 0 9px; font-size: 10px; }
  .tab-btn span { font-size: 9px; }
  .onboard { padding-left: 17px; padding-right: 17px; }
  .onboard h1 { font-size: 29px; }
  .exercise-grid { gap: 7px; }
  .exercise-card { padding: 12px; }
  .result-big { font-size: 48px; }
}
@media (max-height: 720px) {
  .welcome-art { height: 180px; margin: 6px 0 4px; }
  .welcome-orbit { width: 170px; height: 170px; }
  .welcome-orbit.two { width: 210px; height: 210px; }
  .welcome-orb { width: 130px; height: 130px; }
  .welcome-orb .big-leaf { width: 55px; height: 55px; }
  .onboard-stage { padding: 12px 0; }
  .onboard h1 { font-size: 29px; }
  .welcome-points { gap: 6px; }
  .welcome-point { font-size: 10.5px; }
}

.picker-manual { min-height: 40px; padding: 8px 12px; font-size: 11px; border-radius: 10px; }
.picker-manual:active { background: var(--green-soft); }
