:root {
  --bg: #f3efe7;
  --card: #ffffff;
  --text: #1d1c18;
  --muted: #6e6a60;
  --line: #e6e0d4;
  --track: #eee8dc;
  --dash: #d9d2c4;
  --accent: #1d1c18;
  --on-accent: #f3efe7;
  --on-accent-muted: #cfc8ba;
  --brand: #c8442a;
  --kcal: #1d1c18;
  --protein: #c8442a;
  --carbs: #e0a526;
  --carbs-text: #8a6208;
  --fat: #2e5fbf;
  --good: #3e8a4f;
  --good-text: #2f7040;
  --star: #e0a526;
  --scrim: rgba(29, 28, 24, .48);
  --tone-red-bg: #f5dcd6; --tone-red: #a8322a;
  --tone-orange-bg: #f7e6d6; --tone-orange: #9a4b1c;
  --tone-brown-bg: #e9e1d3; --tone-brown: #5c4632;
  --radius: 24px;
  --display: "Onest", -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #151411;
  --card: #211f1b;
  --text: #f3efe7;
  --muted: #a39e92;
  --line: #34312b;
  --track: #2e2b25;
  --dash: #4a463e;
  --accent: #f3efe7;
  --on-accent: #1d1c18;
  --on-accent-muted: #5c584f;
  --brand: #e8623f;
  --kcal: #f3efe7;
  --protein: #e8623f;
  --carbs: #e8b23a;
  --carbs-text: #e8b23a;
  --fat: #5b86e0;
  --good: #4fa863;
  --good-text: #6cc07f;
  --star: #e8b23a;
  --scrim: rgba(0, 0, 0, .6);
  --tone-red-bg: #3a1f19; --tone-red: #f08a6e;
  --tone-orange-bg: #3a2a18; --tone-orange: #e8a56a;
  --tone-brown-bg: #2f2922; --tone-brown: #c9b49c;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.4 "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: var(--text); }
svg.i { display: block; flex: none; }
#app { max-width: 480px; margin: 0 auto; padding: 16px 16px 0; }
[hidden] { display: none !important; }

.boot { display: grid; place-items: center; height: 70vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--track); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Header */
.header { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; }
.logo { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.logo i { width: 34px; height: 34px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.page-title { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 4px 2px 16px; }
.streak { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 999px; padding: 7px 12px 7px 10px; font-weight: 700; font-size: 14px; color: var(--text); }
.streak .i { color: var(--brand); }

/* Week strip */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 14px; }
.week button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 7px 0 8px; border-radius: 16px; }
.week .wd { font-size: 12px; color: var(--muted); font-weight: 500; }
.week .dn { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.week .dn b { position: relative; font-weight: 700; }
.week button:not(.has):not(.over) .dn { border: 2px dashed var(--dash); }
.week .dn svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.week .dn circle { fill: none; stroke-width: 3; }
.week .dn .trk { stroke: var(--track); }
.week .dn .val { stroke: var(--good); stroke-linecap: round; }
.week .over .dn .val { stroke: var(--protein); }
.fab-space { height: 76px; }
.week .sel { background: var(--card); }
.week .sel .wd { color: var(--text); font-weight: 700; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; }
.kcal-card { display: flex; align-items: center; justify-content: space-between; padding: 22px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kcal-card .big { font-family: var(--display); font-size: 44px; font-weight: 600; letter-spacing: -.04em; line-height: 1; margin: 6px 0; }
.kcal-card .sub { color: var(--muted); font-size: 14px; }
.ring { position: relative; flex: none; }
.ring > svg { display: block; transform: rotate(-90deg); }
.ring .track { stroke: var(--track); }
.ring .val { transition: stroke-dashoffset .6s ease; stroke-linecap: round; }
.ring .icon { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--brand); }

.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.macro { background: var(--card); border-radius: 20px; padding: 14px 12px; }
.macro .v { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.macro .l { font-size: 12px; color: var(--muted); margin: 2px 0 10px; }
.macro.protein .icon { color: var(--protein); }
.macro.carbs .icon { color: var(--carbs-text); }
.macro.fat .icon { color: var(--fat); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; font-family: var(--display); font-size: 17px; font-weight: 600; margin: 6px 2px 10px; }
.section-title small { font-family: "Onest", sans-serif; font-size: 13px; font-weight: 400; color: var(--muted); }
.meal { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 20px; padding: 12px; margin-bottom: 10px; width: 100%; text-align: left; }
.thumb { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.tone-red { background: var(--tone-red-bg); color: var(--tone-red); }
.tone-orange { background: var(--tone-orange-bg); color: var(--tone-orange); }
.tone-brown { background: var(--tone-brown-bg); color: var(--tone-brown); }
.meal .body { flex: 1; min-width: 0; }
.meal .top { display: flex; justify-content: space-between; gap: 8px; }
.meal .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal .time { color: var(--muted); font-size: 12px; font-weight: 500; background: var(--bg); border-radius: 8px; padding: 2px 7px; flex: none; }
.meal .k { font-weight: 600; font-size: 14px; margin: 3px 0; }
.meal .m { color: var(--muted); font-size: 13px; display: flex; gap: 12px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.dot.protein { background: var(--protein); } .dot.carbs { background: var(--carbs); } .dot.fat { background: var(--fat); } .dot.kcal { background: var(--kcal); }
.empty { text-align: center; color: var(--muted); padding: 26px 18px; }
.empty b { color: var(--text); display: block; font-size: 16px; margin-bottom: 4px; }
.demo-banner { background: var(--tone-orange-bg); color: var(--tone-orange); border-radius: 14px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px; }
.btn.secondary { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn:disabled { opacity: .45; }
.btn + .btn { margin-top: 10px; }
.pill { height: 36px; padding: 0 12px; border-radius: 999px; background: var(--bg); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.card-head b { font-weight: 700; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--card); display: grid; place-items: center; flex: none; }

.fab { position: fixed; right: max(16px, calc(50% - 224px)); bottom: calc(96px + env(safe-area-inset-bottom)); width: 62px; height: 62px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 10px 24px rgba(29, 28, 24, .28); z-index: 20; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: 10px 24px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; min-width: 80px; min-height: 44px; }
.tabbar .active { color: var(--text); }

/* Sheet */
.sheet-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: var(--bg); width: 100%; max-width: 480px; border-radius: 28px 28px 0 0; padding: 10px 16px calc(24px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; animation: up .25s ease; }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--dash); margin: 0 auto 14px; }
.sheet h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; margin: 0 0 16px; font-size: 22px; line-height: 1.25; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.primary-action { width: 100%; background: var(--accent); color: var(--on-accent); border-radius: 22px; padding: 18px; display: flex; align-items: center; gap: 16px; text-align: left; margin-bottom: 10px; }
.primary-action .tile { width: 52px; height: 52px; border-radius: 16px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.primary-action b { display: block; font-size: 17px; }
.primary-action small { font-size: 13px; color: var(--on-accent-muted); }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.action { background: var(--card); border-radius: 20px; padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.limit { background: var(--card); border-radius: 18px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.limit b { display: block; font-size: 14px; font-weight: 600; }
.limit small { font-size: 13px; color: var(--muted); }
.quota { display: flex; gap: 5px; }
.quota span { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.quota .on { background: var(--brand); }

/* Analyzing */
.photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); display: block; margin-bottom: 12px; background: var(--line); }
.analyzing { position: relative; }
.analyzing .scan { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #fff; box-shadow: 0 0 0 18px rgba(255, 255, 255, .14); animation: scan 1.6s ease-in-out infinite alternate; }
@keyframes scan { from { top: 4%; } to { top: 92%; } }
.progressbar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin: 16px 0; }
.progressbar div { height: 100%; width: 30%; border-radius: 3px; background: var(--brand); animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.step .mark { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 2px dashed var(--dash); }
.step.todo { color: var(--muted); font-weight: 400; }
.step.now .mark { border: 3px solid var(--track); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.step.done .mark { border: 0; background: var(--good); color: #fff; }
.h2 { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }

/* Result */
.res-title { font-family: var(--display); font-size: 20px; font-weight: 600; margin: 2px 2px 12px; letter-spacing: -.02em; line-height: 1.25; outline: none; }
.res-kcal { display: flex; align-items: center; gap: 14px; }
.res-kcal .big { font-family: var(--display); font-size: 32px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.res-macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.res-macros div { background: var(--bg); border-radius: 14px; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.res-macros b { display: block; color: var(--text); font-size: 17px; }
.item { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--track); }
.item:first-child { border-top: 0; }
.item .n { flex: 1; min-width: 0; text-align: left; align-self: stretch; }
.item.muted { font-size: 14px; justify-content: center; padding: 16px 0; }
.item .n b { display: block; font-weight: 600; }
.item .n small { color: var(--muted); font-size: 13px; }
.stepper { display: flex; align-items: center; background: var(--bg); border-radius: 12px; }
.stepper button { width: 36px; height: 44px; display: grid; place-items: center; }
.stepper input { width: 42px; text-align: right; border: 0; background: none; font-weight: 700; padding: 0; -moz-appearance: textfield; outline: none; }
.stepper .unit { font-weight: 600; color: var(--muted); padding-left: 2px; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.del { color: var(--muted); width: 32px; height: 44px; display: grid; place-items: center; }
.comment { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 0 4px 12px; }
.comment .i { color: var(--brand); margin-top: 1px; }
.add-item { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin: 4px 0 10px; border-radius: 14px; border: 1.5px dashed var(--dash); color: var(--muted); font-weight: 600; font-size: 14px; }
.textarea.search { min-height: 0; height: 52px; padding: 0 16px; margin-bottom: 12px; -webkit-appearance: none; }
.food-res .hint { font-size: 14px; margin: 8px 4px 12px; }
.food-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: var(--card); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; min-height: 56px; }
.food-row span { min-width: 0; }
.food-row b { display: block; font-weight: 600; }
.food-row small { color: var(--muted); font-size: 13px; }
.food-row .i { color: var(--muted); }
.food-row:disabled { opacity: .6; }
.food-other { margin-top: 14px; }
.field input.wide { width: 60%; }
.ref { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--bg); margin-left: 6px; }

/* Forms / onboarding */
.onb { min-height: calc(100vh - 40px); display: flex; flex-direction: column; margin-bottom: -96px; padding-bottom: 20px; }
.onb-top { display: flex; align-items: center; gap: 12px; margin: 4px 0 26px; min-height: 44px; }
.segs { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.segs span { height: 5px; border-radius: 3px; background: var(--dash); }
.segs .on { background: var(--accent); }
.onb-top small { font-size: 13px; font-weight: 600; color: var(--muted); min-width: 28px; text-align: right; }
.onb h2 { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.1; letter-spacing: -.03em; margin: 0 0 8px; }
.onb p.lead { color: var(--muted); font-size: 16px; margin: 0 0 22px; }
.onb .grow { flex: 1; min-height: 20px; }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--card); border-radius: 22px; padding: 18px; margin-bottom: 10px; font-weight: 700; font-size: 16px; min-height: 64px; }
.choice .tile { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--bg); flex: none; }
.choice small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.choice.on { background: var(--accent); color: var(--on-accent); }
.choice.on .tile { background: var(--brand); color: #fff; }
.choice.on small { color: var(--on-accent-muted); }
.field { background: var(--card); border-radius: 18px; padding: 12px 16px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.field label { color: var(--muted); }
.field input, .field select { border: 0; background: none; text-align: right; font-weight: 700; font-size: 18px; width: 120px; outline: none; }
.field input { width: 90px; }
.textarea { width: 100%; min-height: 110px; border-radius: 18px; border: 0; background: var(--card); padding: 14px 16px; resize: none; outline: none; font-size: 16px; }
.plan { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.big-tile { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; }
.big-tile.good { background: var(--good); color: #fff; }
.big-tile.star { background: var(--star); color: #1d1c18; }
.plan-card { background: var(--card); border-radius: 26px; padding: 24px 18px 18px; margin: 18px 0 14px; text-align: center; }
.plan-card .big { font-family: var(--display); font-size: 60px; font-weight: 600; letter-spacing: -.05em; line-height: 1; }
.split { display: flex; gap: 3px; height: 10px; border-radius: 5px; overflow: hidden; margin: 18px 0; }
.split span:nth-child(1) { background: var(--protein); } .split span:nth-child(2) { background: var(--fat); } .split span:nth-child(3) { background: var(--carbs); }
.tips { display: flex; flex-direction: column; gap: 12px; padding: 6px 4px; }
.tip { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.tip .tile { width: 36px; height: 36px; border-radius: 12px; background: var(--card); display: grid; place-items: center; flex: none; }
.tip span:last-child { padding-top: 7px; }

/* Progress */
.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: 20px; padding: 14px 16px; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat .v { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -.03em; margin: 4px 0; }
.stat .d { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.stat .d.good { color: var(--good-text); }
.bmi { display: flex; gap: 3px; margin: 8px 0 4px; }
.bmi span { flex: 1; height: 5px; border-radius: 3px; background: var(--dash); }
.bmi .on { background: var(--good); }
.bmi .on.warn { background: var(--carbs); }
.bmi .on.bad { background: var(--protein); }
.stat-btn { display: block; width: 100%; text-align: left; }
.stat .l { display: flex; justify-content: space-between; align-items: center; }
.stat .more { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); }
/* Окно ИМТ */
.bmi-head { display: flex; align-items: center; gap: 12px; margin: -4px 0 16px; }
.bmi-chip { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.bmi-chip.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good-text); }
.bmi-chip.warn { background: var(--tone-orange-bg); color: var(--tone-orange); }
.bmi-chip.bad { background: var(--tone-red-bg); color: var(--tone-red); }
.bmi-scale { position: relative; display: flex; gap: 2px; height: 10px; }
.bmi-scale span { height: 100%; border-radius: 5px; }
.bmi-scale .good { background: var(--good); } .bmi-scale .warn { background: var(--carbs); } .bmi-scale .bad { background: var(--protein); }
.bmi-scale i { position: absolute; top: -5px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--text); border: 3px solid var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.bmi-ticks { position: relative; height: 18px; margin-top: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bmi-ticks span { position: absolute; transform: translateX(-50%); }
.bmi-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: 6px 0 14px; }
.bmi-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bmi-legend i { width: 10px; height: 4px; border-radius: 2px; }
.bmi-legend .good { background: var(--good); } .bmi-legend .warn { background: var(--carbs); } .bmi-legend .bad { background: var(--protein); }
.bmi-range { padding: 2px 16px; margin-bottom: 14px; }
.bmi-range .l { max-width: 65%; }
.bmi-text { font-size: 15px; line-height: 1.5; margin: 0 2px 12px; }
.bmi-note { background: var(--bg); border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.45; margin-bottom: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.bmi-note.warn { background: var(--tone-orange-bg); color: var(--tone-orange); }
.bmi-about { font-size: 12px; line-height: 1.45; margin: 0 2px 14px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: "Onest", sans-serif; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
/* Вес: свайп по графику — горизонтально листаем точки, вертикально страница прокручивается как обычно */
.w-chart { margin: 4px -4px 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.w-dot { fill: var(--brand); stroke: var(--card); stroke-width: 2; }
.w-cross { stroke: var(--muted); stroke-width: 1; }
.w-raw { fill: var(--muted); opacity: .55; }
.w-legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 2px; }
.w-legend span { display: inline-flex; align-items: center; gap: 6px; }
.w-legend .k-line { width: 14px; height: 2px; border-radius: 1px; background: var(--brand); }
.w-legend .k-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .7; }
.seg-full { margin: 6px 0 14px; }
.seg-full button { flex: 1; }
.w-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 4px; }
.w-val { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.w-val small { font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.w-date { font-size: 13px; margin-top: 4px; min-height: 1.3em; }
.w-change { text-align: right; font-weight: 700; font-size: 15px; }
.w-change small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.w-change.good { color: var(--good-text); }
/* Калории за неделю: тонкие столбики, сплошная линия нормы, выбор дня нажатием */
.kbars { position: relative; display: flex; align-items: flex-end; height: 136px; margin-top: 10px; border-bottom: 1px solid var(--line); }
.kcol { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.kbar { width: 22px; max-width: 70%; border-radius: 4px 4px 0 0; background: var(--accent); transition: opacity .15s; }
.kcol.over .kbar { background: var(--protein); }
.kcol.today .kbar { opacity: .45; }
.kbars.has-sel .kcol:not(.sel) .kbar { opacity: .25; }
.kbars.has-sel .kcol.sel .kbar { opacity: 1; }
.kgoal { position: absolute; left: 0; right: 0; border-top: 1px solid var(--muted); pointer-events: none; z-index: 1; }
.kgoal span { position: absolute; left: 0; bottom: 3px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--card); padding-right: 6px; }
.klabels { display: flex; margin-top: 6px; }
.klabels span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.25; }
.klabels b { display: block; font-weight: 600; font-size: 12px; }
.klabels .today { color: var(--text); }
.klabels .today b { font-weight: 800; }
.w-change.warn { color: var(--tone-orange); }
.k-macros { display: flex; gap: 12px; margin-top: 6px; font-size: 13px; font-weight: 600; }
.k-macros span { display: inline-flex; align-items: center; gap: 5px; }
.inverse { background: var(--accent); color: var(--on-accent); }
.inverse .muted { color: var(--on-accent-muted); }
.streak-card { display: flex; align-items: center; gap: 14px; border-radius: 20px; padding: 14px 16px; margin-bottom: 12px; }
.streak-card .tile { width: 44px; height: 44px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.streak-card small { font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--track); min-height: 48px; }
.row:first-child { border-top: 0; }
.row .l { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.row b { font-weight: 700; }
.row .dot { margin: 0; width: 8px; height: 8px; }
.switch { width: 52px; height: 44px; display: flex; align-items: center; justify-content: flex-end; }
.switch span { width: 50px; height: 30px; border-radius: 999px; background: var(--dash); position: relative; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch[aria-checked="true"] span { background: var(--good); }
.switch[aria-checked="true"] span::after { transform: translateX(20px); }
.premium-card { border-radius: var(--radius); padding: 18px; margin-bottom: 12px; }
.premium-card .head { display: flex; gap: 12px; align-items: flex-start; }
.premium-card .tile { width: 40px; height: 40px; border-radius: 12px; background: var(--star); color: #1d1c18; display: grid; place-items: center; flex: none; }
.premium-card .title { font-family: var(--display); font-size: 17px; font-weight: 600; }
.premium-card .muted { font-size: 14px; margin-top: 3px; }
.premium-card .btn { background: var(--on-accent); color: var(--accent); margin-top: 14px; height: 50px; font-size: 15px; }
.perks .row { justify-content: flex-start; gap: 12px; font-weight: 600; }
.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 3px; }
.seg button { height: 38px; padding: 0 10px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg .on { background: var(--card); color: var(--text); }
.weigh-freq { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; }
.weigh-freq .l { color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.disclaimer { font-size: 12px; text-align: center; margin: 18px 10px; }
.profile-head { display: flex; align-items: center; gap: 14px; margin: 4px 2px 16px; }
.profile-head .muted { font-size: 14px; margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.profile-head .muted .i { color: var(--star); }
.avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; object-fit: cover; background: var(--brand); color: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 24px; font-weight: 700; }
.card-note { font-size: 12px; margin: 2px 0 10px; line-height: 1.4; }
.sub-note { width: 100%; text-align: left; }
.link-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; }
.link-card .tile { width: 40px; height: 40px; border-radius: 12px; background: var(--bg); color: var(--fat); display: grid; place-items: center; flex: none; }
.link-card .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.link-card small { font-size: 13px; }
.version { font-size: 12px; text-align: center; margin: -10px 0 18px; opacity: .8; }
.row b.r { text-align: right; max-width: 60%; }

.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 100; white-space: nowrap; animation: fade .2s; }
