:root {
  --ac: #e4572e; --ac-s: rgba(228, 87, 46, .12); --ac2: #12968a; --ac2-s: rgba(18, 150, 138, .12);
  --bg: #f2f2f7; --card: #fff; --card2: #f7f7fa; --tx: #111; --tx2: #6c6c72; --tx3: #a1a1a8;
  --sep: rgba(60, 60, 67, .14); --fig: #d9d9df; --ok: #2f9e55; --warn: #d98a00; --bad: #d64545;
  --r: 16px; --nav: 62px; --navb: max(10px, calc(var(--sb) - 12px)); --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ac-s: rgba(228, 87, 46, .2); --ac2: #2bb3a5; --ac2-s: rgba(43, 179, 165, .18);
    --bg: #000; --card: #1c1c1e; --card2: #2a2a2d; --tx: #f2f2f2; --tx2: #9a9aa0; --tx3: #66666c;
    --sep: rgba(255, 255, 255, .12); --fig: #3a3a3e;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--tx); }
body { font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
/* Прокручивается не страница, а #app: на iPhone «Домой» фиксированные панели больше не уезжают */
#app { position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
/* шапка под часами: появляется плавно, когда контент уезжает под неё; край мягкий, без полосы */
#statusbar { position: fixed; left: 0; right: 0; top: 0; height: calc(var(--st) + 22px); z-index: 25; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: linear-gradient(to bottom, rgba(242, 242, 247, .78) 0, rgba(242, 242, 247, .55) var(--st), rgba(242, 242, 247, 0) 100%);
  -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 var(--st), transparent 100%); mask-image: linear-gradient(to bottom, #000 0, #000 var(--st), transparent 100%); }
#statusbar.on { opacity: 1; }
@media (prefers-color-scheme: dark) { #statusbar { background: linear-gradient(to bottom, rgba(0, 0, 0, .75) 0, rgba(0, 0, 0, .5) var(--st), rgba(0, 0, 0, 0) 100%); } }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
a { color: var(--ac); text-decoration: none; }
svg { display: block; }
.tab { padding: calc(var(--st) + 12px) 16px calc(var(--nav) + var(--navb) + 28px); max-width: 560px; margin: 0 auto; }
.tab.has-timer { padding-bottom: calc(var(--nav) + var(--navb) + 96px); }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 2px 14px; }
.top h1 { font-size: 32px; line-height: 1.1; margin: 0; letter-spacing: -.02em; }
.top .sub { color: var(--tx2); font-size: 14px; margin-bottom: 2px; }
h2 { font-size: 20px; margin: 26px 2px 10px; letter-spacing: -.01em; }
h2 small { font-size: 14px; color: var(--tx2); font-weight: 500; margin-left: 6px; }
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.muted { color: var(--tx2); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.sp { flex: 1; }
.num { font-variant-numeric: tabular-nums; }

/* кнопки */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px; border-radius: 14px; background: var(--ac); color: #fff; font-weight: 600; font-size: 17px; width: 100%; }
.btn:active { opacity: .8; transform: scale(.99); }
.btn.sec { background: var(--ac-s); color: var(--ac); }
.btn.ghost { background: var(--card2); color: var(--tx); }
.btn.teal { background: var(--ac2); }
.btn.sm { min-height: 40px; font-size: 15px; border-radius: 12px; width: auto; }
.btn[disabled] { opacity: .4; }
.link { color: var(--ac); font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }
.seg { display: flex; background: var(--card2); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; min-height: 38px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--tx2); }
.seg button.on { background: var(--card); color: var(--tx); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.chips.week .chip { min-width: 0; padding: 0; }
.chip { min-width: 44px; min-height: 40px; padding: 0 10px; border-radius: 12px; background: var(--card2); font-weight: 600; font-size: 15px; color: var(--tx2); }
.chip.on { background: var(--ac); color: #fff; }
.chip.on.teal { background: var(--ac2); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; background: var(--ac-s); color: var(--ac); }
.badge.teal { background: var(--ac2-s); color: var(--ac2); }
.badge.gray { background: var(--card2); color: var(--tx2); }

/* герой */
.hero { padding: 18px 16px 16px; display: block; width: 100%; text-align: left; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.hero:active { transform: scale(.985); }
.hero-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.wpill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--card2); color: var(--tx2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wpill.add { background: var(--ac); color: #fff; padding-left: 9px; }
.wpill svg { width: 16px; height: 16px; stroke-width: 2.6; }
.hero .big { font-size: 46px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.hero .big small { font-size: 20px; font-weight: 600; color: var(--tx2); margin-left: 4px; letter-spacing: 0; }
.delta { font-weight: 600; font-size: 15px; }
.delta.good { color: var(--ok); } .delta.bad { color: var(--bad); }
.bar { height: 10px; border-radius: 5px; background: var(--card2); overflow: hidden; margin: 14px 0 6px; }
.bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--ac), #f08a4b); min-width: 4px; }
.bar.teal i { background: var(--ac2); }
.bar.thin { height: 6px; margin: 10px 0 0; }
.barlbl { display: flex; justify-content: space-between; font-size: 13px; color: var(--tx2); }

/* карусель */
.carousel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.wcard { flex: 0 0 74%; max-width: 300px; scroll-snap-align: start; scroll-margin-left: 16px; background: var(--card); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.wcard .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ac-s); color: var(--ac); margin-bottom: 4px; }
.wcard .ic.teal { background: var(--ac2-s); color: var(--ac2); }
.wcard .ic svg { width: 20px; height: 20px; }
.wcard b { font-size: 17px; }
.wcard .eta { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--tx2); }

/* план дня */
.dayplan { display: flex; gap: 12px; align-items: flex-start; }
.dayplan .ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: var(--ac2-s); color: var(--ac2); display: grid; place-items: center; }
.dayplan .ic svg { width: 24px; height: 24px; }
.list { margin: 8px 0 0; padding: 0; list-style: none; }
.list li { padding: 9px 0; border-top: 1px solid var(--sep); display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.list li:first-child { border-top: 0; }
.list li .d { flex: 0 0 64px; color: var(--tx2); font-weight: 600; font-size: 14px; }

/* плитки */
.datebar { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 8px; }
.datebar h2 { margin: 0 2px; }
.arrows { display: flex; gap: 4px; }
.arrows button { width: 40px; height: 36px; border-radius: 10px; background: var(--card); display: grid; place-items: center; color: var(--ac); }
.arrows button[disabled] { color: var(--tx3); }
.arrows svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border-radius: var(--r); padding: 13px 14px 12px; text-align: left; min-height: 108px; display: flex; flex-direction: column; gap: 2px; }
.tile:active { transform: scale(.98); }
.tile .lbl { font-size: 14px; color: var(--tx2); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.tile .val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; }
.tile .val small { font-size: 15px; color: var(--tx2); font-weight: 600; margin-left: 2px; letter-spacing: 0; }
.tile .val.empty { color: var(--tx3); }
.tile .src { font-size: 12px; color: var(--tx3); margin-top: auto; padding-top: 4px; }
.tile .src.auto { color: var(--ac2); }
.tile .bar { margin: 6px 0 0; height: 5px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--tx3); display: inline-block; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

/* переключатель */
.sw { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 56px; }
.sw .tg { flex: 0 0 auto; width: 51px; height: 31px; border-radius: 16px; background: var(--card2); position: relative; transition: background .2s; box-shadow: inset 0 0 0 1px var(--sep); }
.sw .tg::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.sw.on .tg { background: var(--ok); box-shadow: none; }
.sw.on .tg::after { transform: translateX(20px); }

/* победы */
.feed { margin: 0; padding: 0; list-style: none; }
.feed li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--sep); }
.feed li:first-child { border-top: 0; }
.feed .ic { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--ac-s); color: var(--ac); display: grid; place-items: center; }
.feed .ic svg { width: 20px; height: 20px; }
.feed li.new .ic { background: var(--ac); color: #fff; }
.feed .t { font-weight: 600; font-size: 15px; }
.feed .d { font-size: 13px; color: var(--tx2); }

/* подсказка */
.note { display: flex; gap: 12px; align-items: flex-start; background: var(--ac2-s); border-radius: var(--r); padding: 13px 14px; margin-bottom: 12px; font-size: 14px; }
.note.warm { background: var(--ac-s); }
.note svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--ac2); margin-top: 1px; }
.note.warm svg { color: var(--ac); }
.note b { display: block; font-size: 15px; margin-bottom: 2px; }
.note .x { margin-left: auto; color: var(--tx2); width: 32px; height: 32px; margin: -6px -8px -6px 0; display: grid; place-items: center; }

