/*
 * The phone frame and the drawn app screens (.mk).
 * Colours inside .mk are the apps' own look (blue toolbar, pale blue ground, white cards), not the site's.
 * Only the frame uses the site tokens (--ink, --paper, --dir), each with a fallback so this file also stands alone.
 */

/* ------------------------------------------------------------------ phone frame */

.phone {
  --s: 1;
  position: relative;
  display: block;
  flex: none;
  width: calc(300px * var(--s));
  height: calc(620px * var(--s));
}
.phone--xl { --s: 1; }
.phone--lg { --s: .88; }
.phone--md { --s: .74; }
.phone--sm { --s: .6; }
@media (max-width: 640px) {
  .phone--xl { --s: .8; }
  .phone--lg { --s: .74; }
  .phone--md { --s: .62; }
  .phone--sm { --s: .52; }
}

.phone__in {
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  height: 620px;
  transform: scale(var(--s));
  transform-origin: 0 0;
}
.phone__body {
  position: relative;
  box-sizing: border-box;
  width: 300px;
  height: 620px;
  border: 0;
  border-radius: 40px;
  background: #0b100e;
  box-shadow: 0 0 0 1.5px #28322d, 0 34px 60px -24px rgba(3, 10, 7, 0.7), 0 10px 18px -10px rgba(3, 10, 7, 0.45);
}
.phone__body::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: #050907;
  box-shadow: 0 0 0 1.5px #1a231f;
}
.phone__screen {
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  left: 8px;
  overflow: hidden;
  border-radius: 32px;
  background: #fff;
}
.phone__shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------------ screen shell */

.mk {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #d2ebfc;
  color: #1c2430;
  font: 400 12px/1.5 var(--font-en, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  text-align: start;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}
.mk[lang="fa"] {
  font-family: var(--font-fa, "Vazir", Tahoma, sans-serif);
  line-height: 1.65;
}
.mk *,
.mk *::before,
.mk *::after { box-sizing: border-box; }
.mk b { font-weight: 700; }
.mk small { font-size: 10.5px; font-weight: 400; }
.mk .ico { width: 16px; height: 16px; flex: none; }

.mk__sb {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: ltr;
  height: 22px;
  padding: 0 14px;
  background: #2a73a8;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.mk__sbi { display: flex; align-items: center; gap: 4px; }
.mk__sbi svg { display: block; }

.mk__bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  background: #3283bc;
  color: #fff;
}
.mk__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mk__burger {
  position: relative;
  flex: none;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: #fff;
  box-shadow: 0 -6px 0 #fff, 0 6px 0 #fff;
}
.mk .mk__back { width: 20px; height: 20px; stroke-width: 2.2; }
.mk[dir="ltr"] .mk__back { transform: scaleX(-1); }
.mk__end { flex: none; display: flex; align-items: center; }
.mk .mk__end .ico { width: 20px; height: 20px; }

.mk__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  overflow: hidden;
}
.mk__body > * { flex: none; }

/* ------------------------------------------------------------------ small parts */

