/* Палитра и шрифт из мудборда «Спокойное движение» */
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap;
  src: url(fonts/manrope-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap;
  src: url(fonts/manrope-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap;
  src: url(fonts/manrope-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap;
  src: url(fonts/manrope-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap;
  src: url(fonts/manrope-cyrillic-800-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap;
  src: url(fonts/manrope-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }

:root {
  --sage: #3F7364;      /* Шалфей: основной, кнопки */
  --sage-dark: #335E52;
  --pine: #14282B;      /* Хвоя: текст, заголовки */
  --coral: #E27D60;     /* Коралл: акцент, оплата */
  --coral-dark: #CF6A4D;
  --mist: #DCE8E4;      /* Туман: карточки */
  --sand: #F4EFE6;      /* Песок: фон */
  --sand-deep: #EAE2D4;
  --muted: #4F6366;
  --line: rgba(20, 40, 43, .10);
  --radius: 20px;
  --gutter: 20px;
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--sand); color: var(--pine); }
body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, p { margin: 0; }

main {
  max-width: 520px; margin: 0 auto;
  padding: calc(var(--safe-top) + 20px) var(--gutter) calc(var(--safe-bottom) + 170px);
  min-height: var(--tg-viewport-stable-height, 100vh);
}
.view { animation: in .28s ease both; }
.view.back { animation-name: in-back; }
@keyframes in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view, .view.back { animation: none; } }

/* Типографика 30 / 18 / 14 */
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--sage); }
.h1 { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.h2 { font-size: 18px; line-height: 1.35; font-weight: 600; }
.lead { font-size: 16px; color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }
.stack > * + * { margin-top: 12px; }
.section { margin-top: 28px; }
.section-title { font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

.card { background: var(--mist); border-radius: var(--radius); padding: 18px; }
.card.plain { background: #fff; box-shadow: 0 1px 0 var(--line); }

/* Доступ */
.access { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 14px 16px; }
.access .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sage); flex: none; }
.access.trial .dot { background: #8FB3A7; }
.access .grow { flex: 1; font-size: 14px; }
.access b { font-weight: 600; }
.link-btn { font-size: 14px; font-weight: 600; color: var(--coral-dark); white-space: nowrap; padding: 6px 0; }

/* Неделя */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.day .mark { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(63, 115, 100, .25);
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; }
.day.on .mark { background: var(--sage); border-color: var(--sage); }
.day.today { color: var(--pine); font-weight: 800; }
.day.today:not(.on) .mark { border-color: var(--sage); border-style: dashed; }
.week-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

/* Программы */
.program { display: block; width: 100%; text-align: left; padding: 18px; transition: transform .12s ease; }
.program:active { transform: scale(.985); }
.program + .program { margin-top: 12px; }
.program .row { display: flex; align-items: flex-start; gap: 12px; }
.program .grow { flex: 1; min-width: 0; }
.program .summary { font-size: 14px; color: var(--muted); margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chev { flex: none; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.65);
  display: grid; place-items: center; color: var(--sage); margin-top: 2px; }
.bar { height: 6px; border-radius: 3px; background: rgba(63, 115, 100, .16); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--sage); border-radius: 3px; transition: width .4s ease; }
.progress-line { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.progress-line .bar { flex: 1; }

/* Список упражнений программы */
.ex-list { list-style: none; margin: 0; padding: 0; }
.ex-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.ex-list li:first-child { border-top: 0; padding-top: 0; }
.ex-list .num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; background: #fff; color: var(--sage); }
.ex-list li.done .num { background: var(--sage); color: #fff; }
.ex-list li.current .num { box-shadow: 0 0 0 2px var(--sage); }
.ex-list .t { font-weight: 600; line-height: 1.35; }
.ex-list .d { font-size: 14px; color: var(--muted); }
.warn { background: #fff; border: 1.5px solid rgba(226, 125, 96, .45); }
.warn ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
.warn li + li { margin-top: 4px; }

/* Упражнение */
.ex-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--sage); }
.ex-prog { overflow: hidden; text-overflow: ellipsis; min-width: 0; font-weight: 400; }
.segments { display: flex; gap: 4px; margin-top: 10px; }
.segments i { flex: 1; height: 4px; border-radius: 2px; background: rgba(63, 115, 100, .18); }
.segments i.on { background: var(--sage); }
.media { position: relative; margin-top: 18px; border-radius: var(--radius); overflow: hidden; background: var(--mist);
  aspect-ratio: 4 / 5; max-height: 52vh; width: 100%; }
.media.empty { aspect-ratio: 16 / 10; }
.media video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--mist); }
.media .placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.media .placeholder svg { color: var(--sage); opacity: .8; }
.views { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(20, 40, 43, .55); backdrop-filter: blur(6px); }
.views button { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff; }
.views button.on { background: #fff; color: var(--pine); }
.dosage { display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 999px; background: var(--mist); color: var(--sage-dark); font-size: 18px; font-weight: 600; }
.steps { list-style: none; counter-reset: s; margin: 16px 0 0; padding: 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; padding: 8px 0; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--mist); color: var(--sage);
  font-size: 13px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }
.stop { display: flex; gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: var(--sand-deep); font-size: 14px; }
.stop svg { flex: none; color: var(--coral-dark); margin-top: 2px; }

/* Кнопки внизу */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 12px var(--gutter) calc(var(--safe-bottom) + 14px);
  background: linear-gradient(to top, var(--sand) 70%, rgba(244, 239, 230, 0)); }
.dock-inner { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.btn { width: 100%; min-height: 54px; border-radius: 16px; font-size: 17px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s ease, background .15s ease; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; }
.btn.primary { background: var(--sage); color: #fff; }
.btn.primary:active { background: var(--sage-dark); }
.btn.pay { background: var(--coral); color: #fff; }
.btn.pay:active { background: var(--coral-dark); }
.btn.ghost { min-height: 44px; font-weight: 600; font-size: 15px; color: var(--sage-dark); }
.row-btns { display: flex; gap: 8px; }

/* Итог и оплата */
.center { text-align: center; }
.badge-big { width: 88px; height: 88px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; margin: 24px auto 20px; }
.stats { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.stat { min-width: 110px; padding: 14px; }
.stat b { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; }
.price { padding: 22px; text-align: center; background: #fff; border: 2px solid rgba(226, 125, 96, .35); }
.price .amount { font-size: 44px; font-weight: 800; line-height: 1.1; }
.price .amount span { color: var(--coral); }
.checks { list-style: none; padding: 0; margin: 16px 0 0; text-align: left; }
.checks li { display: flex; gap: 10px; padding: 6px 0; font-size: 15px; }
.checks svg { flex: none; color: var(--sage); margin-top: 3px; }

.loading { min-height: 60vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--mist); border-top-color: var(--sage); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.footer { max-width: 520px; margin: -96px auto 0; padding: 0 var(--gutter) calc(var(--safe-bottom) + 28px); font-size: 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; top: calc(var(--safe-top) + 14px); transform: translateX(-50%); z-index: 9; background: var(--pine); color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(20, 40, 43, .2); animation: in .2s ease both; }