/* зал */
.stage { margin-bottom: 12px; }
.ss { margin-top: 22px; }
.ss-h { display: flex; flex-direction: column; gap: 1px; margin: 0 2px 8px; }
.ss-h b { font-size: 17px; }
.ss-h span { font-size: 13px; color: var(--tx2); }
.ex { padding: 0; overflow: hidden; }
.ex .media { position: relative; background: #fff; aspect-ratio: 16 / 10; overflow: hidden; }
.ex .media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ex .media .zoom { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 10px; background: rgba(0, 0, 0, .45); color: #fff; display: grid; place-items: center; }
.ex .media .zoom svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.ex .body { padding: 14px 16px 16px; }
.ex h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.ex .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 14px; color: var(--tx2); }
.ex details { margin-top: 10px; font-size: 15px; }
.ex summary { color: var(--ac); font-weight: 500; min-height: 36px; display: flex; align-items: center; list-style: none; cursor: pointer; }
.ex summary::-webkit-details-marker { display: none; }
.ex details p { margin: 2px 0 6px; color: var(--tx); }
.ex .yt { font-size: 13px; color: var(--tx2); text-decoration: underline; text-underline-offset: 2px; }
.wctl { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.wctl .pm { width: 52px; height: 52px; border-radius: 14px; background: var(--card2); font-size: 26px; font-weight: 500; display: grid; place-items: center; color: var(--ac); }
.wctl .pm:active { background: var(--ac-s); }
.wctl .wv { flex: 1; height: 52px; border-radius: 14px; background: var(--card2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.wctl .wv b { font-size: 24px; letter-spacing: -.02em; }
.wctl .wv span { font-size: 12px; color: var(--tx2); }
.hint { margin-top: 8px; font-size: 13px; color: var(--ac2); font-weight: 600; }
.setsrow { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.setb { min-width: 58px; height: 50px; border-radius: 12px; border: 1.5px dashed var(--sep); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; font-size: 12px; color: var(--tx3); padding: 0 8px; }
.setb b { font-size: 18px; color: inherit; }
.setb.done { border: 0; background: var(--ac2-s); color: var(--ac2); }
.setb.done span { color: var(--tx2); }
.setb.drop { background: var(--ac-s); color: var(--ac); }
.setb.next { border-color: var(--ac); color: var(--ac); }
.ex .acts { display: flex; gap: 8px; margin-top: 12px; }
.ex .acts .btn { flex: 1; }
.ex.complete .acts .btn:not(.sec):not(.ghost) { background: var(--ac2); }

/* таймер */
.timer { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav) + var(--navb) + 10px); z-index: 30; max-width: 536px; margin: 0 auto; background: #1c1c1e; color: #fff; border-radius: 18px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.timer[hidden] { display: none; }
@media (prefers-color-scheme: dark) { .timer { background: #2c2c2e; } }
.timer > div:first-child { flex: 1; min-width: 0; }
.timer .tt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: #b9b9be; line-height: 1.2; }
.timer .tv { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; min-width: 74px; }
.timer button { flex: 0 0 auto; white-space: nowrap; min-width: 50px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .14); font-weight: 600; font-size: 15px; padding: 0 14px; }
.timer.end { background: var(--ac2); }
.timer.end .tt { color: rgba(255, 255, 255, .85); }

/* прогресс */
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .ax { font-size: 10px; fill: var(--tx2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--tx2); margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.wk { padding: 14px 16px 6px; }
.wk-h { display: flex; justify-content: space-between; align-items: center; }
.wk-h b { font-size: 16px; }
.score { font-weight: 700; font-size: 15px; padding: 3px 10px; border-radius: 10px; background: var(--card2); }
.score.ok { background: var(--ac2-s); color: var(--ac2); }
.wk ul { list-style: none; padding: 0; margin: 8px 0 0; }
.wk li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--sep); font-size: 14px; }
.wk li svg { width: 20px; height: 20px; flex: 0 0 auto; }
.wk li .v { margin-left: auto; color: var(--tx2); font-variant-numeric: tabular-nums; }
.ck { color: var(--ok); } .cx { color: var(--tx3); }
table.cp { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
table.cp td, table.cp th { padding: 9px 0; border-top: 1px solid var(--sep); text-align: right; }
table.cp th { font-size: 12px; color: var(--tx2); font-weight: 600; border-top: 0; padding-top: 0; }
table.cp td:first-child, table.cp th:first-child { text-align: left; }
table.cp tr.past td { color: var(--tx2); }
table.cp tr.goal td { font-weight: 700; color: var(--ac); }

/* тело */
.meas { display: flex; flex-direction: column; gap: 8px; }
.mcard { background: var(--card); border-radius: var(--r); padding: 8px 14px 8px 8px; display: flex; gap: 10px; text-align: left; align-items: center; min-height: 84px; width: 100%; }
.mcard:active { transform: scale(.99); }
.mcard svg.fig { flex: 0 0 auto; width: 36px; height: 76px; }
.mcard .mt { flex: 1; min-width: 0; }
.mcard .mr { text-align: right; flex: 0 0 auto; }
.mcard .mn { font-weight: 700; font-size: 17px; }
.mcard .mh { font-size: 13px; color: var(--tx2); line-height: 1.25; }
.mcard .mv { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.mcard .mv small { font-size: 14px; color: var(--tx2); font-weight: 600; }
.mcard .mv.empty { color: var(--ac); font-size: 16px; font-weight: 600; }
.mcard .md { font-size: 13px; line-height: 1.35; color: var(--tx2); margin-top: 3px; }
.mcard .md .good { color: var(--ok); font-weight: 600; }
.mcard .md .bad { color: var(--bad); font-weight: 600; }
.hist { overflow-x: auto; }
.hist table { border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 100%; }
.hist td, .hist th { padding: 8px 8px; border-top: 1px solid var(--sep); text-align: right; white-space: nowrap; }
.hist th { font-size: 12px; color: var(--tx2); border-top: 0; font-weight: 600; }
.hist td:first-child, .hist th:first-child { text-align: left; padding-left: 0; }

/* ещё */
.group { background: var(--card); border-radius: var(--r); margin-bottom: 12px; overflow: hidden; }
.group .it { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; border-top: 1px solid var(--sep); width: 100%; text-align: left; }
.group .it:first-child { border-top: 0; }
.group .it .v { margin-left: auto; color: var(--tx2); font-variant-numeric: tabular-nums; }
.group .it .chev { width: 8px; height: 14px; fill: none; stroke: var(--tx3); stroke-width: 2; flex: 0 0 auto; }
.group details summary { list-style: none; display: flex; align-items: center; min-height: 52px; padding: 0 16px; font-weight: 600; cursor: pointer; border-top: 1px solid var(--sep); }
.group details:first-child summary { border-top: 0; }
.group details summary::-webkit-details-marker { display: none; }
.group details summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--tx3); border-bottom: 2px solid var(--tx3); transform: rotate(45deg); transition: transform .2s; }
.group details[open] summary::after { transform: rotate(-135deg); }
.group details .in { padding: 0 16px 14px; font-size: 15px; }
.group details .in p { margin: 0 0 8px; }
.group details .in ul { margin: 0 0 8px; padding-left: 18px; }
.group details .in li { margin-bottom: 4px; }
.copy { display: flex; gap: 8px; align-items: stretch; margin-top: 8px; }
.copy code { flex: 1; min-width: 0; font: 12px/1.35 ui-monospace, Menlo, monospace; background: var(--card2); border-radius: 10px; padding: 10px; word-break: break-all; user-select: all; -webkit-user-select: all; }
ol.steps { margin: 8px 0 0; padding-left: 20px; font-size: 15px; }
ol.steps li { margin-bottom: 6px; }

/* нижняя навигация */
/* Жидкое стекло: плавающая капсула, под активной вкладкой — линза, она перетекает между вкладками и тянется за пальцем */
#nav { position: fixed; left: 12px; right: 12px; bottom: var(--navb); z-index: 20; max-width: 440px; margin: 0 auto; height: var(--nav); display: flex; padding: 4px; border-radius: calc(var(--nav) / 2); isolation: isolate; touch-action: none; user-select: none; -webkit-user-select: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .74), rgba(250, 250, 252, .56));
  -webkit-backdrop-filter: blur(22px) saturate(200%) brightness(1.04); backdrop-filter: blur(22px) saturate(200%) brightness(1.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .35), inset 0 0 0 .5px rgba(255, 255, 255, .5), 0 10px 30px rgba(0, 0, 0, .12), 0 1px 4px rgba(0, 0, 0, .06); }
#nav::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(120% 90% at 18% -20%, rgba(255, 255, 255, .7), transparent 55%), radial-gradient(90% 80% at 100% 130%, rgba(255, 255, 255, .35), transparent 60%); }
@media (prefers-color-scheme: dark) {
  #nav { background: linear-gradient(180deg, rgba(58, 58, 64, .66), rgba(28, 28, 32, .62)); -webkit-backdrop-filter: blur(22px) saturate(180%) brightness(.85); backdrop-filter: blur(22px) saturate(180%) brightness(.85);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(255, 255, 255, .06), inset 0 0 0 .5px rgba(255, 255, 255, .12), 0 10px 30px rgba(0, 0, 0, .5); }
  #nav::before { background: radial-gradient(120% 90% at 18% -20%, rgba(255, 255, 255, .14), transparent 55%); }
}
#nav[hidden] { display: none; }
#nav .lens { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 5); border-radius: calc(var(--nav) / 2 - 4px); z-index: 0; pointer-events: none;
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .55s cubic-bezier(.3, 1.45, .5, 1), background-color .25s, box-shadow .25s, scale .3s cubic-bezier(.3, 1.45, .5, 1);
  background: rgba(0, 0, 0, .055); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -.5px 0 rgba(0, 0, 0, .05); }
#nav .lens i { position: absolute; inset: 0; border-radius: inherit; display: block; }
#nav .lens.squish i { animation: squish .55s cubic-bezier(.3, 1.2, .5, 1); background: inherit; }
@keyframes squish { 0% { transform: scale(1, 1); } 35% { transform: scale(1.18, .9); } 70% { transform: scale(.97, 1.03); } 100% { transform: scale(1, 1); } }
#nav.drag .lens { transition: background-color .2s, box-shadow .2s, scale .3s cubic-bezier(.3, 1.45, .5, 1); scale: 1.14 1.1; background: rgba(255, 255, 255, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), inset 0 0 0 .5px rgba(255, 255, 255, .8), 0 6px 18px rgba(0, 0, 0, .12); }
@media (prefers-color-scheme: dark) {
  #nav .lens { background: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
  #nav.drag .lens { background: rgba(255, 255, 255, .2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 18px rgba(0, 0, 0, .4); }
}
#nav a { -webkit-user-drag: none; -webkit-touch-callout: none; position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--tx2); transition: color .3s ease; }
#nav a svg { width: 25px; height: 25px; fill: currentColor; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); }
#nav a.on { color: var(--ac); }
#nav a.on svg { transform: scale(1.08); }
#nav a:active svg { transform: scale(.86); }

/* шторка */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .38); opacity: 0; transition: opacity .25s; }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: var(--card); border-radius: 20px 20px 0 0; padding: 8px 16px calc(var(--sb) + 16px); transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .9, .3, 1); max-height: 92vh; overflow-y: auto; }
.sheet.open .sheet-bg { opacity: 1; }
.sheet.open .sheet-card { transform: none; }
.sheet-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--sep); margin: 0 auto 6px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.sheet-h b { font-size: 17px; text-align: center; flex: 1; }
.sheet-h button { min-width: 80px; min-height: 44px; color: var(--ac); font-size: 17px; }
.sheet-h button.l { text-align: left; color: var(--tx2); }
.sheet-h button.r { text-align: right; font-weight: 600; }
.sheet .sub { text-align: center; color: var(--tx2); font-size: 14px; margin: 0 0 6px; }
.sheet .foot { display: flex; gap: 8px; margin-top: 12px; }

