.app {
  max-width: 440px;
  margin: 0 auto;
  padding: 14px 18px calc(96px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

.screen {
  animation: screen-in 0.32s var(--ease);
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

h1, h2, h3 { margin: 0; font-weight: 500; }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-size: 19px; font-weight: 500; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--text-3); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-pill);
  border: none; background: var(--surface); color: var(--text-2);
}
.icon-btn:active { transform: scale(0.94); }
.streak {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--pink-fill); color: var(--pink-deep);
  font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: var(--r-pill);
}
.screen-title { font-size: 22px; letter-spacing: -0.02em; }

/* ---- week strip ---- */
.week { display: flex; justify-content: space-between; margin-bottom: 18px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; background: none; border: none; padding: 0; }
.week-wd { font-size: 11px; color: var(--text-3); }
.week-num {
  width: 34px; height: 34px; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-2); transition: background 0.2s var(--ease);
}
.week-day.today .week-wd { color: var(--pink-deep); font-weight: 500; }
.week-day.today .week-num { background: var(--pink); color: #fff; font-weight: 500; }
.week-day.sel .week-num { box-shadow: inset 0 0 0 2px var(--pink); color: var(--pink-deep); }
.week-day.future .week-num { color: var(--text-3); }

/* ---- cards / surfaces ---- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 4px; }
.section-title { font-size: 15px; font-weight: 500; }
.section-meta { font-size: 12px; color: var(--text-3); }

/* ---- calorie hero ---- */
.cal { display: flex; align-items: center; gap: 14px; }
.cal-figs { flex: 1; }
.cal-row { display: flex; align-items: baseline; gap: 5px; }
.cal-big { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; }
.cal-target { font-size: 14px; color: var(--text-3); }
.cal-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.tag-soft {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 9px;
  background: var(--pink-fill); color: var(--pink-deep);
  font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: var(--r-pill);
}

/* ---- macro cards ---- */
.macros { display: flex; gap: 10px; margin-top: 12px; }
.macro { flex: 1; background: var(--surface); border-radius: var(--r-md); padding: 11px; text-align: center; }
.macro .ring { display: block; margin: 0 auto; }
.macro-val { font-size: 15px; font-weight: 500; margin-top: 4px; }
.macro-val small { font-size: 11px; color: var(--text-3); font-weight: 400; }
.macro-lbl { font-size: 11px; color: var(--text-2); }

/* ---- activity ---- */
.activity {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--pink-fill); border-radius: var(--r-md); padding: 10px 14px; margin-top: 14px;
}
.activity-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--pink-darker); }
.activity-kcal { font-size: 12px; font-weight: 500; color: var(--pink-deep); }

