:root {
  --bg: #F3F4F1;
  --surface: #FFFFFF;
  --surface-2: #ECEEE9;
  --text: #141613;
  --muted: #6A7067;
  --line: #E2E5DE;
  --accent: #C8F05A;
  --on-accent: #141613;
  --accent-strong: #4D7C0F;
  --accent-soft: #EEF8D2;
  --danger: #D64541;
  --mp: #4F7CF0;
  --mf: #EE9B2F;
  --mc: #22A06B;
  --water: #3B9BE8;
  --shadow: 0 1px 2px rgba(20, 22, 19, .05), 0 4px 16px rgba(20, 22, 19, .04);
  --r: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0F110E;
  --surface: #191C17;
  --surface-2: #242822;
  --text: #F2F4EF;
  --muted: #959B90;
  --line: #2B2F28;
  --accent-strong: #C8F05A;
  --accent-soft: #252E14;
  --danger: #FF6B5E;
  --mp: #6E95FF;
  --mf: #F5AE4A;
  --mc: #3CC48A;
  --water: #5AB2F5;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 750; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 16px; height: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-logo { font-weight: 900; letter-spacing: .12em; font-size: 22px; opacity: .5; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .2; } }

.screen { padding: 12px 16px calc(96px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.screen.no-nav { padding-bottom: calc(24px + var(--safe-b)); }

/* Логотип */
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; letter-spacing: .1em; font-size: 15px; }
.logo-mark { width: 28px; height: 28px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.logo-mark svg { width: 18px; height: 18px; stroke: var(--on-accent); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.logo.lg { font-size: 20px; } .logo.lg .logo-mark { width: 40px; height: 40px; border-radius: 12px; } .logo.lg .logo-mark svg { width: 26px; height: 26px; }

/* Шапки */
.top { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 14px; gap: 12px; }
.hello { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.page-title { padding: 6px 0 14px; }
.back-bar { display: flex; align-items: center; gap: 6px; padding: 4px 0 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); }

/* Карточки */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card, .card + .grid2, .grid2 + .card, .grid2 + .grid2 { margin-top: 12px; }
.card-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 > .card, .grid3 > .card { margin-top: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.section-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 22px 2px 10px; }

/* Кнопки */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 18px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px; transition: transform .1s, opacity .15s; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--text); }
.btn.sm { min-height: 40px; font-size: 14px; border-radius: 12px; padding: 0 14px; width: auto; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--line); }
.link { color: var(--accent-strong); font-weight: 600; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; height: 36px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 8px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); }
.tag.free { background: var(--accent-soft); color: var(--accent-strong); }
.tag.lock { background: transparent; padding: 0; color: var(--muted); }