.mk__img { display: block; max-width: 100%; background: #fff; }

.mk__card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(23, 64, 102, .14);
}
.mk__ct { display: block; font-size: 12.5px; font-weight: 700; color: #1c2430; }
.mk__p { margin: 0; font-size: 11px; line-height: 1.7; color: #394554; }
.mk[lang="fa"] .mk__p { line-height: 1.9; }
.mk__line { display: block; font-size: 10.5px; line-height: 1.55; color: #5b6472; }
.mk__row ~ .mk__line { padding-inline-start: 43px; }
.mk__h { padding: 0 2px; font-size: 13px; font-weight: 700; }
.mk__sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
.mk__sec b { font-size: 13px; }

.mk__chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  background: #e3ecf4;
  color: #33516b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.7;
  white-space: nowrap;
}
.mk__chip--on { background: #3283bc; color: #fff; }
.mk__chip--ok { background: #dcf3e3; color: #17693a; }
.mk__chip--warn { background: #ffefc9; color: #7d5300; }
.mk__chip--bad { background: #fde1df; color: #a1251d; }
.mk__chip--grey { background: #e7ebef; color: #55606c; }

.mk__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1.5px solid #3283bc;
  border-radius: 8px;
  background: #fff;
  color: #2a6fa3;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.mk .mk__btn .ico { width: 15px; height: 15px; }
.mk__btn--pri { border-color: #3283bc; background: #3283bc; color: #fff; }
.mk__btn--ghost { background: transparent; }
.mk__btn--dash { border-style: dashed; background: transparent; }
.mk__btn--sm { min-height: 28px; padding: 0 10px; border-radius: 7px; font-size: 11px; }
.mk__btn--block { display: flex; width: 100%; }
.mk__btns,
.mk__foot { display: flex; gap: 8px; }
.mk__btns .mk__btn,
.mk__foot .mk__btn { flex: 1; min-width: 0; }
.mk__foot { margin-top: auto; }

.mk__sw {
  flex: none;
  display: flex;
  align-items: center;
  width: 34px;
  height: 20px;
  padding: 2px;
  border-radius: 10px;
  background: #b4c1cd;
}
.mk__sw i { display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.mk__sw.is-on { justify-content: flex-end; background: #3283bc; }

.mk__av {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #3283bc;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.mk__av--ok { background: #2f9e5b; }
.mk__av--warn { background: #d99a00; }
.mk__av--bad { background: #d64541; }
.mk__av--grey { background: #8795a3; }

.mk__row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mk__rt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mk__rt b { font-size: 12px; line-height: 1.5; }
.mk__rt small { line-height: 1.5; color: #5b6472; }
.mk__row--tight .mk__rt b { font-size: 11.5px; font-weight: 400; }

.mk__thumb {
  flex: none;
  display: block;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px #cfdbe6;
}
.mk__thumb .mk__img { width: 100%; height: 100%; object-fit: cover; }
.mk--c_program .mk__thumb { width: 36px; height: 36px; }

.mk__ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e1eefb;
  color: #3283bc;
}
.mk .mk__ic .ico { width: 18px; height: 18px; }

.mk__card--list { gap: 0; padding-top: 4px; padding-bottom: 4px; }
.mk__card--list .mk__row,
.mk__list .mk__row { padding: 6px 0; }
.mk__card--list .mk__row + .mk__row,
.mk__list .mk__row + .mk__row { border-top: 1px solid #e4ecf3; }
.mk__list { display: flex; flex-direction: column; }

.mk__field {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1.5px solid #b7c9d8;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  color: #1c2430;
}
.mk__field--code { justify-content: center; direction: ltr; font-size: 15px; font-weight: 800; letter-spacing: .14em; }
.mk__field--note { align-items: flex-start; min-height: 46px; padding: 8px 10px; font-size: 11px; line-height: 1.6; color: #7b8794; }
.mk__field--name { font-size: 13px; font-weight: 700; }

/* ------------------------------------------------------------------ athlete: home */

.mk__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mk__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px 9px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(23, 64, 102, .14);
  text-align: center;
}
.mk__tile .mk__img { width: 84px; height: 84px; object-fit: contain; background: transparent; }
.mk__tile b { font-size: 12.5px; line-height: 1.3; }
.mk__tile small { font-size: 10px; line-height: 1.5; color: #5b6472; }

/* ------------------------------------------------------------------ athlete: one exercise */

.mk__pic { display: grid; place-items: center; height: 188px; overflow: hidden; border-radius: 12px; background: #000; }
.mk__flip { position: relative; display: block; width: 188px; height: 188px; }
.mk__flip .mk__img { position: absolute; top: 0; left: 0; width: 188px; height: 188px; }
.mk__f2 { opacity: 0; animation: mk-flip 2.4s ease-in-out infinite alternate; }
@keyframes mk-flip {
  0%, 25% { opacity: 0; }
  75%, 100% { opacity: 1; }
}
.mk__mus { display: flex; align-items: center; gap: 12px; }
.mk__fig { flex: none; width: 78px; height: 150px; object-fit: contain; border-radius: 8px; background: #fff; }
.mk__chips { flex: 1; display: flex; flex-wrap: wrap; align-content: center; gap: 5px; }

/* ------------------------------------------------------------------ athlete: programs */

.mk__days { display: flex; gap: 4px; }
.mk__day {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  color: #33516b;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(23, 64, 102, .14);
}
.mk__day.is-sel { background: #3283bc; color: #fff; }
.mk__day.has-dot::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: #3283bc;
}
.mk__day.is-sel.has-dot::after { background: #fff; }

/* ------------------------------------------------------------------ athlete: challenge */

.mk__chead { display: flex; flex-direction: column; }
.mk__chead b { font-size: 13px; }
.mk__chead small { color: #5b6472; }
.mk__cal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.mk__d {
  display: grid;
  place-items: center;
  height: 29px;
  border-radius: 8px;
  background: #eaf0f6;
  color: #5b6472;
  font-size: 11px;
  font-weight: 700;
}
.mk__d.is-done { background: #3283bc; color: #fff; }
.mk__d.is-rest { background: #ffe2a0; color: #6e4a00; }
.mk__d.is-now { background: #fff; color: #2a6fa3; box-shadow: inset 0 0 0 2px #3283bc; }
.mk__legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 10px; color: #5b6472; }
.mk__dot { display: inline-block; width: 9px; height: 9px; margin-inline-end: 5px; border-radius: 3px; background: #3283bc; vertical-align: -1px; }
.mk__dot--rest { background: #ffd37a; }
.mk__prog { display: flex; align-items: center; gap: 8px; }
.mk__prog small { flex: none; font-size: 10px; color: #5b6472; white-space: nowrap; }
.mk__pbar { flex: 1; display: block; height: 7px; overflow: hidden; border-radius: 4px; background: #e1eaf2; }
.mk__pbar i { display: block; height: 100%; border-radius: 4px; background: #3283bc; }

/* ------------------------------------------------------------------ athlete: growth */

.mk__metrics { display: flex; gap: 6px; margin: 0 -10px; padding: 0 10px; overflow: hidden; white-space: nowrap; }
.mk__metrics .mk__chip { padding: 4px 11px; background: #fff; color: #2a6fa3; font-size: 11px; box-shadow: 0 1px 2px rgba(23, 64, 102, .14); }
.mk__metrics .mk__chip--on { background: #3283bc; color: #fff; }
.mk__card--chart { padding: 8px 8px 6px; }
.mk__chart { display: block; width: 100%; height: auto; }
.mk__bmih { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mk__bmiv { font-size: 28px; font-weight: 800; line-height: 1.15; }
.mk__scale { position: relative; display: flex; direction: ltr; height: 8px; margin: 6px 3px 4px; border-radius: 4px; }
.mk__scale i { display: block; height: 100%; }
.mk__scale i:nth-child(1) { width: 14%; border-radius: 4px 0 0 4px; background: #4a90d9; }
.mk__scale i:nth-child(2) { width: 26%; background: #3fb26b; }
.mk__scale i:nth-child(3) { width: 20%; background: #f0b429; }
.mk__scale i:nth-child(4) { width: 40%; border-radius: 0 4px 4px 0; background: #e5534b; }
.mk__mark { position: absolute; top: -4px; display: block; width: 5px; height: 16px; margin-left: -2.5px; border-radius: 3px; background: #1c2430; box-shadow: 0 0 0 1.5px #fff; }
.mk__duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mk__duo .mk__card { gap: 2px; }
.mk__duo small { font-size: 10px; line-height: 1.45; color: #5b6472; }
.mk__duo b { font-size: 17px; font-weight: 800; line-height: 1.35; }
.mk__duo em { font-size: 10px; font-style: normal; font-weight: 400; color: #5b6472; }

/* ------------------------------------------------------------------ athlete: my coach */

.mk__okbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border-radius: 8px;
  background: #dcf3e3;
  color: #17693a;
  font-size: 12.5px;
  font-weight: 700;
}
.mk .mk__okbtn .ico { width: 16px; height: 16px; stroke-width: 2.6; }

/* ------------------------------------------------------------------ coach: home */

.mk__invite { display: flex; align-items: center; gap: 12px; }
.mk__qrbox { flex: none; display: block; width: 96px; height: 96px; padding: 3px; border: 1.5px solid #b7c9d8; border-radius: 8px; background: #fff; }
.mk__qr { display: block; width: 100%; height: 100%; }
.mk__invc { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mk__code { display: block; padding: 3px 0; border-radius: 8px; background: #e1eefb; color: #125aa3; direction: ltr; font-size: 19px; font-weight: 800; letter-spacing: .14em; line-height: 1.4; text-align: center; }
.mk__invc .mk__btn { width: 100%; }

/* ------------------------------------------------------------------ coach: program, diet, term */

.mk__status { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.mk__status small { color: #5b6472; }
.mk__wd { display: flex; gap: 4px; }
.mk__wd span { flex: 1; display: grid; place-items: center; height: 26px; border-radius: 8px; background: #eaf0f6; color: #5b6472; font-size: 11px; font-weight: 700; }
.mk__wd span.is-on { background: #3283bc; color: #fff; }

.mk__mealh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mk__mealh b { font-size: 13px; }
.mk__at { padding: 0 8px; border-radius: 999px; background: #e1eefb; color: #125aa3; font-size: 10px; font-weight: 700; line-height: 1.8; }
.mk__items { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; }
.mk__items li { position: relative; padding-inline-start: 13px; font-size: 11.5px; line-height: 1.6; color: #2b3644; }
.mk__items li::before { content: ""; position: absolute; top: .72em; left: 0; width: 5px; height: 5px; border-radius: 50%; background: #3283bc; }
.mk[dir="rtl"] .mk__items li::before { right: 0; left: auto; }

.mk__seg { display: flex; overflow: hidden; border: 1.5px solid #3283bc; border-radius: 8px; }
.mk__seg span { flex: 1; padding: 5px 0; color: #2a6fa3; font-size: 11px; font-weight: 700; text-align: center; }
.mk__seg span + span { border-left: 1px solid #3283bc; }
.mk[dir="rtl"] .mk__seg span + span { border-right: 1px solid #3283bc; border-left: 0; }
.mk__seg span.is-on { background: #3283bc; color: #fff; }
.mk__states { display: flex; justify-content: center; gap: 6px; }
.mk__nh { display: flex; align-items: center; gap: 6px; }
.mk .mk__nh .ico { width: 15px; height: 15px; color: #3283bc; }

/* ------------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  .mk__f2 { animation: none; }
}