/* ---- list rows ---- */
.row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 0; border-top: 0.5px solid var(--border);
  width: 100%; background: none; border-left: none; border-right: none; border-bottom: none; text-align: left;
  color: inherit;
}
.row:first-of-type { border-top: none; }
.meal-time { width: 40px; font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.meal-time.next { color: var(--pink-deep); font-weight: 500; }
.meal-body { flex: 1; min-width: 0; }
.meal-name { font-size: 13px; color: var(--text); }
.meal-sub { font-size: 11px; color: var(--text-3); }
.meal-sub.next { color: var(--pink-deep); }
.row.eaten .meal-name { color: var(--text-2); text-decoration: line-through; }
.tick { color: var(--pink); display: inline-flex; flex-shrink: 0; }
.tick.off { color: var(--border-2); }

/* ---- buttons ---- */
.btn, .btn-primary, .btn-soft {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13px; font-weight: 500; padding: 11px; border-radius: var(--r-md); border: none;
  transition: transform 0.12s var(--ease);
}
.btn { background: var(--surface); color: var(--text); border: 0.5px solid var(--border); }
.btn-primary { background: var(--pink); color: #fff; }
.btn-soft { background: var(--pink-fill); color: var(--pink-deep); }
.btn:active, .btn-primary:active, .btn-soft:active { transform: scale(0.985); }
.mt { margin-top: 12px; }

/* ---- training ---- */
.tday {
  display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 0.5px solid var(--border);
  width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; text-align: left;
}
.tday.today { border: none; background: var(--pink-fill); border-radius: var(--r-md); padding: 11px 12px; margin-top: 8px; }
.tday-wd { width: 34px; font-size: 12px; color: var(--text-2); }
.tday.today .tday-wd { color: var(--pink-deep); font-weight: 500; }
.tday-name { flex: 1; font-size: 14px; color: var(--text); }
.tday.today .tday-name { color: var(--pink-darker); font-weight: 500; }
.tday.rest .tday-wd, .tday.rest .tday-name { color: var(--text-3); }
.tday-meta { font-size: 11px; color: var(--pink-deep); }
.muted-ic { color: var(--text-3); display: inline-flex; }

.ex { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 0.5px solid var(--border); }
.ex:first-of-type { border-top: none; }
.ex-check { background: none; border: none; padding: 0; color: var(--border-2); display: inline-flex; }
.ex-check.done { color: var(--pink); }
.ex-name { flex: 1; font-size: 13px; }
.ex.done .ex-name { color: var(--text-2); text-decoration: line-through; }
.ex-sub { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.ex-kg {
  width: 52px; padding: 5px 7px; font-size: 12px; text-align: right;
  border: 0.5px solid var(--border); border-radius: var(--r-sm); background: var(--bg); color: var(--text);
}

/* ---- meals ---- */
.searchbar {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border-radius: var(--r-md); padding: 9px 12px; margin-bottom: 12px; color: var(--text-3);
}
.searchbar input { flex: 1; border: none; background: none; font-size: 13px; color: var(--text); outline: none; }
.chips { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { font-size: 12px; color: var(--text-2); background: var(--surface); border: none; border-radius: var(--r-pill); padding: 6px 14px; white-space: nowrap; }
.chip.active { background: var(--pink); color: #fff; }
.mealcard { display: flex; align-items: center; gap: 11px; background: var(--surface); border-radius: var(--r-md); padding: 11px 13px; margin-bottom: 9px; }
.mealcard-ic { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--pink-fill); color: var(--pink-deep); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mealcard-body { flex: 1; min-width: 0; }
.mealcard-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.mealcard-sub { font-size: 11px; color: var(--text-3); }
.mini-pill { font-size: 10px; color: var(--pink-deep); background: var(--pink-fill); border-radius: var(--r-pill); padding: 1px 7px; }
.add-btn { background: none; border: none; color: var(--pink); display: inline-flex; padding: 4px; flex-shrink: 0; }
.prep { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 0.5px solid var(--border); font-size: 13px; }
.prep:first-of-type { border-top: none; }
.prep.done span { color: var(--text-2); text-decoration: line-through; }
.prep button { background: none; border: none; padding: 0; display: inline-flex; color: var(--border-2); }
.prep.done button { color: var(--pink); }

/* ---- forms ---- */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; }
.field label { font-size: 12px; color: var(--text-2); }
.field input, .field select {
  width: 100%; padding: 10px 12px; font-size: 14px; color: var(--text);
  background: var(--bg); border: 0.5px solid var(--border-2); border-radius: var(--r-md); outline: none;
}
.field input:focus, .field select:focus { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-fill); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 9px; font-size: 13px; border-radius: var(--r-md); border: 0.5px solid var(--border); background: var(--bg); color: var(--text-2); }
.seg button.on { background: var(--pink); color: #fff; border-color: var(--pink); }
.calc-out { display: flex; justify-content: space-around; background: var(--pink-fill); border-radius: var(--r-md); padding: 12px; margin-top: 4px; }
.calc-out div { text-align: center; }
.calc-out b { display: block; font-size: 16px; color: var(--pink-darker); font-weight: 500; }
.calc-out small { font-size: 11px; color: var(--pink-deep); }

/* ---- progress ---- */
.pcard { background: var(--surface); border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px; }
.pcard-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.pbig { font-size: 24px; font-weight: 500; }
.pbig small { font-size: 13px; color: var(--text-3); font-weight: 400; }
.pdelta { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 500; color: var(--pink-deep); }
.trend { width: 100%; height: 80px; display: block; }
.dots { display: flex; justify-content: space-between; }
.dots .tick, .dots .tick.off { font-size: 0; }
.lift { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 0.5px solid var(--border); }
.lift:first-of-type { border-top: none; }
.lift-name { flex: 1; font-size: 13px; }
.lift-now { font-size: 12px; color: var(--text-3); }
.lift-up { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--pink-deep); }
.photos { display: flex; gap: 10px; }
.photo { flex: 1; height: 92px; background: var(--pink-fill); color: var(--pink-deep); border-radius: var(--r-md); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: none; font-size: 11px; }

/* ---- bottom nav ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-nav);
  max-width: 440px; margin: 0 auto;
  display: flex; align-items: center;
  background: var(--bg); border-top: 0.5px solid var(--border);
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; font-size: 11px; color: var(--text-3); padding: 4px 0;
}
.nav-item.active { color: var(--pink); }
.nav-fab {
  flex-shrink: 0; width: 46px; height: 46px; margin: -22px 6px 0; border-radius: var(--r-pill);
  background: var(--pink); color: #fff; border: none; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -4px color-mix(in oklab, var(--pink) 60%, transparent);
}
.nav-fab:active { transform: scale(0.94); }

/* ---- banner + toast ---- */
.banner {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: var(--pink-fill); color: var(--pink-darker); border-radius: var(--r-md);
  padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}
.banner button { background: var(--pink); color: #fff; border: none; border-radius: var(--r-sm); padding: 6px 12px; font-size: 12px; font-weight: 500; }
.banner .close { background: none; color: var(--pink-deep); padding: 4px; }
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(8px);
  background: var(--text); color: var(--bg); font-size: 13px; padding: 9px 16px; border-radius: var(--r-pill);
  opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); z-index: var(--z-toast);
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ===== sweet upgrade layer ===== */
.brand-name, .screen-title, .cal-big, .pbig, .macro-val, h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }
.cal-big, .pbig { letter-spacing: -0.02em; }
.ring-fill { transition: stroke-dashoffset 0.9s var(--ease); }
.card, .pcard { box-shadow: var(--shadow-card); }
.cal { box-shadow: var(--shadow-soft); }
.nav-fab { transition: transform 0.16s var(--ease); }

/* affirmation */
.affirm {
  display: flex; align-items: center; gap: 9px;
  background: var(--pink-fill); color: var(--pink-darker);
  border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 14px;
  font-size: 13px; line-height: 1.4;
}
.affirm i, .affirm .ic { color: var(--pink-deep); flex-shrink: 0; display: inline-flex; }

/* water tracker */
.water-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.water-title { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; }
.water-title .ic { color: var(--pink); display: inline-flex; }
.water-count { font-size: 12px; color: var(--text-3); }
.cups { display: flex; flex-wrap: wrap; gap: 8px; }
.cup {
  width: 34px; height: 40px; border: none; padding: 0; border-radius: 9px 9px 12px 12px;
  background: var(--surface-2); color: var(--border-2);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.14s var(--ease), background 0.2s var(--ease);
}
.cup.full { background: var(--pink-fill); color: var(--pink); }
.cup:active { transform: scale(0.9); }

/* cycle card */
.cycle { display: flex; align-items: center; gap: 13px; }
.cycle-orb {
  width: 46px; height: 46px; border-radius: var(--r-pill); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--pink-fill); color: var(--pink-deep);
}
.cycle-body { flex: 1; min-width: 0; }
.cycle-phase { font-size: 14px; font-weight: 500; }
.cycle-tip { font-size: 12px; color: var(--text-2); line-height: 1.4; margin-top: 2px; }
.cycle-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* mood */
.moods { display: flex; gap: 8px; }
.mood {
  flex: 1; padding: 9px 0; border-radius: var(--r-md); border: 0.5px solid var(--border);
  background: var(--bg); font-size: 20px; transition: transform 0.14s var(--ease);
}
.mood.on { background: var(--pink-fill); border-color: var(--pink); }
.mood:active { transform: scale(0.94); }

/* achievements */
.badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.badge {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: var(--surface); border-radius: var(--r-md);
}
.badge-ic {
  width: 36px; height: 36px; border-radius: var(--r-pill); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--pink-fill); color: var(--pink-deep);
}
.badge-t { font-size: 12px; font-weight: 500; line-height: 1.2; }
.badge-d { font-size: 11px; color: var(--text-3); line-height: 1.2; margin-top: 2px; }
.badge.locked { opacity: 0.45; }
.badge.locked .badge-ic { background: var(--surface-2); color: var(--text-3); }

