/* =====================================================================
   NYORA Health — стили
   Цвета и шрифты меняются в :root. Тёмная тема — ниже.
   ===================================================================== */
:root {
  --font: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-d: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;

  --bg: #f5f3ef;          /* фон приложения — тёплый светлый */
  --card: #ffffff;        /* карточки */
  --ink: #1d1d1f;         /* основной текст */
  --ink-2: #6e6e73;       /* второстепенный текст */
  --ink-3: #a1a1a6;
  --line: #ebe7e1;
  --fill: #efebe5;        /* поля, дорожки */
  --fill-2: #e3ded6;

  --accent: #8e2a3a;      /* фирменный винный NYORA */
  --accent-ink: #ffffff;
  --accent-soft: rgba(142, 42, 58, .09);
  --brand: #291f16;       /* тёмно-коричневый NYORA */
  --cream: #f3ede3;       /* кремовый NYORA */

  --prot: #b03a4e;        /* белки */
  --fat: #b7791f;         /* жиры */
  --carb: #3a6db0;        /* углеводы */
  --water: #2f7fc1;
  --water-soft: rgba(47, 127, 193, .13);
  --good: #2b7a4b;
  --warn: #b35c00;

  --shadow: 0 1px 2px rgba(41, 31, 22, .04), 0 6px 22px rgba(41, 31, 22, .05);
  --r: 22px;
  --ease: cubic-bezier(.28, .11, .32, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --tab-h: 62px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0c0a; --card: #1a1612; --ink: #f3ede3; --ink-2: #a69c90; --ink-3: #6f675e;
    --line: #2a241e; --fill: #25201a; --fill-2: #322b23;
    --accent: #cf5a71; --accent-soft: rgba(207, 90, 113, .14);
    --prot: #d9587a; --fat: #b88526; --carb: #5b8fd6;
    --water: #5ba3e0; --water-soft: rgba(91, 163, 224, .16);
    --good: #57b77f; --warn: #e3923a;
    --shadow: 0 0 0 0 transparent;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0c0a; --card: #1a1612; --ink: #f3ede3; --ink-2: #a69c90; --ink-3: #6f675e;
  --line: #2a241e; --fill: #25201a; --fill-2: #322b23;
  --accent: #cf5a71; --accent-soft: rgba(207, 90, 113, .14);
  --prot: #d9587a; --fat: #b88526; --carb: #5b8fd6;
  --water: #5ba3e0; --water-soft: rgba(91, 163, 224, .16);
  --good: #57b77f; --warn: #e3923a;
  --shadow: 0 0 0 0 transparent;
  color-scheme: dark;
}

/* ---------- база ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 17px; line-height: 1.45; letter-spacing: -.016em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
  transition: background-color .4s var(--ease);
}
body.noscroll { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; letter-spacing: inherit; text-align: inherit; }
button:disabled { opacity: .35; cursor: default; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
::selection { background: var(--accent-soft); }

.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.dim { color: var(--ink-3); width: 18px; height: 18px; }

#app {
  max-width: 600px; margin: 0 auto;
  padding: calc(var(--safe-t) + 10px) 16px calc(var(--tab-h) + var(--safe-b) + 32px);
}

/* ---------- типографика ---------- */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 4px 18px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--accent); margin-bottom: 2px; }
h1 { font: 700 34px/1.08 var(--font-d); letter-spacing: -.03em; }
h2 { font: 700 22px/1.2 var(--font-d); letter-spacing: -.02em; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.sec-h { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 28px 6px 8px; }
.hint { font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mt8 { margin-top: 8px; }
.mb { margin-bottom: 12px; }
.good { color: var(--good); }
.warnc { color: var(--warn); }
.empty { font-size: 14px; color: var(--ink-3); margin-top: 6px; }
.foot { text-align: center; font-size: 12.5px; color: var(--ink-3); margin: 26px 10px 0; line-height: 1.5; }
.foot a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--fill); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

/* ---------- карточки и кнопки ---------- */
.card { background: var(--card); border-radius: var(--r); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--ink); transition: transform .15s var(--ease), background .2s; flex: none; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 32px; height: 32px; background: transparent; color: var(--ink-3); }
.icon-btn.sm .i { width: 18px; height: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 14px;
  font-weight: 600; font-size: 17px; background: var(--fill); color: var(--ink);
  transition: transform .15s var(--ease), opacity .2s, background .2s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.block { display: flex; width: 100%; }
.btn.block + .btn.block { margin-top: 8px; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 15px; border-radius: 11px; }
.btn.danger { color: #c0392b; }
.btn .i { width: 20px; height: 20px; }
.btn.cream { background: var(--cream); color: var(--brand); }
.btn.ghost-c { background: transparent; color: rgba(243, 237, 227, .7); }
.link-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 4px 0 16px; font-size: 15px; font-weight: 500; color: var(--accent); }
.link-btn .i { width: 18px; height: 18px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 34px; padding: 0 14px; border-radius: 17px; background: var(--fill); font-size: 15px; font-weight: 500; color: var(--ink); transition: background .2s, color .2s; }
.chip.on { background: var(--ink); color: var(--bg); }
.chips.sm .chip { min-height: 30px; padding: 0 11px; font-size: 13px; }
.meal-chips { flex-wrap: nowrap; gap: 6px; }
.meal-chips .chip { flex: 1 1 auto; padding: 0 8px; text-align: center; white-space: nowrap; }
.meal-chips + .hint { margin-top: 14px; }
.meal-chips + .pslot, .meal-chips + .search { margin-top: 14px; }

.seg { display: flex; background: var(--fill); border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.seg button { flex: 1; min-height: 34px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); text-align: center; transition: background .2s, color .2s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg.sm { margin: 0; }
.seg.sm button { min-height: 30px; font-size: 13px; padding: 0 9px; }

/* ---------- поля ввода ---------- */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--ink-2); margin: 0 4px 6px; }
input[type="text"], input[type="number"], input[type="search"], input[type="date"], input[type="email"], input[type="password"], textarea {
  width: 100%; font-size: 17px; padding: 13px 14px; border-radius: 14px; border: 0;
  background: var(--card); color: var(--ink); outline: none;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s;
  -webkit-appearance: none; appearance: none; min-height: 50px;
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, textarea:focus { box-shadow: inset 0 0 0 2px var(--accent); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.out { min-height: 50px; display: flex; align-items: center; padding: 0 14px; border-radius: 14px; background: var(--fill); font-weight: 600; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 4px 4px 16px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--ink-3); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.bigin { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 8px 0 20px; }
.bigin input { width: 170px; text-align: center; font: 700 48px/1 var(--font-d); letter-spacing: -.03em; background: transparent; box-shadow: none; padding: 6px; border-bottom: 2px solid var(--line); border-radius: 0; }
.bigin input:focus { box-shadow: none; border-color: var(--accent); }
.bigin span { font-size: 20px; color: var(--ink-2); }

/* ---------- нижняя панель ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding-bottom: var(--safe-b);
  background: var(--card);
  background: color-mix(in srgb, var(--card) 84%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--line);
}
.tabbar-in { max-width: 600px; margin: 0 auto; height: var(--tab-h); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 500; color: var(--ink-3); height: 100%; transition: color .2s; }
.tab .i { width: 24px; height: 24px; }
.tab.on { color: var(--accent); }
.tab-add .plus { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(142, 42, 58, .32); transition: transform .2s var(--spring); }
.tab-add:active .plus { transform: scale(.9); }
.tab-add .plus .i { width: 24px; height: 24px; stroke-width: 2.2; }
body.ob-mode .tabbar { display: none; }

/* ---------- Сегодня ---------- */
.daynav { display: flex; align-items: center; gap: 6px; }
.daynav .chip { min-height: 40px; }
.hero { padding: 22px 18px 20px; text-align: center; }
.ring-wrap { position: relative; width: min(220px, 62vw); aspect-ratio: 1; margin: 0 auto 16px; }
.ring { width: 100%; height: 100%; display: block; }
.ring-track { fill: none; stroke: var(--fill); stroke-width: 14; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring-fill.over { stroke: var(--warn); }
.ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-lbl { font-size: 14px; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.ring-lbl .i { width: 16px; height: 16px; color: var(--warn); }
.ring-num { font: 700 50px/1 var(--font-d); letter-spacing: -.04em; margin: 6px 0 2px; }
.ring-unit { font-size: 13px; color: var(--ink-2); }
.eq { display: flex; align-items: center; justify-content: center; gap: 10px; }
.eq-i { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.eq-i span { font-size: 12px; color: var(--ink-2); }
.eq-i b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.eq > i { font-style: normal; color: var(--ink-3); font-size: 18px; }

.macros { display: grid; gap: 14px; }
.macro-top { display: flex; align-items: baseline; gap: 8px; font-size: 15px; margin-bottom: 7px; }
.macro-top .nm { flex: 1; }
.macro-top b { font-weight: 600; font-variant-numeric: tabular-nums; }
.macro-top .of { color: var(--ink-2); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; align-self: center; display: inline-block; }
.mbar { height: 8px; border-radius: 4px; background: var(--fill); background: color-mix(in srgb, var(--c) 16%, transparent); overflow: hidden; }
.mbar i { display: block; height: 100%; border-radius: 4px; background: var(--c); transition: width .9s var(--ease); }

.sec-row { display: flex; align-items: center; gap: 10px; }
.sec-row h3 { flex: 1; }
.sec-row .k { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.add-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; transition: transform .15s; }
.add-btn:active { transform: scale(.9); }
.add-btn .i { width: 18px; height: 18px; stroke-width: 2.2; }
.items { list-style: none; margin-top: 10px; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.item:first-child { border-top: 0; }
.thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--fill); flex: none; display: grid; place-items: center; font-weight: 600; color: var(--ink-2); font-size: 17px; }
.thumb.acc { background: var(--accent-soft); color: var(--accent); }
.thumb .i { width: 20px; height: 20px; }
.item-m { flex: 1; min-width: 0; }
.item-m b { display: block; font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-m small { font-size: 13px; color: var(--ink-2); }
.item-k { font-weight: 600; font-variant-numeric: tabular-nums; }
.health-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); margin-top: 12px; }
.health-line .i { width: 18px; height: 18px; color: var(--accent); }

.glasses { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.glass { width: 38px; height: 46px; border-radius: 11px; background: var(--fill); display: grid; place-items: center; color: var(--ink-3); transition: background .25s, color .25s, transform .15s var(--spring); }
.glass:active { transform: scale(.9); }
.glass.on { background: var(--water-soft); color: var(--water); }
.glass.on .i { fill: currentColor; }

.wq { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wq .lbl { display: block; font-size: 13px; color: var(--ink-2); }
.wq b { font: 700 24px/1.2 var(--font-d); letter-spacing: -.02em; }
.wq small { display: block; font-size: 13px; color: var(--ink-2); }

/* ---------- окна снизу ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .34); opacity: 0; transition: opacity .3s; z-index: 40; }
.sheet-back.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 600px; margin: 0 auto;
  background: var(--bg); border-radius: 24px 24px 0 0; max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column; transform: translateY(100%);
  transition: transform .42s var(--ease); box-shadow: 0 -10px 40px rgba(0, 0, 0, .12);
}
.sheet.open { transform: none; }
.sheet.tall { height: 92vh; height: 92dvh; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px 10px; flex: none; }
.sheet-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .icon-btn { width: 34px; height: 34px; }
.sheet-head .icon-btn .i { width: 18px; height: 18px; }
.sheet-body { overflow-y: auto; padding: 4px 18px calc(22px + var(--safe-b)); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1; }

.menu { background: var(--card); border-radius: 18px; overflow: hidden; }
.menu-i { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 16px; border-top: 1px solid var(--line); }
.menu-i:first-child { border-top: 0; }
.menu-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.menu-ic .i { width: 20px; height: 20px; }
.menu-i div { flex: 1; min-width: 0; }
.menu-i b { display: block; font-weight: 500; }
.menu-i small { color: var(--ink-2); font-size: 13px; }

.search { position: relative; margin: 14px 0 10px; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; pointer-events: none; }
.search input { padding-left: 40px; }
.quick2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 14px; background: var(--card); font-weight: 500; font-size: 15px; box-shadow: inset 0 0 0 1px var(--line); }
.tile-btn .i { width: 20px; height: 20px; color: var(--accent); }
.res-group { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 20px 4px 6px; }
.res-list { background: var(--card); border-radius: 16px; overflow: hidden; }
.res { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-top: 1px solid var(--line); }
.res:first-child { border-top: 0; }
.res:active { background: var(--fill); }
.res div { flex: 1; min-width: 0; }
.res b { display: block; font-weight: 500; font-size: 16px; }
.res small { font-size: 12.5px; color: var(--ink-2); }
.res span { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-state { text-align: center; padding: 28px 10px; color: var(--ink-2); }
.empty-state p { margin-bottom: 12px; }

.psum { background: var(--card); border-radius: 18px; padding: 16px 10px; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 6px; text-align: center; margin: 12px 0; }
.psum div span { display: block; font-size: 12px; color: var(--ink-2); }
.psum div b { font: 700 20px/1.3 var(--font-d); font-variant-numeric: tabular-nums; }
.psum .kc b { font-size: 26px; }

.pslot { display: flex; align-items: center; justify-content: center; gap: 10px; height: 110px; border-radius: 18px; background: var(--card); border: 1.5px dashed var(--fill-2); color: var(--ink-2); cursor: pointer; margin: 12px 0; font-weight: 500; font-size: 15px; transition: opacity .2s; }
.pslot .i { color: var(--accent); }
.pslot.loading { opacity: .5; pointer-events: none; }
.pslot.has { border: 0; height: auto; position: relative; overflow: hidden; display: block; background: var(--fill); }
.pslot.has img { width: 100%; max-height: 260px; object-fit: cover; }
.pslot .rm { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, .5); color: #fff; width: 34px; height: 34px; }
.entry-photo { width: 100%; max-height: 300px; object-fit: cover; border-radius: 18px; margin-bottom: 4px; background: var(--fill); }
.entry-photo.tall { max-height: 62vh; object-fit: contain; }
img.missing { opacity: 0; }

/* ---------- знакомство ---------- */
body.ob-mode #app { padding-bottom: calc(110px + var(--safe-b)); }
body.ob-welcome { background: var(--brand); }
body.ob-welcome #app { padding-bottom: 20px; }
.welcome { min-height: calc(100vh - 40px); min-height: calc(100dvh - 40px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--cream); padding: 40px 12px; }
.welcome .mark { width: 64px; height: auto; margin-bottom: 30px; opacity: 0; animation: rise 1.2s var(--ease) .05s forwards; }
.welcome .wm { width: min(230px, 60vw); height: auto; opacity: 0; animation: rise 1.2s var(--ease) .2s forwards; }
.welcome .wm-sub { letter-spacing: .62em; padding-left: .62em; font-size: 13px; font-weight: 500; margin: 18px 0 36px; opacity: 0; animation: rise 1.2s var(--ease) .35s forwards; }
.welcome p { max-width: 320px; color: rgba(243, 237, 227, .72); margin-bottom: 40px; opacity: 0; animation: rise 1.2s var(--ease) .55s forwards; }
.welcome .btn { max-width: 340px; opacity: 0; animation: rise 1.2s var(--ease) .75s forwards; }
.welcome small { margin-top: 16px; font-size: 12.5px; color: rgba(243, 237, 227, .45); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.ob { animation: fadeIn .4s var(--ease); }
.ob.still, .ob.still .ob-sub { animation: none; }
.ob-top { display: flex; align-items: center; gap: 14px; padding: 6px 0 24px; }
.ob-prog { flex: 1; height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.ob-prog i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .6s var(--ease); }
.ob-sp { width: 40px; }
.ob-h { margin-bottom: 8px; }
.ob-p { color: var(--ink-2); margin-bottom: 22px; }
.ob-sub { margin-top: 18px; animation: fadeIn .4s var(--ease); }
.ob-sub .hint { margin: -2px 6px 16px; }
.ob-foot { position: fixed; left: 0; right: 0; bottom: 0; padding: 18px 16px calc(14px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 72%, transparent); z-index: 5; }
.ob-foot .btn { max-width: 568px; margin: 0 auto; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--card); border-radius: 18px; padding: 15px 18px; margin-bottom: 10px; box-shadow: var(--shadow), inset 0 0 0 2px transparent; transition: box-shadow .25s; }
.opt.on { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.opt-t { flex: 1; }
.opt b { display: block; font-weight: 600; }
.opt small { display: block; color: var(--ink-2); font-size: 14px; margin-top: 1px; }
.radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-3); flex: none; transition: box-shadow .25s var(--spring); }
.opt.on .radio { box-shadow: inset 0 0 0 7px var(--accent); }
.sex2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.opt.sq { flex-direction: column; align-items: flex-start; justify-content: space-between; height: 108px; margin: 0; }
.opt.sq .radio { align-self: flex-end; }
.num { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border-radius: 18px; padding: 8px 8px 8px 18px; margin-bottom: 10px; box-shadow: var(--shadow); }
.num > span:first-child { font-weight: 500; }
.num-in { display: flex; align-items: center; gap: 4px; }
.num-in input { width: 112px; text-align: right; font: 600 22px/1 var(--font-d); background: var(--fill); box-shadow: none; padding: 10px 12px; min-height: 48px; }
.num-in input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.num-in em { font-style: normal; color: var(--ink-2); width: 34px; font-size: 15px; }
.pace { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.pace-b { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow), inset 0 0 0 2px transparent; transition: box-shadow .25s; }
.pace-b.on { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.pace-b b { display: block; font-weight: 600; font-size: 15px; }
.pace-b small { font-size: 13px; color: var(--ink-2); }
.res-hero { text-align: center; padding: 8px 0 20px; }
.res-num { font: 700 72px/1 var(--font-d); letter-spacing: -.045em; margin: 10px 0 4px; }
.res-unit { color: var(--ink-2); margin-bottom: 14px; }
.res-hero .ob-p { max-width: 420px; margin: 0 auto; }

/* ---------- план / профиль ---------- */
.plan-hero { text-align: center; padding: 4px 0 2px; }
.plan-hero .lbl { display: block; font-size: 13px; color: var(--ink-2); }
.plan-hero b { display: block; font: 700 54px/1 var(--font-d); letter-spacing: -.04em; margin: 8px 0 4px; }
.plan-macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 10px; }
.pm { background: var(--fill); border-radius: 14px; padding: 12px 8px; text-align: center; }
.pm span { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.pm b { display: block; font: 700 20px/1.25 var(--font-d); margin-top: 4px; }
.pm small { font-size: 11.5px; color: var(--ink-2); }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15.5px; }
.kv:first-child, .plan-macros + .kv { border-top: 0; }
.kv span { color: var(--ink-2); }
.kv b { font-weight: 500; text-align: right; }
.note { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink-2); background: var(--fill); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.note .i { width: 18px; height: 18px; color: var(--accent); margin-top: 1px; }
.install { display: flex; gap: 14px; align-items: flex-start; }
.install .i { color: var(--accent); margin-top: 2px; }
.install b { display: block; }
.install small { font-size: 14px; color: var(--ink-2); }

details summary { cursor: pointer; list-style: none; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .25s var(--ease); margin-right: 4px; flex: none; }
details[open] summary::after { transform: rotate(-135deg); }
.how-body { margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.how-body p { margin-bottom: 10px; }
.how-body b { color: var(--ink); font-weight: 600; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--fill); padding: 10px 12px; border-radius: 10px; color: var(--ink); margin: 6px 0 12px; line-height: 1.7; }
.steps-ol { padding-left: 20px; margin-bottom: 14px; }
.steps-ol li { margin-bottom: 7px; }
.sub-det { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.sub-det summary { font-size: 15px; color: var(--accent); }

.health > .hint { margin-bottom: 12px; }
.hc-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.hc-row div { flex: 1; min-width: 0; }
.hc-row b { display: block; font-weight: 600; font-size: 15.5px; }
.hc-row small { font-size: 13px; color: var(--ink-2); }

.tgl { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; position: relative; }
.card > .tgl:first-child { border-top: 0; }
.tgl > span { flex: 1; }
.tgl b { display: block; font-weight: 500; font-size: 16px; }
.tgl small { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.tgl input { position: absolute; opacity: 0; pointer-events: none; }
.tgl i { width: 51px; height: 31px; border-radius: 16px; background: var(--fill-2); position: relative; flex: none; transition: background .25s; }
.tgl i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .3s var(--spring); }
.tgl input:checked + i { background: var(--accent); }
.tgl input:checked + i::after { transform: translateX(20px); }
.tgl input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 12px; }
.set-row + .set-row { border-top: 1px solid var(--line); padding-top: 12px; }
.set-row > span { font-weight: 500; }
.data { padding: 6px 18px; }
.row-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 0; border-top: 1px solid var(--line); font-size: 16px; cursor: pointer; position: relative; }
.row-btn:first-child { border-top: 0; }
.row-btn .i { color: var(--accent); width: 20px; height: 20px; }
.row-btn.danger, .row-btn.danger .i { color: #c0392b; }

/* ---------- прогресс ---------- */
.hero-fig { text-align: center; padding: 22px 18px; }
.hero-fig .lbl { font-size: 13px; color: var(--ink-2); }
.hero-fig b { display: block; font: 700 54px/1.05 var(--font-d); letter-spacing: -.04em; margin: 6px 0; }
.hero-fig .sub { font-size: 15px; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tile { background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.tile > span { display: block; font-size: 13px; color: var(--ink-2); }
.tile b { display: block; font: 700 23px/1.2 var(--font-d); letter-spacing: -.02em; margin: 4px 0 1px; }
.tile small { font-size: 13px; color: var(--ink-2); }
.tile small.good { color: var(--good); }
.tile small.warnc { color: var(--warn); }
.chart-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); display: inline-block; }
.lg-dot.soft { opacity: .5; }
.lg-line { width: 16px; height: 2px; background: var(--accent); border-radius: 1px; display: inline-block; }
.lg-dash { width: 16px; height: 0; border-top: 1.5px dashed var(--ink-2); display: inline-block; }
.chart-host { position: relative; margin-top: 8px; min-height: 200px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; font-family: var(--font); }
.chart .tick.strong { fill: var(--ink); font-weight: 600; }
.chart .ref { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .ref-lbl { fill: var(--ink-2); font-size: 11px; font-weight: 500; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: .08; }
.chart .dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart .dot.soft { fill-opacity: .45; }
.chart .bar { fill: var(--accent); transition: opacity .15s; }
.chart .bar.dim { opacity: .35; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; }
.chart .hdot { fill: var(--accent); stroke: var(--card); stroke-width: 2.5; }
.chart .end-lbl { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart-empty { display: grid; place-items: center; min-height: 180px; color: var(--ink-3); font-size: 14px; text-align: center; }
.tip { position: absolute; top: 4px; transform: translate(-50%, -100%); background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.35; padding: 7px 10px; border-radius: 10px; pointer-events: none; white-space: nowrap; z-index: 3; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); text-align: center; }
.tip b { font-weight: 700; }
.segbar { display: flex; gap: 2px; height: 8px; margin: 14px 0 4px; }
.segbar i { border-radius: 4px; background: var(--c); display: block; }
.streak { display: flex; align-items: center; gap: 14px; }
.streak > .i { width: 30px; height: 30px; color: var(--accent); }
.streak b { display: block; }
.streak small { font-size: 13.5px; color: var(--ink-2); }
.rows { list-style: none; }
.rows li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.rows li:first-child { border-top: 0; }
.rows li > span { flex: 1; color: var(--ink-2); }
.rows li > b { font-weight: 600; font-variant-numeric: tabular-nums; }
.rows li > small { min-width: 76px; text-align: right; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rows li.wrap > span { flex: none; min-width: 90px; }
.rows li .grow { flex: 1; text-align: left; min-width: 0; }
.empty-card { text-align: center; padding: 28px 22px; }
.empty-card > .i { width: 34px; height: 34px; color: var(--accent); margin-bottom: 8px; }
.empty-card h3 { margin-bottom: 6px; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pcell { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--fill); }
.pcell img { width: 100%; height: 100%; object-fit: cover; }
.pcell span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, .45); padding: 2px 7px; border-radius: 8px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compare img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; background: var(--fill); }
.compare figcaption { font-size: 13px; color: var(--ink-2); text-align: center; margin-top: 6px; }

/* ---------- тренировки ---------- */
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 16px 10px 12px; }
.stats3 > div b { display: block; font: 700 26px/1.15 var(--font-d); letter-spacing: -.02em; }
.stats3 > div span { font-size: 13px; color: var(--ink-2); }
.stats3 .cap { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.wcard { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--card); border-radius: 20px; padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); transition: transform .15s var(--ease); }
.wcard:active { transform: scale(.985); }
.wc-art { width: 52px; height: 52px; border-radius: 15px; background: var(--brand); color: var(--cream); display: grid; place-items: center; flex: none; }
.wc-art .i { width: 24px; height: 24px; }
.wc-m { flex: 1; min-width: 0; }
.wc-m b { display: block; font-weight: 600; }
.wc-m small { font-size: 13.5px; color: var(--ink-2); }
.lead { font-size: 16px; color: var(--ink-2); margin-bottom: 14px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tags span { font-size: 13px; font-weight: 500; background: var(--card); padding: 5px 11px; border-radius: 10px; }
.exlist { list-style: none; counter-reset: ex; background: var(--card); border-radius: 18px; padding: 4px 16px; margin-bottom: 16px; }
.exlist li { counter-increment: ex; display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.exlist li:first-child { border-top: 0; }
.exlist li::before { content: counter(ex); width: 24px; height: 24px; border-radius: 50%; background: var(--fill); font-size: 12px; font-weight: 600; display: grid; place-items: center; flex: none; margin-top: 1px; }
.exlist li div { flex: 1; }
.exlist b { display: block; font-weight: 500; }
.exlist small { font-size: 13px; color: var(--ink-2); }
.exlist li > span { font-size: 14px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* плеер */
.player { position: fixed; inset: 0; z-index: 60; background: #1a140f; color: var(--cream); display: flex; flex-direction: column; padding: calc(var(--safe-t) + 14px) 20px calc(var(--safe-b) + 26px); animation: fadeIn .3s; }
.player .icon-btn { background: rgba(243, 237, 227, .1); color: var(--cream); }
.pl-top { display: flex; align-items: center; gap: 14px; max-width: 600px; width: 100%; margin: 0 auto; }
.pl-prog { flex: 1; height: 4px; border-radius: 2px; background: rgba(243, 237, 227, .14); overflow: hidden; }
.pl-prog i { display: block; height: 100%; background: var(--cream); transition: width .4s var(--ease); }
.pl-cnt { font-variant-numeric: tabular-nums; font-size: 15px; opacity: .7; min-width: 44px; text-align: right; }
.pl-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.pl-phase { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; opacity: .55; }
.pl-name { font-size: 30px; line-height: 1.15; max-width: 440px; }
.pl-ring { position: relative; width: min(240px, 60vw); aspect-ratio: 1; margin: 18px 0 10px; }
.pl-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pl-ring .tr { fill: none; stroke: rgba(243, 237, 227, .12); stroke-width: 6; }
.pl-ring .fl { fill: none; stroke: var(--cream); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .2s linear; }
.pl-main.rest .pl-ring .fl { stroke: #9cc3ab; }
.pl-main.rest .pl-name { opacity: .85; }
.pl-time { position: absolute; inset: 0; display: grid; place-items: center; font: 700 64px/1 var(--font-d); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.pl-reps { font: 700 40px/1.15 var(--font-d); margin: 34px 0 18px; letter-spacing: -.02em; }
.pl-cue { max-width: 360px; opacity: .7; font-size: 16px; }
.pl-next { text-align: center; opacity: .55; font-size: 15px; min-height: 22px; margin-bottom: 20px; }
.pl-ctrl { display: flex; align-items: center; justify-content: center; gap: 30px; }
.icon-btn.lg { width: 56px; height: 56px; }
.pl-play { width: 78px; height: 78px; border-radius: 50%; background: var(--cream); color: #1a140f; display: grid; place-items: center; transition: transform .15s var(--spring); }
.pl-play:active { transform: scale(.92); }
.pl-play .i { width: 32px; height: 32px; }
.pl-done { margin: auto; width: 100%; max-width: 380px; text-align: center; animation: rise .6s var(--ease); }
.pl-check { width: 76px; height: 76px; border-radius: 50%; background: var(--cream); color: #1a140f; display: grid; place-items: center; margin: 0 auto 20px; }
.pl-check .i { width: 36px; height: 36px; stroke-width: 2.4; }
.pl-done p { opacity: .6; margin-top: 4px; }
.pl-stats { display: flex; justify-content: center; gap: 46px; margin: 30px 0 36px; }
.pl-stats b { display: block; font: 700 44px/1 var(--font-d); letter-spacing: -.03em; }
.pl-stats span { font-size: 14px; opacity: .6; }

/* ---------- шапка: аватар профиля, навигация по дням ---------- */
.top-r { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn.sm2 { width: 36px; height: 36px; }
.icon-btn.sm2 .i { width: 20px; height: 20px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; transition: transform .15s var(--spring); }
.avatar:active { transform: scale(.92); }
.avatar .i { width: 20px; height: 20px; }
.eyebrow.link { display: block; cursor: pointer; padding: 0; }

/* ---------- быстрое добавление еды ---------- */
.qa { padding: 14px; }
.qa-row { display: flex; gap: 8px; align-items: stretch; }
.qa-row #qa-name { flex: 1; min-width: 0; }
.qa-k { position: relative; width: 108px; flex: none; }
.qa-k input { padding-right: 44px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.qa-k span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--ink-2); pointer-events: none; }
.qa-k input.bump { animation: bump .35s var(--spring); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.qa-plus { width: 50px; height: 50px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; transition: transform .15s var(--spring); }
.qa-plus:active { transform: scale(.88); }
.qa-plus .i { width: 26px; height: 26px; stroke-width: 2.4; }
.qa-tools { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.qa-tools .chips { flex: 1; flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; }
.qa-tools .chips::-webkit-scrollbar { display: none; }
.qa-tools .chip { flex: none; font-variant-numeric: tabular-nums; }
.qa-tools .icon-btn { width: 34px; height: 34px; }
.qa-tools .icon-btn .i { width: 18px; height: 18px; }
.qa-sug { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.qa-sug:empty { display: none; }
.sug { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border-radius: 17px; background: var(--fill); font-size: 14px; max-width: 100%; }
.sug span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug em { font-style: normal; color: var(--ink-2); font-size: 12px; }
.sug b { font-weight: 600; font-variant-numeric: tabular-nums; }
.quick3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick3 .tile-btn { flex-direction: column; gap: 4px; min-height: 68px; font-size: 13.5px; }

/* ---------- план тренировок ---------- */
.sec-h2 { margin: 6px 4px 10px; }
.sec-h2 h3 { font-size: 20px; }
.link-sm { color: var(--accent); font-size: 15px; font-weight: 500; }
.pweek { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 12px; }
.pday { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 3px 9px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1.5px transparent; min-width: 0; text-align: center; }
.pday.today { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.pd-w { font-size: 11px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; }
.pd-d { font-size: 16px; font-weight: 700; font-family: var(--font-d); }
.pd-t { font-size: 10px; line-height: 1.2; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 24px; word-break: break-word; }
.pday.rest .pd-t { color: var(--ink-3); }
.pd-ok { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; }
.pd-ok .i { width: 10px; height: 10px; stroke-width: 3; }
.plan-today { display: flex; align-items: center; gap: 14px; }
.plan-today .pt-m { flex: 1; min-width: 0; }
.plan-today .lbl { display: block; font-size: 12.5px; color: var(--ink-2); }
.plan-today b { display: block; font-size: 17px; font-weight: 600; }
.plan-today small { display: block; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--brand); color: var(--cream); display: grid; place-items: center; flex: none; }
.pt-ic .i { width: 22px; height: 22px; }
.done-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--good); flex: none; }
.done-tag .i { width: 18px; height: 18px; stroke-width: 2.4; }
.plan-next { margin: -4px 6px 6px; }
.plan-next b { color: var(--ink); font-weight: 600; }
.plan-empty { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.plan-empty > div { flex: 1; min-width: 180px; }
.plan-empty b { display: block; font-weight: 600; }
.plan-empty small { display: block; font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.note.last { margin: 4px 0 6px; }
.note.last b { color: var(--ink); }
.note-text { font-size: 15px; line-height: 1.6; margin-bottom: 12px; }

/* ---------- рецепты ---------- */
.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 2px; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x .chip { flex: none; }
.rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rcard { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; background: var(--card); border-radius: 20px; padding: 10px 10px 14px; box-shadow: var(--shadow); transition: transform .15s var(--ease); min-width: 0; }
.rcard:active { transform: scale(.98); }
.rc-art { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 14px; display: grid; place-items: center; margin-bottom: 6px; background: var(--fill); color: var(--accent); }
.rc-art .i { width: 36px; height: 36px; stroke-width: 1.4; }
.rc-art em { position: absolute; left: 8px; bottom: 8px; font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink); background: var(--card); padding: 2px 8px; border-radius: 8px; }
.rc-air { background: color-mix(in srgb, var(--fat) 13%, var(--card)); color: var(--fat); }
.rc-main { background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.rc-breakfast { background: color-mix(in srgb, var(--carb) 12%, var(--card)); color: var(--carb); }
.rc-raw, .rc-snack { background: color-mix(in srgb, var(--good) 12%, var(--card)); color: var(--good); }
.rcard b { font-size: 15px; font-weight: 600; line-height: 1.25; padding: 0 2px; }
.rcard small { font-size: 12.5px; color: var(--ink-2); padding: 0 2px; }
.sh { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 20px 4px 8px; font-weight: 600; }
.ing { list-style: none; background: var(--card); border-radius: 18px; padding: 2px 16px; }
.ing li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.ing li:first-child { border-top: 0; }
.ing li b { font-weight: 500; }
.ing li span { color: var(--ink-2); text-align: right; font-size: 14px; }
.exlist.steps li div { font-size: 15px; line-height: 1.5; }
.tags span { display: inline-flex; align-items: center; gap: 4px; }
.tags span .i { width: 15px; height: 15px; }

/* ---------- штрих-код ---------- */
.scan { position: relative; border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%; border: 2px solid rgba(255, 255, 255, .9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.scan-msg { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; color: #fff; font-size: 14px; font-weight: 500; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); padding: 0 16px; }
.scan.off { aspect-ratio: auto; min-height: 90px; background: var(--fill); }
.scan.off video, .scan.off .scan-frame { display: none; }
.scan.off .scan-msg { position: static; color: var(--ink-2); text-shadow: none; padding: 30px 16px; }
.bc-row { display: flex; gap: 8px; }
.bc-row input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.bc-img { display: block; max-height: 140px; max-width: 60%; margin: 0 auto 8px; border-radius: 12px; object-fit: contain; background: #fff; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid4 input { padding: 13px 8px; text-align: center; }
.loading-box { text-align: center; padding: 48px 0; color: var(--ink-2); }
.spinner { display: inline-block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--fill-2); border-top-color: var(--accent); animation: spin .8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- знак NYORA Health: лента N ---------- */
.hmark-wrap { position: relative; display: block; width: min(170px, 46vw); margin: 0 auto 30px; }
.hmark-img { display: block; width: 100%; height: auto; opacity: 0; animation: ribbonIn 1.3s var(--ease) .1s forwards; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .35)); }
.hmark-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .85) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat;
  -webkit-mask: url(assets/health-mark.png) center / 100% 100% no-repeat; mask: url(assets/health-mark.png) center / 100% 100% no-repeat;
  animation: shine 4.5s ease-in-out 1.6s infinite; opacity: .55; }
@keyframes ribbonIn { 0% { opacity: 0; transform: translateX(-26px) skewX(-10deg) scale(.94); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes shine { 0% { background-position: -150% 0; } 45%, 100% { background-position: 150% 0; } }
.auth-icon { width: 72px; height: 72px; border-radius: 20px; box-shadow: 0 12px 28px rgba(142, 42, 58, .32); animation: pop .6s var(--spring); }

/* ---------- прежний знак (не используется) ---------- */
.hmark { width: 92px; height: 92px; margin-bottom: 26px; overflow: visible; }
.hmark path { fill: none; stroke: var(--cream); stroke-linecap: round; stroke-linejoin: round; }
.hm-n { stroke-width: 8.5; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; animation: draw 1.3s var(--ease) .15s forwards; }
.hm-speed { stroke-width: 7; opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1; animation: speed 1s var(--ease) 1.05s forwards, dash 2.6s ease-in-out 2.4s infinite; }
@keyframes draw { 0% { opacity: 0; stroke-dashoffset: 1; } 4% { opacity: 1; } 100% { opacity: 1; stroke-dashoffset: 0; } }
@keyframes speed { 0% { opacity: 0; stroke-dashoffset: 1; transform: translateX(10px); } 100% { opacity: .72; stroke-dashoffset: 0; transform: none; } }
@keyframes dash { 0%, 100% { transform: none; opacity: .72; } 50% { transform: translateX(-5px); opacity: .45; } }
.welcome .hmark { animation: none; }
.auth-logo { display: grid; place-items: center; margin: 4px 0 14px; }
.auth-logo .hmark { width: 64px; height: 64px; margin: 0; background: linear-gradient(135deg, #a8384c, #56162a); border-radius: 18px; padding: 10px; box-shadow: 0 10px 24px rgba(142, 42, 58, .28); }
.auth-logo .hm-speed { animation-delay: .6s, 2s; }
.center { text-align: center; }
.ob-h.center, .ob-p.center { text-align: center; }
.auth-msg { min-height: 20px; font-size: 14px; color: #c0392b; margin: 2px 4px 12px; line-height: 1.4; }
.auth-msg.ok { color: var(--good); }
.auth-msg:empty { margin: 0 0 6px; min-height: 0; }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; margin: 0; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }

/* цели: можно выбрать несколько */
.opt.chk .radio { border-radius: 7px; display: grid; place-items: center; color: transparent; }
.opt.chk.on .radio { box-shadow: inset 0 0 0 12px var(--accent); color: #fff; }
.opt.chk .radio .i { width: 15px; height: 15px; stroke-width: 3; }
.goal-mode { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; color: var(--accent); margin: 4px 6px 0; animation: fadeIn .4s var(--ease); }
.goal-mode .i { width: 18px; height: 18px; stroke-width: 2.4; }

/* аккаунт, основатель */
.acct { display: flex; align-items: center; gap: 12px; }
.acct-av { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #a8384c, #56162a); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.acct.guest .acct-av { background: var(--fill); color: var(--ink-2); }
.acct-t { flex: 1; min-width: 0; }
.acct-t b { display: block; font-weight: 600; }
.acct-t small { display: block; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #fff; background: linear-gradient(135deg, #c9973f, #a8742a); padding: 2px 8px; border-radius: 8px; vertical-align: 2px; margin-left: 4px; }
.owner .grow { flex: 1; min-width: 0; }
.owner b { display: block; }
.owner small { display: block; font-size: 13px; color: var(--ink-2); }
.owner .sec-row .icon-btn .i { width: 18px; height: 18px; }
#owner-stats { transition: opacity .2s; }
#owner-stats.busy { opacity: .5; }
.ow-big { text-align: center; margin: 14px 0 12px; }
.ow-big b { display: block; font: 700 52px/1 var(--font-d); letter-spacing: -.03em; color: #c9973f; animation: pop .5s var(--spring); }
.ow-big span { font-size: 14px; color: var(--ink-2); }
.ow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.ow-grid > div { background: var(--fill); border-radius: 12px; padding: 8px 4px; }
.ow-grid b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ow-grid span { display: block; font-size: 11px; line-height: 1.2; color: var(--ink-2); }
.ow-load { text-align: center; padding: 22px 0; color: var(--ink-2); font-size: 14px; }
.ow-err { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 13.5px; color: var(--ink-2); margin: 12px 0 0; }
.ow-err .i { width: 16px; height: 16px; color: #c0392b; flex: none; }

/* темы */
.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px 6px; }
.th { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.th-sw { width: 44px; height: 44px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .08); display: grid; place-items: center; color: var(--accent); transition: transform .2s var(--spring), box-shadow .2s; }
.th.on .th-sw { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--accent); transform: scale(1.04); }
.th-sw .i { width: 20px; height: 20px; stroke-width: 2.6; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2)); }
.th small { font-size: 11.5px; color: var(--ink-2); }

/* о приложении и авторе */
.app-id { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.app-id img { width: 56px; height: 56px; border-radius: 14px; }
.app-id b { display: block; font-size: 18px; font-weight: 700; }
.app-id small { font-size: 13px; color: var(--ink-2); }
.about .row-btn { margin-top: 8px; }
.buro-n { width: 22px; height: 24px; background: currentColor; -webkit-mask: url(assets/nyora-mark.png) center / contain no-repeat; mask: url(assets/nyora-mark.png) center / contain no-repeat; flex: none; }
.row-btn .buro-n { color: var(--ink); }
.about-buro { text-align: center; padding: 10px 0 6px; }
.buro-big { display: inline-grid; place-items: center; width: 86px; height: 86px; border-radius: 22px; background: var(--brand); color: var(--cream); margin-bottom: 14px; }
.buro-big .buro-n { width: 40px; height: 44px; }
.author-name { font-size: 22px; font-weight: 700; font-family: var(--font-d); }
.author-cap { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.by-author { display: inline-flex; align-items: center; gap: 10px; margin: 18px 0 14px; padding: 6px 14px 6px 6px; background: var(--card); border-radius: 26px; font-size: 14px; }
.by-author img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.site-link { background: var(--card); border-radius: 14px; padding: 13px 14px; border-top: 0; }

/* ---------- анимированные фигуры упражнений ---------- */
.fig { width: 100%; height: 100%; display: block; color: var(--ink); }
.fig polyline, .fig path { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.fig-far { opacity: .32; }
.fig-head { fill: currentColor; stroke: none; }
.fig-ground { stroke: currentColor; opacity: .14; stroke-width: 1; }
.fig-eq { fill: var(--fill-2); fill: color-mix(in srgb, currentColor 26%, transparent); }
.fig-eq-l, .fig-eq-w { stroke: var(--fill-2); stroke: color-mix(in srgb, currentColor 26%, transparent); stroke-width: 3; stroke-linecap: round; }
.fig-cable { stroke: var(--ink-3); stroke-width: 1; }
.fig-wt { fill: var(--accent); }
.fig-wt.far { opacity: .4; }
.fig-handle, .fig-platform { stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.exlist.figs { counter-reset: none; padding: 4px 12px; }
.exlist.figs li { align-items: center; cursor: pointer; }
.exlist.figs li::before { display: none; }
.exfig { width: 72px; height: 60px; flex: none; border-radius: 12px; background: var(--fill); overflow: hidden; }
.exlist.figs li > span { white-space: normal; max-width: 92px; text-align: right; font-size: 13.5px; line-height: 1.3; }
.exbig { height: 220px; border-radius: 20px; background: var(--card); margin-bottom: 14px; padding: 8px; }
.pl-fig { width: min(300px, 78vw); height: 170px; color: var(--cream); margin: 4px 0 -6px; }
.pl-fig .fig { color: var(--cream); }
.pl-fig .fig-eq { fill: rgba(243, 237, 227, .22); }
.pl-fig .fig-eq-l, .pl-fig .fig-eq-w { stroke: rgba(243, 237, 227, .22); }
.pl-fig .fig-wt { fill: #e07a8c; }
.pl-fig .fig-handle, .pl-fig .fig-platform { stroke: #e07a8c; }
.pl-fig.next { height: 110px; opacity: .55; order: 5; }
.player .pl-ring { width: min(190px, 48vw); }
.player .pl-time { font-size: 52px; }

/* ---------- пошаговая готовка ---------- */
.cook .ck-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; max-width: 520px; width: 100%; margin: 0 auto; overflow-y: auto; padding: 14px 0; }
.ck-photo { width: 100%; max-height: 34vh; object-fit: cover; border-radius: 22px; box-shadow: 0 12px 34px rgba(0, 0, 0, .35); animation: rise .6s var(--ease); }
.ck-photo.done { max-height: 40vh; }
.ck-ic { width: 96px; height: 96px; border-radius: 28px; background: rgba(243, 237, 227, .1); display: grid; place-items: center; animation: pop .5s var(--spring); }
.ck-ic .i { width: 50px; height: 50px; stroke-width: 1.5; }
.ck-ic.big { width: 120px; height: 120px; }
.ck-text { font-size: 21px; line-height: 1.45; font-weight: 500; max-width: 460px; animation: rise .45s var(--ease); }
.ck-badges { display: flex; gap: 8px; justify-content: center; }
.ck-badges span { display: inline-flex; align-items: center; gap: 6px; background: rgba(243, 237, 227, .12); padding: 7px 12px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.ck-badges .i { width: 16px; height: 16px; }
.ck-timer { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 26px; border-radius: 20px; background: rgba(243, 237, 227, .1); color: var(--cream); margin-top: 6px; }
.ck-timer b { font: 700 40px/1 var(--font-d); font-variant-numeric: tabular-nums; }
.ck-timer small { font-size: 13px; opacity: .7; }
.ck-timer.on { background: rgba(243, 237, 227, .18); }
.ck-timer.ring { background: #c9973f; color: #1a140f; animation: pop .5s var(--spring) 3; }
.ck-ing { list-style: none; width: 100%; text-align: left; background: rgba(243, 237, 227, .07); border-radius: 18px; padding: 4px 16px; }
.ck-ing li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid rgba(243, 237, 227, .1); font-size: 15px; }
.ck-ing li:first-child { border-top: 0; }
.ck-ing span { opacity: .65; text-align: right; }
.ck-end { max-width: 420px; width: 100%; margin: 0 auto; }
.pl-ctrl .btn.cream { max-width: 420px; }
.icon-btn.ghost { background: transparent; }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.06); } 100% { transform: none; } }

/* фото продуктов и шагов */
.ing li { align-items: center; }
.ing-ph { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: none; margin-right: 2px; background: var(--fill); }
.ing li b { flex: 1; }
.ck-sub { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; opacity: .6; margin-top: 6px; }
.ck-ing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.ck-ingc { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; background: rgba(243, 237, 227, .07); border-radius: 14px; padding: 6px 4px 8px; animation: rise .5s var(--ease) both; }
.ck-ingc img, .ck-ingc-ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: grid; place-items: center; background: rgba(243, 237, 227, .08); }
.ck-ingc-ph .i { width: 26px; height: 26px; opacity: .6; }
.ck-ingc b { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.ck-ingc small { font-size: 11px; opacity: .6; line-height: 1.2; }
.ck-step-ph { position: relative; width: 100%; margin: 0; }
.ck-step-ph img { width: 100%; max-height: 30vh; object-fit: cover; border-radius: 22px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); animation: rise .5s var(--ease); }
.ck-ic.sm { position: absolute; left: 12px; bottom: -16px; width: 52px; height: 52px; border-radius: 16px; background: #2b211a; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.ck-ic.sm .i { width: 26px; height: 26px; }
.ck-used { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 18px; }
.ck-used span { display: inline-flex; align-items: center; gap: 6px; background: rgba(243, 237, 227, .1); padding: 4px 10px 4px 4px; border-radius: 16px; font-size: 13px; }
.ck-used img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* рецепты с фото */
.rc-art.photo { padding: 0; overflow: hidden; background: var(--fill); }
.rc-art.photo img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity .5s var(--ease), transform .7s var(--ease); }
.rc-art.photo img.in { opacity: 1; transform: none; }
.rcard:hover .rc-art.photo img.in { transform: scale(1.03); }
.r-hero { margin: 0 0 12px; border-radius: 20px; overflow: hidden; background: var(--fill); position: relative; aspect-ratio: 4 / 3; }
.r-hero img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--ease); }
.r-hero img.in { opacity: 1; }
.r-hero figcaption { position: absolute; right: 8px; bottom: 8px; font-size: 10.5px; color: #fff; background: rgba(0, 0, 0, .45); padding: 2px 8px; border-radius: 8px; }

/* ---------- шаблоны белка ---------- */
.p-hero { text-align: center; padding: 18px; }
.p-hero .lbl { font-size: 13px; color: var(--ink-2); }
.p-hero b { display: block; font: 700 46px/1.1 var(--font-d); letter-spacing: -.03em; color: var(--prot); margin: 4px 0; }
.p-hero small { font-size: 13.5px; color: var(--ink-2); }
.p-total { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 14px 8px; }
.p-total b { display: block; font: 700 24px/1.2 var(--font-d); }
.p-total span { font-size: 12px; color: var(--ink-2); }
.p-meal .k { font-size: 13px; }
.p-g { color: var(--prot); min-width: 44px; text-align: right; }
.tag-x { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; vertical-align: 1px; }
.icon-btn.sm.done, .add-btn.done { color: var(--good); background: transparent; animation: pop .4s var(--spring); }
.p30 li > span { display: flex; align-items: center; gap: 6px; }
.lean { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); padding: 1px 6px; border-radius: 6px; }
.p30 li > b { min-width: 70px; text-align: right; }

/* ---------- добавки ---------- */
.supp-list { padding: 6px 16px; }
.ev { font-size: 9px; letter-spacing: 2px; color: var(--good); flex: none; }
.ev i { font-style: normal; color: var(--fill-2); }
.ev-mid { color: var(--fat); }
.ev-low { color: var(--ink-3); }
.combos h4 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--good); }
.combos h4.apart { color: var(--warn); margin-top: 16px; }
.combos h4 .i { width: 18px; height: 18px; }
.combos ul { list-style: none; }
.combos li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.combos li:first-child { border-top: 0; }
.combos li b { font-weight: 500; }
.combos li span { color: var(--ink-2); font-size: 13px; text-align: right; }
.sp-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.sp-pill { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, #a8384c, #56162a); color: #fff; display: grid; place-items: center; flex: none; }
.sp-pill .i { width: 28px; height: 28px; }
.sp-head b { display: block; font-size: 16px; }
.ev-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 8px; margin-top: 4px; }
.ev-badge.ev-good { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.ev-badge.ev-mid { color: var(--fat); background: color-mix(in srgb, var(--fat) 14%, transparent); }
.ev-badge.ev-low { color: var(--ink-2); background: var(--fill); }
.sp { padding: 4px 16px; }
.sp-row { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.sp-row:first-child { border-top: 0; }
.sp-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.sp-ic .i { width: 16px; height: 16px; }
.sp-row b { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.sp-row p { font-size: 15px; line-height: 1.5; margin-top: 2px; }
.note.warn .i { color: var(--warn); }

/* ---------- мои шаблоны ---------- */
.tpl-row { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; scrollbar-width: none; padding-bottom: 2px; }
.tpl-row::-webkit-scrollbar { display: none; }
.tpl { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; padding: 0 12px; border-radius: 18px; background: var(--accent-soft); color: var(--ink); font-size: 14px; transition: transform .15s var(--spring); }
.tpl:active { transform: scale(.94); }
.tpl .i { width: 15px; height: 15px; color: var(--accent); fill: var(--accent); stroke: none; }
.tpl span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl b { font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.tc-chk { display: grid; place-items: center; width: 44px; height: 44px; flex: none; cursor: pointer; }
.tc-chk input { position: absolute; opacity: 0; }
.tc-chk span { width: 24px; height: 24px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--ink-3); transition: box-shadow .2s; }
.tc-chk input:checked + span { box-shadow: inset 0 0 0 12px var(--accent); }

/* ---------- каталог тренажёров ---------- */
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mcard { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; background: var(--card); border-radius: 18px; padding: 8px 10px 12px; box-shadow: var(--shadow); text-align: left; min-width: 0; }
.mfig { width: 100%; height: 96px; border-radius: 12px; background: var(--fill); margin-bottom: 6px; overflow: hidden; }
.mcard b { font-size: 14px; font-weight: 600; line-height: 1.25; }
.mcard small { font-size: 12.5px; color: var(--ink-2); }
.fig-eq-pad { stroke: var(--fill-2); stroke: color-mix(in srgb, currentColor 26%, transparent); stroke-width: 6; stroke-linecap: round; }

/* ---------- общие анимации ---------- */
#app.enter > * { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.sheet-body.swap { animation: fadeIn .3s var(--ease); }
.tab.on .i { animation: pop .4s var(--spring); }
.ring-fill { transition: stroke-dashoffset 1.1s var(--ease); }
.mbar i { transition: width 1s var(--ease); }
.res-num { animation: pop .6s var(--spring); }
.wcard, .rcard, .menu-i, .res, .item, .opt, .pace-b, .chip, .glass { transition: transform .18s var(--ease), background .2s, box-shadow .25s, color .2s; }
.wcard:active, .menu-i:active, .item:active, .opt:active { transform: scale(.985); }
.qa-plus:active { transform: scale(.86) rotate(90deg); }
.mb { margin-bottom: 12px; }

/* ---------- уведомление ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px);
  transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bg);
  padding: 11px 18px; border-radius: 22px; font-size: 15px; font-weight: 500; z-index: 90;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  width: max-content; max-width: calc(100vw - 32px); text-align: center; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- широкие экраны ---------- */
@media (min-width: 700px) {
  #app { padding-top: calc(var(--safe-t) + 26px); }
  .sheet { bottom: 50%; transform: translateY(calc(50% + 40px)); opacity: 0; border-radius: 26px; transition: transform .42s var(--ease), opacity .3s; max-height: 86vh; }
  .sheet.open { transform: translateY(50%); opacity: 1; }
  .sheet.tall { height: 86vh; }
  .grab { display: none; }
}
@media (max-width: 360px) {
  h1 { font-size: 30px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .eq-i { min-width: 58px; }
}
/* ---------- фотографии: продукты, спорт, добавки, шаги рецептов ---------- */
.thumb.pic, .thumb.mosaic { overflow: hidden; padding: 0; position: relative; }
.thumb.pic img, .thumb.mosaic img, .p-art img, .wc-art.photo img, .pt-ic.photo img, .tpl-st img {
  width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0;
  opacity: 0; transform: scale(1.06); transition: opacity .45s var(--ease), transform .7s var(--ease);
}
.thumb.pic img.in, .thumb.mosaic img.in, .p-art img.in, .wc-art.photo img.in, .pt-ic.photo img.in, .tpl-st img.in { opacity: 1; transform: none; }
img.broken { visibility: hidden; }
.thumb.sm { width: 40px; height: 40px; border-radius: 11px; font-size: 15px; }
.thumb.mosaic { display: grid; gap: 1.5px; background: var(--card); }
.thumb.mosaic.n2 { grid-template-columns: 1fr 1fr; }
.thumb.mosaic.n3, .thumb.mosaic.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.thumb.mosaic.n3 img:first-child { grid-row: span 2; }
.items .tc-chk + .thumb { margin-right: -2px; }

/* подсказки быстрого добавления и шаблоны */
.sug-ph { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; margin-left: -8px; }
.tpl.has-ph { padding-left: 5px; }
.tpl-st { display: inline-flex; flex: none; }
.tpl-st img { width: 27px; height: 27px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card); }
.tpl-st img + img { margin-left: -9px; }

/* белок: обложка приёма из фото продуктов */
.p-art { display: grid; gap: 2px; height: 104px; margin: -18px -18px 14px; border-radius: var(--r) var(--r) 0 0; overflow: hidden; background: var(--fill); }
.p-art.n2 { grid-template-columns: 1fr 1fr; }
.p-art.n3 { grid-template-columns: 1.3fr 1fr 1fr; }
.p-art.n4 { grid-template-columns: repeat(4, 1fr); }
.p30-ph { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; flex: none; }
.p30 li > span em { font-style: normal; }

/* активность: сетка видов спорта с фото */
.agrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.acard { position: relative; display: block; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--fill); text-align: left; transition: transform .18s var(--ease), box-shadow .25s; }
.acard:active { transform: scale(.96); }
.acard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08); transition: opacity .45s var(--ease), transform .8s var(--ease); }
.acard img.in { opacity: 1; transform: none; }
.acard::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0) 58%); }
.acard b { position: absolute; left: 8px; right: 8px; bottom: 7px; z-index: 1; color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.acard-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); }
.acard.on { box-shadow: 0 0 0 3px var(--accent); }
.acard-ok { position: absolute; top: 6px; right: 6px; z-index: 1; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; transform: scale(0); transition: transform .25s var(--spring); }
.acard.on .acard-ok { transform: scale(1); }
.acard-ok .i { width: 13px; height: 13px; stroke-width: 3; }

/* программы тренировок и план дня */
.wcard.ph { padding: 10px 14px 10px 10px; }
.wc-art.photo { width: 88px; height: 66px; border-radius: 14px; overflow: hidden; position: relative; background: var(--fill); }
.wc-art.photo i { position: absolute; left: 5px; bottom: 5px; width: 24px; height: 24px; border-radius: 8px; background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; display: grid; place-items: center; }
.wc-art.photo i .i { width: 14px; height: 14px; }
.w-hero { aspect-ratio: 16 / 9; }
.pt-ic.photo { overflow: hidden; background: var(--fill); width: 54px; height: 54px; border-radius: 15px; }

/* рецепт: картинка у каждого шага */
.exlist.steps li { align-items: flex-start; }
.st-ph { position: relative; width: 64px; height: 64px; flex: none; }
.st-ph > img:first-child { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; display: block; background: var(--fill); }
.st-mini { position: absolute; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--card); right: -7px; bottom: -6px; }
.st-mini.m1 { bottom: auto; top: -6px; }

/* пошаговая готовка: продукты крупно, в кружке — действие */
.ck-stage { position: relative; width: 100%; margin: 0; height: 30vh; min-height: 170px; max-height: 300px; }
.ck-grid { display: grid; gap: 4px; height: 100%; border-radius: 22px; overflow: hidden; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.ck-grid.n2 { grid-template-columns: 1fr 1fr; }
.ck-grid.n3 { grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; }
.ck-grid.n3 img:first-child { grid-row: span 2; }
.ck-grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.ck-grid img { width: 100%; height: 100%; min-height: 0; object-fit: cover; animation: rise .5s var(--ease) both; }
.ck-grid img:nth-child(2) { animation-delay: .07s; }
.ck-grid img:nth-child(3) { animation-delay: .14s; }
.ck-grid img:nth-child(4) { animation-delay: .21s; }
.ck-inset { position: absolute; right: 12px; bottom: -20px; width: 86px; height: 86px; border-radius: 50%; overflow: hidden; border: 3px solid #1a140f; box-shadow: 0 8px 20px rgba(0, 0, 0, .45); animation: pop .5s var(--spring) .25s both; }
.ck-inset img { width: 100%; height: 100%; object-fit: cover; }
.ck-stage .ck-ic.sm { z-index: 1; }

/* рецепты: способы приготовления, заготовка впрок, хранение */
.rc-ms { position: absolute; right: 8px; top: 8px; display: flex; gap: 3px; z-index: 1; }
.rc-ms .i { width: 22px; height: 22px; padding: 4px; border-radius: 7px; background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; stroke-width: 1.8; }
.sh-sm { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 4px 2px 8px; }
.seg.meth button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 8px; min-height: 64px; line-height: 1.15; }
.seg.meth .i { width: 21px; height: 21px; }
.seg.meth span { font-size: 14px; font-weight: 600; }
.seg.meth small { font-size: 11.5px; opacity: .7; font-variant-numeric: tabular-nums; }
.tags i { font-style: normal; }
.st-card { overflow: hidden; }
.st-hero { margin: -4px -4px 12px; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 7; background: var(--fill); }
.st-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.st-kpis > div { background: var(--fill); border-radius: 14px; padding: 10px 12px; }
.st-kpis span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.st-kpis span .i { width: 16px; height: 16px; color: var(--accent); }
.st-kpis b { display: block; font-size: 16px; font-weight: 600; margin-top: 2px; }
.st-plan { margin: 0 0 10px; }
.st-plan b { font-weight: 600; }
.st-rules { list-style: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.st-rules li { position: relative; padding-left: 16px; margin-top: 5px; }
.st-rules li::before { content: ''; position: absolute; left: 3px; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.ck-meth { display: inline-flex; align-items: center; gap: 6px; background: rgba(243, 237, 227, .12); padding: 6px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.ck-meth .i { width: 17px; height: 17px; }
.ck-store { width: 100%; max-width: 420px; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; background: rgba(243, 237, 227, .07); border-radius: 18px; padding: 12px 14px; font-size: 14px; }
.ck-store b { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; }
.ck-store span { display: inline-flex; align-items: center; gap: 5px; opacity: .85; }
.ck-store .i { width: 16px; height: 16px; }
.ck-store p { width: 100%; font-size: 13px; opacity: .7; line-height: 1.4; text-align: center; }

/* выбор языка */
.lang-pick .lp-h { display: flex; flex-direction: column; gap: 2px; margin: 18px 0 16px; }
.lang-pick .lp-h span { font-size: 15px; opacity: .72; }
.lang-pick .lp-h span:first-child { font: 600 20px/1.3 var(--font-d); opacity: 1; }
.lp-list { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; margin: 0 auto; }
.lp-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 18px; background: rgba(243, 237, 227, .1); color: var(--cream, #f3ede3); border: 1px solid rgba(243, 237, 227, .16); transition: transform .15s var(--ease), background .2s; animation: rise .5s var(--ease) both; animation-delay: var(--d, 0ms); }
.lp-opt:active { transform: scale(.98); background: rgba(243, 237, 227, .18); }
.lp-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lp-opt b { font: 600 19px/1.2 var(--font-d); }
.lp-opt small { font-size: 12.5px; opacity: .6; }
.lp-opt .i { width: 18px; height: 18px; opacity: .6; }
.lp-change { display: inline-flex; align-items: center; gap: 4px; margin-top: 14px; font-size: 13.5px; color: inherit; opacity: .7; padding: 6px 10px; border-radius: 12px; }
.lp-change .i { width: 14px; height: 14px; }
.lang-seg { margin-bottom: 18px; }

/* авторы фото */
.credits { font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
.credits a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
button.row-btn { text-align: left; color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