/* барабан */
.wheel { position: relative; display: flex; justify-content: center; gap: 4px; height: 220px; margin: 6px 0; user-select: none; -webkit-user-select: none; }
.wheel::before { content: ""; position: absolute; left: 0; right: 0; top: 88px; height: 44px; border-radius: 12px; background: var(--card2); pointer-events: none; }
.wcol { position: relative; height: 220px; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); min-width: 70px; overscroll-behavior: contain; }
.wcol::-webkit-scrollbar { display: none; }
.wcol .wi { height: 44px; line-height: 44px; text-align: center; font-size: 24px; font-variant-numeric: tabular-nums; scroll-snap-align: center; color: var(--tx); padding: 0 8px; }
.wcol .wi.pad { scroll-snap-align: none; }
.wunit { align-self: center; font-size: 18px; color: var(--tx2); position: relative; padding-left: 2px; }

/* тост */
.toast { position: fixed; left: 16px; right: 16px; top: calc(var(--st) + 10px); z-index: 60; max-width: 520px; margin: 0 auto; background: var(--card); color: var(--tx); border-radius: 16px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); display: flex; gap: 12px; align-items: center; font-weight: 500; transform: translateY(-140%); transition: transform .35s cubic-bezier(.2, .9, .3, 1); }
.toast[hidden] { display: flex; visibility: hidden; }
.toast.show { transform: none; visibility: visible; }
.toast .ic { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--ac); color: #fff; display: grid; place-items: center; }
.toast .ic svg { width: 20px; height: 20px; }
.toast small { display: block; color: var(--tx2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

/* полноэкранная анимация */
.viewer { position: fixed; inset: 0; z-index: 70; background: #fff; display: flex; flex-direction: column; justify-content: center; }
.viewer[hidden] { display: none; }
.viewer img { width: 100%; max-height: 80vh; object-fit: contain; }
.viewer .vt { position: absolute; left: 0; right: 0; top: calc(var(--st) + 10px); text-align: center; color: #111; font-weight: 600; padding: 0 60px; }
.viewer .vx { position: absolute; right: 12px; top: calc(var(--st) + 4px); width: 44px; height: 44px; border-radius: 22px; background: rgba(0, 0, 0, .08); display: grid; place-items: center; color: #111; }
.viewer .vx svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; fill: none; }

/* вход */
.login { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--st) + 20px) 24px calc(var(--sb) + 20px); text-align: center; }
.login .logo { width: 72px; height: 72px; border-radius: 18px; background: var(--ac); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 26px; letter-spacing: -.03em; margin-bottom: 14px; }
.login h1 { margin: 0 0 4px; font-size: 26px; }
.login .dots { display: flex; gap: 14px; height: 18px; margin: 24px 0 8px; }
.login .dots i { width: 14px; height: 14px; border-radius: 7px; border: 2px solid var(--tx3); }
.login .dots i.f { background: var(--ac); border-color: var(--ac); }
.login .err { color: var(--bad); min-height: 22px; font-size: 14px; }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; margin-top: 10px; }
.pad button { width: 76px; height: 76px; border-radius: 38px; background: var(--card); font-size: 30px; font-weight: 400; }
.pad button:active { background: var(--card2); }
.pad button.fn { background: none; font-size: 16px; color: var(--ac); font-weight: 600; }

@media (max-width: 350px) {
  .top h1 { font-size: 28px; }
  .tile .val { font-size: 24px; }
  .hero .big { font-size: 40px; }
  .pad { grid-template-columns: repeat(3, 68px); gap: 12px 18px; }
  .pad button { width: 68px; height: 68px; }
  .wctl .pm { width: 46px; }
  .setb { min-width: 50px; }
}

/* ---------- движение ---------- */
@keyframes tabIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--ac); } 30% { box-shadow: 0 0 0 3px var(--ac-s); } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tab.enter { animation: tabIn .34s cubic-bezier(.2, .8, .2, 1) both; }
.tab.enter.fr { animation-name: tabInR; } .tab.enter.fl { animation-name: tabInL; }
@keyframes tabInR { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes tabInL { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
.tab.enter .bar i { transform-origin: left center; animation: grow .7s .1s cubic-bezier(.2, .8, .2, 1) both; }
.tab.enter .wcard { animation: rise .4s cubic-bezier(.2, .8, .2, 1) both; }
.tab.enter .wcard:nth-child(2) { animation-delay: .05s; } .tab.enter .wcard:nth-child(3) { animation-delay: .1s; } .tab.enter .wcard:nth-child(4) { animation-delay: .15s; }
.setb.pop { animation: pop .38s cubic-bezier(.2, .9, .3, 1.2) both; }
.flash { animation: flash .9s ease-out; }
.timer:not([hidden]) { animation: slideUp .28s cubic-bezier(.2, .9, .3, 1) both; }
.viewer:not([hidden]) { animation: fadeIn .2s ease-out both; }

.tile, .mcard, .btn, .pm, .setb, .chip, .seg button, .wcard, .it { transition: transform .15s ease, background-color .2s ease, opacity .2s ease; }
.pm:active, .chip:active, .setb:active { transform: scale(.92); }
.it:active { background: var(--card2); }
.sheet-card.drag { transition: none; }
.chart path, .chart circle { animation: fadeIn .5s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ---------- меню ---------- */
.sech { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sech a { font-size: 15px; font-weight: 600; padding: 8px 2px; }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; margin: -6px 0 -4px -6px; font-size: 17px; font-weight: 500; }
.back svg { width: 22px; height: 22px; }
.carousel.food .meal { flex: 0 0 72%; max-width: 280px; }
.meal { position: relative; display: block; width: 100%; text-align: left; background: var(--card); border-radius: var(--r); overflow: hidden; scroll-snap-align: start; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.meal:active { transform: scale(.975); }
.pic { position: relative; aspect-ratio: 4 / 3; background: var(--card2); overflow: hidden; }
img.ph { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity .45s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
img.ph.ld { opacity: 1; transform: none; }
.pic .tag { position: absolute; left: 10px; top: 10px; padding: 5px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(228, 87, 46, .9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.pic .tag.ok { background: rgba(18, 150, 138, .9); }
.meal .mt { padding: 10px 14px 13px; display: flex; flex-direction: column; gap: 2px; }
.meal .mt .k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ac); }
.meal .mt b { font-size: 17px; line-height: 1.25; }
.meals { display: grid; gap: 12px; }
.meals .meal .mt b { font-size: 18px; }
.mdays { margin-bottom: 12px; }
.mdays .chip.today:not(.on) { color: var(--ac); box-shadow: inset 0 0 0 1.5px var(--ac-s); }
.mday-h { background: var(--card); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; }
.mday-h > b { display: block; font-size: 15px; margin-bottom: 8px; }
.msum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.msum > div { background: var(--card2); border-radius: 12px; padding: 8px 4px; text-align: center; }
.msum b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.msum span { font-size: 11.5px; color: var(--tx2); font-weight: 600; }
.swap.fr { animation: tabInR .32s cubic-bezier(.2, .8, .2, 1) both; } .swap.fl { animation: tabInL .32s cubic-bezier(.2, .8, .2, 1) both; }
.shopbtn { width: 100%; margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.shopbtn svg { width: 20px; height: 20px; }
.dish .pic { border-radius: 16px; margin: 2px 0 12px; }
.dish .dk { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ac); }
.dish .dk span { display: inline-flex; align-items: center; gap: 4px; color: var(--tx2); text-transform: none; letter-spacing: 0; font-size: 13px; }
.dish .dk svg { width: 15px; height: 15px; }
.dish h3 { font-size: 22px; line-height: 1.2; margin: 4px 0 12px; letter-spacing: -.01em; }
.dish h4, .sheet h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--tx2); margin: 18px 2px 6px; }
.dnote { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--ac-s); font-size: 14px; }
.dnote.ok { background: var(--ac2-s); }
.ingr { list-style: none; margin: 0; padding: 0; background: var(--card2); border-radius: 14px; }
.ingr li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--sep); font-size: 15px; }
.ingr li:first-child { border-top: 0; }
.ingr .v, .shopit .v { color: var(--tx2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rsteps { margin: 0; padding: 0; list-style: none; counter-reset: st; }
.rsteps li { counter-increment: st; position: relative; padding: 6px 0 6px 38px; font-size: 15.5px; }
.rsteps li::before { content: counter(st); position: absolute; left: 0; top: 5px; width: 26px; height: 26px; border-radius: 13px; background: var(--ac); color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.shop { background: var(--card2); border-radius: 14px; overflow: hidden; }
.shopit .chk i { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 11px; box-shadow: inset 0 0 0 1.5px var(--tx3); display: grid; place-items: center; color: transparent; transition: background-color .2s, box-shadow .2s, color .2s; }
.shopit .chk i svg { width: 14px; height: 14px; stroke-width: 3; }
.shopit.done { opacity: .5; }
.shopit.done .chk i { background: var(--ac2); box-shadow: none; color: #fff; }
.lnk { color: var(--ac); font-weight: 600; font-size: inherit; }
.group a.it { color: inherit; }
.group .it .ic svg { width: 22px; height: 22px; }
.sheet-h span.l { min-width: 80px; }

.meal .mopen { display: block; width: 100%; text-align: left; }
.mswap { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .32); -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.mswap:active { transform: scale(.88) rotate(-20deg); }
.mswap svg { width: 20px; height: 20px; }
svg.inl { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; }
.btn.sec svg { width: 20px; height: 20px; }
.alts { display: grid; gap: 8px; margin-top: 10px; }
.alt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border-radius: 14px; background: var(--card2); text-align: left; transition: transform .15s ease; }
.alt:active { transform: scale(.98); }
.alt .th { flex: 0 0 auto; width: 76px; height: 57px; border-radius: 10px; overflow: hidden; background: var(--sep); }
.alt .sp { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alt .sp b { font-size: 15px; line-height: 1.25; }
.alt .dk { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--tx2); text-align: right; max-width: 64px; }
.alt .dk.warn { color: var(--warn); }
.swall { margin: 4px 0 0; padding: 10px 12px; border-radius: 14px; background: var(--card2); }
.shopit { display: block; border-top: 1px solid var(--sep); padding: 0; min-height: 0; }
.shopit:first-child { border-top: 0; }
.shopit .chk { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 8px 14px; text-align: left; font-size: 15px; }
.shopit .chk span:nth-child(2) { flex: 1; min-width: 0; }
.shopit.done .chk span:nth-child(2) { text-decoration: line-through; }
.shopit .vv { display: flex; align-items: center; gap: 4px; margin: -6px 0 0; padding: 0 14px 10px 46px; font-size: 13px; color: var(--ac2); font-weight: 600; }
.shopit .vv i { margin-left: auto; flex: 0 0 auto; }
.shopit .vv svg { width: 14px; height: 14px; }
.shopit.done .vv { display: none; }
.shopn { margin-top: 2px; }
.shopsum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.shopsum > div { background: var(--card2); border-radius: 14px; padding: 10px 12px; }
.shopsum b { display: block; font-size: 20px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.shopsum span { font-size: 12px; color: var(--tx2); font-weight: 600; line-height: 1.25; display: block; }
.shopit .vv em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--tx2); background: var(--sep); border-radius: 6px; padding: 1px 6px; margin-left: 4px; }

/* ---------- обновить ---------- */
.rfr { flex: 0 0 auto; width: 38px; height: 38px; margin-bottom: 2px; border-radius: 19px; display: grid; place-items: center; color: var(--ac); background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.rfr:active { transform: scale(.88); }
.rfr svg { width: 20px; height: 20px; }
.rfr.spin svg, #ptr.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#ptr { position: fixed; left: 50%; top: calc(var(--st) - 34px); z-index: 26; width: 38px; height: 38px; border-radius: 19px; display: grid; place-items: center; color: var(--tx3); background: var(--card); box-shadow: 0 4px 14px rgba(0, 0, 0, .14); opacity: 0; transform: translate(-50%, 0); pointer-events: none; transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), opacity .25s, color .2s; }
#ptr.drag { transition: color .2s; }
#ptr.ready, #ptr.spin { color: var(--ac); }
#ptr svg { width: 20px; height: 20px; }
.ing summary .sp { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; font-weight: 400; }
.ing summary .sp b { font-weight: 600; }
.ingt { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ingt th { text-align: left; color: var(--tx2); font-weight: 600; padding: 4px 4px 6px 0; border-bottom: 1px solid var(--sep); }
.ingt td { padding: 5px 4px 5px 0; border-bottom: 1px solid var(--sep); color: var(--tx2); word-break: break-word; }
.ingt tr.use td { color: var(--tx); font-weight: 600; }
.ingt td:first-child { max-width: 140px; }