/* rest timer */
.rest { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--r-md); padding: 10px 12px; margin-top: 8px; }
.rest-label { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.rest-label .ic { color: var(--pink); display: inline-flex; }
.rest-time { font-family: var(--font-display); font-size: 18px; font-weight: 600; min-width: 52px; text-align: center; }
.rest-time.running { color: var(--pink-deep); }
.rest-step { width: 30px; height: 30px; border-radius: var(--r-pill); border: 0.5px solid var(--border); background: var(--bg); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.rest-go { margin-left: auto; padding: 7px 16px; border-radius: var(--r-pill); border: none; background: var(--pink); color: #fff; font-size: 13px; font-weight: 500; }
.rest-go.stop { background: var(--surface-2); color: var(--pink-deep); }

/* goal weight line */
.goal-line { font-size: 12px; color: var(--text-2); margin-top: 8px; text-align: center; }

/* ===== organized layout (rev) ===== */
.group-label { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text-2); margin: 20px 2px 9px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; }
.group-head .group-label { margin-bottom: 9px; }

.cal-card { box-shadow: var(--shadow-soft); }
.cal-card .cal { box-shadow: none; }
.macros-inline { display: flex; gap: 8px; margin-top: 15px; padding-top: 15px; border-top: 0.5px solid var(--border); }
.macros-inline .macro { flex: 1; background: none; padding: 0; box-shadow: none; }
.cal-activity { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 0.5px solid var(--border); }
.cal-activity .activity-item { font-size: 12px; color: var(--text-2); }
.cal-activity .activity-item .ic, .cal-activity .activity-item svg { color: var(--pink); }

.habit-block.divided { border-top: 0.5px solid var(--border); padding-top: 14px; margin-top: 14px; }
.cups { gap: 7px; }
.cup { width: 30px; height: 36px; }

.meals-card { padding-top: 4px; padding-bottom: 4px; }
.meals-card .row { padding: 12px 0; }