/* Кольцо калорий */
.ring-card { display: flex; align-items: center; gap: 18px; }
.ring { flex: none; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 11; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
[data-theme="light"] .ring-fg { stroke: #A6D93A; }
.ring-fg.over { stroke: var(--mf); }
.ring-num { font-size: 22px; font-weight: 800; fill: var(--text); font-variant-numeric: tabular-nums; }
.ring-sub { font-size: 11px; fill: var(--muted); }
.ring-side { flex: 1; min-width: 0; }
.big { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.macros { display: grid; gap: 9px; margin-top: 12px; }
.macro-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.macro-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width .5s ease; }
.macros.inline { grid-template-columns: repeat(3, 1fr); gap: 12px; }

.tile { display: flex; flex-direction: column; gap: 8px; min-height: 132px; }
.tile-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); }
.tile-val { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile .btn { margin-top: auto; }

/* Баннеры доступа */
.banner { display: flex; align-items: center; gap: 12px; border-radius: var(--r); padding: 14px 16px; background: var(--accent-soft); margin-bottom: 12px; }
.banner b { display: block; }
.banner .btn { flex: none; }
.banner.strong { background: var(--text); color: var(--bg); }
.banner.strong .muted { color: inherit; opacity: .7; }

/* Тренировки */
.wlist { display: grid; gap: 12px; margin-top: 14px; }
.wcard { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); text-align: left; width: 100%; display: block; }
.wcard:active { transform: scale(.99); }
.wcard-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.wcard h3 { margin-bottom: 6px; }
.meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.done-mark { margin-top: 10px; font-size: 13px; color: var(--accent-strong); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.wcard.locked h3, .wcard.locked .meta { opacity: .6; }

.ex { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.ex:first-child { border-top: 0; padding-top: 2px; }
.ex-n { width: 28px; height: 28px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.ex-body { flex: 1; min-width: 0; }
.ex-name { font-weight: 650; }
.ex-dose { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex-cue { margin-top: 6px; font-size: 13px; color: var(--muted); }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.sticky-cta .btn { max-width: 528px; margin: 0 auto; }

/* Плеер */
.player { min-height: 100vh; display: flex; flex-direction: column; padding: 12px 16px calc(20px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.player-top { display: flex; align-items: center; gap: 12px; }
.player-top .bar { flex: 1; height: 8px; }
.player-main { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 24px 0; }
.player-phase { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.player-name { font-size: 26px; font-weight: 800; margin-top: 8px; letter-spacing: -0.02em; }
.player-big { font-size: 76px; font-weight: 850; letter-spacing: -0.04em; line-height: 1; margin: 22px 0 6px; font-variant-numeric: tabular-nums; }
.player-unit { color: var(--muted); font-weight: 600; }
.player-cue { margin: 22px auto 0; max-width: 380px; color: var(--muted); font-size: 14px; }
.player.rest .player-big { color: var(--accent-strong); }
.next-up { margin-top: 26px; padding: 12px 14px; background: var(--surface); border-radius: 14px; display: inline-flex; gap: 8px; align-self: center; font-size: 14px; }
.player-done-ic { width: 84px; height: 84px; border-radius: 26px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; margin: 0 auto 18px; }
.player-done-ic svg { width: 44px; height: 44px; stroke-width: 2.6; }

/* Питание */
.date-nav { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 12px; }
.date-nav b { font-size: 16px; }
.meal { margin-top: 12px; }
.meal-head { display: flex; align-items: center; justify-content: space-between; }
.meal-head h3 { font-size: 16px; }
.entry { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.meal-head + .entry { margin-top: 8px; }
.entry-main { flex: 1; min-width: 0; }
.entry-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-kcal { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-del { color: var(--muted); padding: 6px; margin-right: -6px; }
.add-row { display: flex; align-items: center; gap: 8px; padding-top: 10px; color: var(--accent-strong); font-weight: 650; width: 100%; }
.water-row { display: flex; align-items: center; gap: 12px; }
.water-cups { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.cup { width: 14px; height: 20px; border-radius: 3px 3px 5px 5px; background: var(--surface-2); }
.cup.on { background: var(--water); }

.locked-box { text-align: center; padding: 28px 18px; }
.locked-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 14px; }

/* Профиль */
.avatar { width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.kv:first-child { border-top: 0; padding-top: 0; }
.kv span:last-child { font-weight: 650; text-align: right; }
.wchart { width: 100%; height: 120px; display: block; }
.wchart-legend { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; }
.blur { filter: blur(5px); pointer-events: none; user-select: none; }
.list-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 0; border-top: 1px solid var(--line); text-align: left; font-weight: 550; }
.list-btn:first-child { border-top: 0; padding-top: 0; }
.list-btn span { flex: 1; }

/* Онбординг */
.onb { min-height: 100vh; display: flex; flex-direction: column; padding: 16px 16px calc(20px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.onb-hero { justify-content: space-between; }
.onb-hero h1 { margin: 34px 0 12px; font-size: 32px; }
.checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 10px; align-items: center; font-weight: 550; }
.checks .i { color: var(--on-accent); background: var(--accent); border-radius: 8px; padding: 4px; width: 26px; height: 26px; }
.onb-foot { display: grid; gap: 10px; margin-top: 28px; }
.onb-head { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.onb-head .bar { flex: 1; }
.onb h2 { margin-bottom: 6px; }
.opts { display: grid; gap: 10px; margin-top: 22px; }
.opt { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); text-align: left; width: 100%; }
.opt.on { box-shadow: inset 0 0 0 2px var(--accent-strong); background: var(--accent-soft); }
.opt-emoji { font-size: 26px; width: 36px; text-align: center; }
.opt b { display: block; font-size: 16px; }
.result-num { font-size: 56px; font-weight: 850; letter-spacing: -0.04em; line-height: 1; margin: 18px 0 4px; font-variant-numeric: tabular-nums; }

/* Поля */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.input { width: 100%; height: 50px; padding: 0 14px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 17px; outline: none; }
.sheet .input { background: var(--surface-2); box-shadow: none; }
.input:focus { box-shadow: inset 0 0 0 2px var(--accent-strong); }
.fields { display: grid; gap: 14px; margin-top: 22px; }
.fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 14px; color: var(--muted); }
.search .input { padding-left: 44px; }

/* Нижняя навигация */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); z-index: 10; }
.nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; max-width: 110px; }
.nav button.on { color: var(--text); }
.nav button.on .i { stroke: var(--accent-strong); }

/* Шторка */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s; }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + var(--safe-b)); transform: translateY(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); max-width: 560px; margin: 0 auto; }
.sheet.open .sheet-bg { opacity: 1; }
.sheet.open .sheet-body { transform: none; }
.grabber { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.food-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 0; border-top: 1px solid var(--line); }
.food-item:first-child { border-top: 0; }
.food-item div { flex: 1; min-width: 0; }
.food-item .i { color: var(--accent-strong); }
.calc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; background: var(--surface-2); border-radius: 14px; padding: 12px 6px; }
.calc b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }

/* Paywall */
.pw-head { text-align: center; padding: 4px 0 6px; }
.pw-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; }
.pw-list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.pw-list li { display: flex; gap: 10px; align-items: flex-start; }
.pw-list .i { color: var(--accent-strong); margin-top: 1px; }
.plans { display: grid; gap: 10px; }
.plan { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; box-shadow: inset 0 0 0 1.5px var(--line); text-align: left; width: 100%; }
.plan.on { box-shadow: inset 0 0 0 2px var(--accent-strong); background: var(--accent-soft); }
.plan-radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line); flex: none; }
.plan.on .plan-radio { box-shadow: inset 0 0 0 7px var(--accent-strong); }
.plan-main { flex: 1; }
.plan-price { font-weight: 800; font-size: 17px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-badge { position: absolute; top: -9px; right: 14px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }

/* Админка */
.stat { background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.bars i { display: block; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
[data-theme="light"] .bars i { background: #A6D93A; }
.bars i.p { background: var(--text); border-radius: 4px; }
.urow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.urow:first-child { border-top: 0; }
.urow .avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }
.urow-main { flex: 1; min-width: 0; }
.urow-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.st.paid { background: var(--accent); color: var(--on-accent); }
.st.trial { background: var(--accent-soft); color: var(--accent-strong); }

/* Тост */
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.skeleton { height: 120px; border-radius: var(--r); background: var(--surface); opacity: .6; animation: pulse 1.2s ease-in-out infinite; }
.skeleton + .skeleton { margin-top: 12px; }
.card .skeleton { background: var(--surface-2); height: 80px; }
.empty { text-align: center; padding: 24px 12px; color: var(--muted); font-size: 14px; }
.disclaimer { font-size: 12px; color: var(--muted); text-align: center; margin-top: 22px; line-height: 1.5; }

@media (min-width: 420px) { .grid3.stats { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ===== Удержание: серия, курсы, быстрый ввод, фото, замеры ===== */
.streak { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.streak.pending { background: var(--surface-2); color: var(--muted); }
.top .logo { font-size: 0; gap: 0; } /* в шапке главной — только знак, чтобы поместилась серия */

.course-promo { border: 1.5px dashed var(--line); box-shadow: none; }
.hrail { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; scroll-snap-type: x mandatory; scroll-padding: 0 16px; }
.hrail::-webkit-scrollbar { display: none; }
.ccard { flex: none; width: 220px; display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); scroll-snap-align: start; }
.ccard b { font-size: 16px; line-height: 1.25; }
.ccard .tag { align-self: flex-start; }
.ccard.on { box-shadow: inset 0 0 0 2px var(--accent-strong); }
.ccard .bar { margin-top: 4px; }
.course-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cday { aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.cday.done { background: var(--accent); color: var(--on-accent); }
.cday.cur { box-shadow: inset 0 0 0 2px var(--accent-strong); color: var(--text); background: var(--surface); }
.cday.rest { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }

.meal-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.meal-actions .add-row { width: auto; }
.mini-link { color: var(--muted); padding: 4px; display: grid; place-items: center; }
.photo-cta { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); text-align: left; }
.photo-cta > span { flex: 1; display: grid; }
.photo-cta .i:first-child { color: var(--accent-strong); }
.food-item .saved-main { flex: 1; min-width: 0; text-align: left; }
.food-item > button:last-child .i { color: var(--accent-strong); }

.ai-img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 14px; display: block; margin-bottom: 12px; }
.ai-wait { display: flex; align-items: center; gap: 14px; padding: 18px 4px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent-strong); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.ai-row:first-child { border-top: 0; }
.ai-row.off .entry-main { opacity: .45; }
.ai-check { width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--line); display: grid; place-items: center; flex: none; }
.ai-check.on { background: var(--accent); box-shadow: none; color: var(--on-accent); }
.ai-g { display: flex; align-items: center; gap: 4px; flex: none; }
.ai-g .input { width: 68px; height: 40px; padding: 0 8px; text-align: right; font-size: 15px; }

.auto-note { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--muted); }
.auto-note .i { flex: none; margin-top: 2px; color: var(--accent-strong); }
.auto-note b { color: var(--text); }
.delta { font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px; margin-left: 4px; background: var(--surface-2); }
.delta.down { color: var(--accent-strong); background: var(--accent-soft); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb span { position: absolute; left: 6px; bottom: 5px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); font-weight: 600; }
.thumb.add { color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: inset 0 0 0 1.5px var(--line); background: transparent; }
.thumb.add span { position: static; color: var(--muted); text-shadow: none; }
.photo-full { width: 100%; border-radius: 14px; display: block; min-height: 200px; background: var(--surface-2); }

.switch { width: 44px; height: 26px; border-radius: 999px; background: var(--surface-2); position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch.on { background: var(--accent-strong); }
.switch.on i { transform: translateX(18px); }
.list-btn .switch { flex: none; }
.offer { display: inline-block; padding: 8px 12px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 13px; }
.plan-price s { font-weight: 500; margin-right: 2px; }
.food-item .entry-del .i { color: var(--muted); }
.danger-text { color: var(--danger); }
.onb-foot .link { display: inline; font-size: inherit; }

/* ===== Анимации и оформление ===== */
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.screen.enter > * { animation: rise .38s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--t, 0ms); }
.screen.enter > *:nth-child(2) { animation-delay: calc(var(--t, 0ms) + 40ms); }
.screen.enter > *:nth-child(3) { animation-delay: calc(var(--t, 0ms) + 80ms); }
.screen.enter > *:nth-child(4) { animation-delay: calc(var(--t, 0ms) + 120ms); }
.screen.enter > *:nth-child(5) { animation-delay: calc(var(--t, 0ms) + 160ms); }
.screen.enter > *:nth-child(n+6) { animation-delay: calc(var(--t, 0ms) + 200ms); }
.screen.enter .ring-fg, .screen.enter .streak { animation-delay: var(--t, 0ms); }
.onb > * { animation: rise .4s cubic-bezier(.2, .8, .2, 1) both; }
.onb > *:nth-child(2) { animation-delay: .05s; } .onb > *:nth-child(3) { animation-delay: .1s; } .onb > *:nth-child(n+4) { animation-delay: .15s; }
.screen.enter .ring-fg { animation: ring-in .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ring-in { from { stroke-dashoffset: 327; } }
.screen.enter .streak { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both .2s; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.player-done-ic { animation: pop .55s cubic-bezier(.3, 1.6, .5, 1) both; }
.btn { transition: transform .1s, opacity .15s, filter .15s; }
.btn:active { filter: brightness(.95); }
/* полноэкранный плеер: отступ под системные кнопки Telegram */
.player { padding-top: calc(12px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)); }

/* Подсказка про звёзды на экране оплаты */
.stars-hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 13px; line-height: 1.4; color: var(--muted); }
.stars-hint b { color: var(--text); }

/* Воронка в админке */
.funnel { font-size: 13px; overflow-x: auto; }
.fn-row { display: grid; grid-template-columns: minmax(90px, 1.6fr) repeat(4, minmax(44px, 1fr)) minmax(44px, .9fr); gap: 6px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); }
.fn-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-row i { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
.fn-head { border-top: 0; font-size: 11px; color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }

/* Момент пользы */
.moment { text-align: center; padding: 8px 4px 4px; }
.moment-ic { width: 76px; height: 76px; margin: 4px auto 14px; border-radius: 24px; display: grid; place-items: center; font-size: 40px; background: color-mix(in srgb, var(--accent, #C8F05A) 25%, transparent); }
.moment h2 { margin: 0; }

/* Техника упражнения по шагам */
.how { margin-top: 8px; font-size: 13px; }
.how summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: " ›"; }
.how[open] summary::after { content: " ˅"; }
.how-steps { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text); }
.how-err { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--text); font-size: 13px; }
.how-err svg { color: var(--danger); flex: none; margin-top: 2px; }
#sheet-c .how-steps { font-size: 15px; gap: 10px; margin-top: 12px; }
/* Звук в плеере */
.player-top .snd { font-size: 18px; }
/* Прогулка */
.wcard.walk.on { box-shadow: inset 0 0 0 2px var(--accent-strong), var(--shadow); }
#sheet-c .opts { margin-top: 10px; }
#sheet-c .opt { padding: 12px 14px; }
/* Подпункты напоминаний в профиле */
.list-btn.sub { padding: 10px 0 10px 34px; font-weight: 500; font-size: 15px; border-top-style: dashed; }
