/* Me page: staging for its scenes (shared look in film.css; layout numbers
   come from me.js as --x, --y, --w on each placed element). */

.abs { position: absolute; left: 0; top: 0; width: var(--w); }

/* ---------- intro ---------- */
.me-xr { --w: min(320px, calc((100svh - 150px) * .45)); left: calc(64% - var(--w) / 2); top: calc(50% + 16px - var(--w) * 1.1111); }
.ly-head   { left: 2.778%; top: 5%;      width: 95.37%;  --z: .78; }
.ly-today  { left: 2.222%; top: 15.417%; width: 95.556%; --z: .6; border-radius: 9%/18%; }
.ly-assist { left: 2.222%; top: 36.167%; width: 95.556%; --z: .45; border-radius: 9%/40%; }
.ly-health { left: 2.222%; top: 46.25%;  width: 95.556%; --z: .3; border-radius: 9%/18%; }
.xr .ly.card { box-shadow: none; }
.only { position: absolute; left: 70%; top: 7%; z-index: 5; display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 15px/1 var(--body);
  opacity: var(--o, 0); transform: translate(calc((1 - var(--o, 0)) * -30px), 0); box-shadow: var(--soft); }
.only .ico { width: 16px; height: 16px; stroke: #fff; }

/* ---------- 1. kit ---------- */
.s-kit { --g: 0; --ki: 0; }
.kitchips .chip { position: absolute; left: 0; top: 0; --cf: 17px; background: #fff; border-color: var(--line); box-shadow: var(--soft);
  transform: translate(calc(var(--x) + var(--dx) * var(--g) - 50%), calc(var(--y) + var(--dy) * var(--g) - 50%)) scale(calc(1 - var(--g) * .55));
  opacity: calc(var(--ki) * (1 - var(--g) * var(--g))); }
.plancard { position: absolute; left: 0; top: 0; width: var(--w); transform: translate(var(--x), var(--y)); }
.pc-head { display: flex; flex-direction: column; gap: 4px; padding: 18px 22px 14px; background: #fff; border-radius: 22px 22px 0 0; opacity: var(--r, 1); transform: translateY(calc((1 - var(--r, 1)) * -16px)); }
.pc-head b { font: 700 19px/1.2 var(--body); }
.pc-head span { font-size: 14px; color: var(--muted); }
.plancard .row { display: block; width: 100%; height: auto; background: #fff; border-top: 1px solid var(--line); opacity: var(--r, 1); transform: translateX(calc((1 - var(--r, 1)) * var(--sx, 60px))); }
.plancard .row:nth-child(odd) { --sx: -60px; }
.plancard .row:last-child { border-radius: 0 0 22px 22px; }
.plancard { border-radius: 22px; box-shadow: 0 18px 30px -6px rgba(43,35,32,calc(var(--sh, 1) * .16)); }

/* ---------- 2. coach (dark) ---------- */
.s-coach .bgfill, .s-live .bgfill { background: var(--night); }
.s-coach, .s-live { color: var(--night-ink); }
.panel3d { position: absolute; left: 0; top: 0; width: var(--w); aspect-ratio: 492 / 358; border-radius: 26px; overflow: hidden; background: var(--hero);
  transform: translate(var(--x), var(--y)) scale(calc(.88 + var(--r, 1) * .12)); opacity: var(--r, 1); box-shadow: 0 40px 80px -30px rgba(0,0,0,.7); z-index: 2; }
.panel3d img, .panel3d video { position: absolute; width: 109.756%; max-width: none; height: auto; left: -4.878%; top: -66.4%; }
.sat { position: absolute; left: 0; top: 0; width: var(--w); z-index: 1;
  transform: translate(calc(var(--x) + var(--bx) * (1 - var(--s, 1))), calc(var(--y) + var(--by) * (1 - var(--s, 1)))) scale(calc(.6 + var(--s, 1) * .4)); opacity: min(1, calc(var(--s, 1) * 2)); }
.sat img { display: block; width: 100%; height: auto; border-radius: 20px; background: var(--bg); }

/* ---------- 3. live player ---------- */
.s-live { --lp: 1; --rs: 0; --ph: 0; --dn: 0; --up: 0; }
.lp { position: absolute; inset: 0; opacity: calc(var(--lp) * (1 - var(--rs))); transform: scale(calc(1 - var(--rs) * .08)); }
.lp-fig { position: absolute; left: 0; top: 0; width: var(--w); aspect-ratio: 492 / 355; transform: translate(var(--x), var(--y)); border-radius: 26px; overflow: hidden; background: var(--hero); }
.lp-fig img { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-fig .f-squat { opacity: var(--ph); }
.lp-count { position: absolute; left: 0; top: 0; width: var(--w); transform: translate(var(--x), var(--y)); display: grid; justify-items: center; color: var(--night-ink); }
.lp-t { font: 700 22px/1.2 var(--body); }
.lp-n { font: 400 200px/1 var(--body); letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin-top: 8px; }
.lp-of { font: 400 24px/1 var(--body); color: var(--night-muted); }
.lp-tempo { display: flex; gap: 8px; width: 100%; margin-top: 28px; }
.lp-tempo i { position: relative; height: 12px; border-radius: 99px; background: var(--night-3); overflow: hidden; }
.lp-tempo .dn { flex: 3; } .lp-tempo .up { flex: 1; }
.lp-tempo b { position: absolute; inset: 0; border-radius: 99px; background: var(--accent-hi); transform-origin: 0 50%; }
.lp-tempo .dn b { transform: scaleX(var(--dn)); } .lp-tempo .up b { transform: scaleX(var(--up)); }
.lp-tl { display: flex; justify-content: space-between; width: 100%; margin-top: 10px; }
.lp-tl em { font: 700 14px/1 var(--body); font-style: normal; letter-spacing: .12em; color: var(--accent-hi); }
.lp-tl em + em { color: var(--night-muted); }
.lp-set { justify-self: start; margin-top: 26px; display: flex; align-items: center; gap: 8px; font: 600 14px/1 var(--body); letter-spacing: .1em; color: var(--night-muted); }
.lp-set b { font: 700 34px/1 var(--body); color: var(--night-ink); letter-spacing: 0; margin-left: 4px; }
.lp-set i { width: 28px; height: 10px; border-radius: 99px; background: var(--night-3); }
.lp-set i.on { background: var(--accent-hi); }
.rest { position: absolute; left: 0; top: 0; width: var(--w); aspect-ratio: 1; transform: translate(var(--x), var(--y)) scale(calc(.8 + var(--rs) * .2)); opacity: var(--rs); }
.rest svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.r-bg { fill: none; stroke: var(--night-3); stroke-width: 8; }
.r-fg { fill: none; stroke: var(--accent-hi); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 552.9 552.9; }
.rest-in { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; }
.rest-l { font: 700 calc(var(--w) * .05)/1 var(--body); letter-spacing: .3em; color: var(--night-muted); }
.rest-n { font: 400 calc(var(--w) * .27)/1 var(--body); letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: calc(var(--w) * .03); }
.rest-b { font: 600 calc(var(--w) * .065)/1.2 var(--body); margin-top: calc(var(--w) * .03); }
.rest-x { font: 400 calc(var(--w) * .045)/1.2 var(--body); color: var(--night-muted); margin-top: 6px; }

/* ---------- 4. week rings ---------- */
.rings { position: absolute; left: 0; right: 0; top: var(--ry, 34svh); display: flex; justify-content: center; gap: var(--gap, 48px); }
.rings-k { position: absolute; left: 0; right: 0; top: -38px; text-align: center; font: 700 13px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--label); opacity: var(--sp, 1); }
.rg { position: relative; width: var(--rw, 200px); display: grid; justify-items: center; transform: translateX(calc(var(--off, 0px) * (1 - var(--sp, 1)))); }
.rg svg { width: 100%; height: auto; transform: rotate(-90deg); }
.rb { fill: none; stroke: var(--field); stroke-width: 9; }
.rf { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 314.2 314.2; stroke-dashoffset: 314.2; }
.rg b { position: absolute; top: calc(var(--rw, 200px) * .5); left: 0; right: 0; transform: translateY(-50%); text-align: center; font: 400 calc(var(--rw, 200px) * .3)/1 var(--body); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rg span, .rg em, .rg b { opacity: calc(var(--sp, 1) * 2 - 1); }
.rg span { margin-top: 14px; font: 700 17px/1.2 var(--body); }
.rg em { font-style: normal; font-size: 15px; color: var(--muted); margin-top: 2px; }
.rg2 { z-index: 2; }
.cal { position: absolute; left: 50%; top: var(--cy, 70svh); width: min(560px, 92vw); transform: translate(-50%, calc((1 - var(--r, 1)) * 24px)); opacity: var(--r, 1); }
.cal-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.cal-h b { font: 700 16px/1 var(--body); } .cal-h span { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.cal-h span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.cal-g { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; }
.cal-g i { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--hero); font: 600 12px/1 var(--body); font-style: normal; color: var(--muted); display: grid; place-items: center; }
.cal-g i.s::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: var(--accent); transform: scale(var(--d, 1)); opacity: var(--d, 1); }
.cal-g i.s { color: transparent; }
.cal-g i.t { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
.cal-g i.f { opacity: .45; }

/* ---------- 5. habits ---------- */
.heat { position: absolute; left: 0; top: 0; width: var(--w); transform: translate(var(--x), var(--y)); padding: 22px 24px 24px; border-radius: 26px; background: #fff; box-shadow: var(--soft); }
.heat-h { display: flex; justify-content: space-between; align-items: center; }
.heat-h b { font: 700 18px/1 var(--body); }
.heat-h span { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.heat-h span i { width: 12px; height: 12px; border-radius: 3px; }
.l0 { background: #FBF6EF; box-shadow: inset 0 0 0 1px var(--sand-2); } .l1 { background: #F2DFD8; } .l2 { background: #E2B5A7; } .l3 { background: #CC8770; } .l4 { background: var(--accent); }
.heat-m { display: grid; grid-template-columns: repeat(13, 1fr); margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
.heat-m span:nth-child(1) { grid-column: 1; } .heat-m span:nth-child(2) { grid-column: 2; } .heat-m span:nth-child(3) { grid-column: 6; } .heat-m span:nth-child(4) { grid-column: 10; }
.heat-g { display: grid; grid-template-columns: repeat(13, 1fr); grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 6px; }
.heat-g i { aspect-ratio: 1; border-radius: 22%; transform: scale(var(--t, 1)); opacity: var(--t, 1); }
.heat-g i.lv { position: relative; }
.heat-g i.gap { visibility: hidden; }
.heat-g i.lv::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--c); opacity: var(--fl, 1); }
.habit { position: absolute; left: 0; top: 0; width: var(--w); transform: translate(var(--x), calc(var(--y) + (1 - var(--r, 1)) * 40px)); opacity: var(--r, 1); padding: 22px 24px 20px; border-radius: 26px; background: #fff; box-shadow: var(--lift); }
.hb-top { display: flex; align-items: center; gap: 12px; }
.hb-top b { font: 700 22px/1.2 var(--body); }
.hb-tag { padding: 6px 12px; border-radius: 999px; background: var(--hero); font: 600 14px/1 var(--body); color: var(--muted); }
.hb-streak { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font: 600 17px/1.2 var(--body); color: var(--accent); }
.hb-streak b { font-variant-numeric: tabular-nums; }
.hb-streak .ico { width: 18px; height: 18px; }
.hb-beads, .hb-days { display: flex; gap: 12px; margin-top: 14px; }
.hb-days { margin-top: 6px; }
.hb-beads i { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--sand-2); }
.hb-beads i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); transform: scale(var(--b, 0)); opacity: var(--b, 0); }
.hb-beads i:last-child { box-shadow: inset 0 0 0 1.5px var(--ink); }
.hb-days span { width: 30px; text-align: center; font-size: 14px; color: var(--muted); }
.hb-tick { position: absolute; right: 24px; top: 50%; width: 76px; height: 76px; margin-top: -38px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--sand-2); }
.hb-tick i { position: absolute; inset: 0; border-radius: 50%; background: var(--accent); transform: scale(calc(.3 + var(--k, 0) * .7)); opacity: var(--k, 0); }
.hb-tick svg { position: absolute; inset: 24%; width: 52%; height: 52%; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: var(--k, 0); }
.hb-more { position: absolute; left: 0; right: 0; top: var(--my, 85svh); display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0 var(--gut); opacity: var(--r, 1); transform: translateY(calc((1 - var(--r, 1)) * 14px)); }
.hb-more span { padding: 9px 14px; border-radius: 999px; background: var(--hero); font: 600 14px/1 var(--body); color: var(--ink); white-space: nowrap; }

/* ---------- 6. goals ---------- */
.goal { position: absolute; left: 0; top: 0; width: var(--w); padding: 22px 24px 18px; border-radius: 24px; background: #fff; display: grid; grid-template-columns: 1fr auto; column-gap: 18px;
  transform: translate(calc(var(--x) + var(--dx) * (1 - var(--d, 1))), calc(var(--y) + var(--dy) * (1 - var(--d, 1)))) rotate(calc(var(--rz, 0deg) * (1 - var(--d, 1))));
  box-shadow: 0 calc(10px + var(--d, 1) * 10px) 34px -18px rgba(43,35,32,.4); }
.goal > b { grid-column: 1 / -1; font: 700 20px/1.25 var(--body); }
.g-t { grid-column: 1 / -1; font-size: 16px; color: var(--muted); margin-top: 4px; }
.g-n { grid-column: 1 / -1; font: 700 17px/1.2 var(--body); margin-top: 12px; }
.g-n em { font-style: normal; font-variant-numeric: tabular-nums; }
.g-bar { position: relative; height: 10px; margin-top: 16px; border-radius: 99px; background: var(--line); overflow: hidden; align-self: center; }
.g-bar i { position: absolute; inset: 0; border-radius: 99px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(calc(var(--f, 1) * var(--to))); }
.g1 { --to: .67; } .g2 { --to: .8; } .g3 { --to: .83; }
.g-p { margin-top: 16px; font: 700 16px/1 var(--body); color: var(--muted); align-self: center; opacity: var(--f, 1); }
.g-d { grid-column: 1 / -1; margin-top: 12px; font-size: 15px; color: var(--muted); }

/* ---------- 7. the rest of you ---------- */
.s-rest { --a: 1; }
.pl { position: absolute; left: 0; top: 0; width: var(--w);
  transform: translate(calc(var(--x) + var(--px) * (1 - var(--a))), calc(var(--y) + var(--py) * (1 - var(--a)))) rotate(calc(var(--pr) * (1 - var(--a)))); }
.pl small { display: block; margin: 0 0 8px 4px; font: 700 12px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--label); opacity: var(--a); }
.pl img { display: block; width: 100%; height: auto; border-radius: calc(var(--w) * .052); box-shadow: 0 14px 22px -6px rgba(43,35,32,.16); }
.games { position: absolute; left: 0; right: 0; bottom: clamp(24px, 5svh, 48px); margin: 0; text-align: center; font: 600 16px/1.3 var(--body); color: var(--muted); opacity: var(--r, 1); }

/* ---------- 8. only you ---------- */
.lock-t { position: absolute; left: 0; top: 0; margin: 0; width: var(--w); transform: translate(var(--x), calc(var(--y) + (1 - var(--r, 1)) * 24px)); opacity: var(--r, 1); font: 750 clamp(64px, 8vw, 128px)/.92 var(--display); letter-spacing: -.045em; }
.lock-s { position: absolute; left: 0; top: 0; margin: 0; width: var(--w); transform: translate(var(--x), calc(var(--y) + (1 - var(--r, 1)) * 24px)); opacity: var(--r, 1); font: 400 clamp(17px, 1.4vw, 20px)/1.45 var(--body); color: var(--muted); }
.lock-ph { position: absolute; left: 0; top: 0; transform: translate(var(--x), var(--y)); }
.lock { position: absolute; left: 0; top: 0; width: var(--w); aspect-ratio: 1; transform: translate(var(--x), var(--y)) scale(calc(.5 + var(--l, 1) * .5)); opacity: var(--l, 1); border-radius: 50%; background: var(--ink); display: grid; place-items: center; box-shadow: var(--lift); }
.lock svg { width: 52%; height: auto; }
.lock .bd { fill: var(--accent); }
.lock .sh { fill: none; stroke: #fff; stroke-width: 11; stroke-linecap: round; transform: translateY(calc((1 - var(--c, 1)) * -20px)); }
.lock .kh { fill: var(--ink); stroke: var(--ink); stroke-width: 6; stroke-linecap: round; }

@media (max-width: 719px) {
  /* phones: a bigger phone that runs off the bottom edge, so its screen reads */
  .me-xr { --w: min(272px, 74vw); left: calc(50% - var(--w) / 2); top: calc(clamp(78px, 11svh, 104px) + clamp(52px, 15vw, 72px) * 1.02 + 92px); }
  .mob .me-xr { --es: .5; }
  .only { left: calc(50% - 96px); top: 2%; font-size: 13px; padding: 9px 14px; }
  /* kit chips settle into a row under the plan instead of vanishing */
  .kitchips .chip { transform: translate(calc(var(--x) + var(--dx) * var(--g) - 50%), calc(var(--y) + var(--dy) * var(--g) - 50%)); opacity: var(--ki); }
  .plancard { border-radius: 18px; }
  .kitchips .chip { --cf: 14px; }
  .pc-head { padding: 14px 16px 10px; border-radius: 18px 18px 0 0; }
  .pc-head b { font-size: 16px; } .pc-head span { font-size: 12.5px; }
  .plancard .row:last-child { border-radius: 0 0 18px 18px; }
  .panel3d, .lp-fig { border-radius: 18px; }
  .sat img { border-radius: 14px; }
  .lp-t { font-size: 16px; }
  .lp-n { font-size: 112px; margin-top: 2px; }
  .lp-of { font-size: 17px; }
  .lp-tempo { margin-top: 14px; } .lp-tempo i { height: 9px; }
  .lp-tl em { font-size: 11px; }
  .lp-set { display: none; }
  .rg span { font-size: 13px; margin-top: 10px; } .rg em { font-size: 12px; }
  .cal { width: calc(100vw - 32px); }
  .cal-h b { font-size: 15px; }
  .cal-g { grid-template-columns: repeat(7, 1fr); gap: 5px; } .cal-g i { border-radius: 9px; font-size: 13px; }
  .heat { padding: 16px 16px 18px; border-radius: 20px; }
  .heat-h b { font-size: 15px; } .heat-h span { font-size: 11px; } .heat-h span i { width: 9px; height: 9px; }
  .heat-m { font-size: 11px; margin: 10px 0 6px; }
  .heat-g { gap: 4px; }
  .habit { padding: 16px 16px 14px; border-radius: 20px; }
  .hb-top b { font-size: 17px; } .hb-tag { font-size: 12px; padding: 5px 10px; }
  .hb-streak { font-size: 14px; }
  .hb-beads, .hb-days { gap: 8px; }
  .hb-beads i { width: 24px; height: 24px; } .hb-days span { width: 24px; font-size: 12px; }
  .hb-tick { width: 54px; height: 54px; margin-top: -27px; right: 16px; }
  .hb-more span { font-size: 12.5px; padding: 8px 11px; }
  .goal { padding: 16px 18px 14px; border-radius: 20px; }
  .goal > b { font-size: 16px; } .g-t { font-size: 13px; } .g-n { font-size: 14px; margin-top: 8px; }
  .g-bar { margin-top: 12px; height: 8px; } .g-p { margin-top: 12px; font-size: 13px; } .g-d { font-size: 12.5px; margin-top: 8px; }
  /* phones: three cards stacked whole; the assistant lives on the Plan page */
  .pl small { display: none; }
  .pl-ai { display: none; }
  .games { top: var(--gy, auto); bottom: auto; font-size: 14px; padding: 0 var(--gut); }
  .lock-t { font-size: clamp(52px, 15vw, 72px); text-align: center; }
  .lock-s { font-size: 16px; text-align: center; }
}
html:not(.mob) .games { left: 0; right: auto; top: 0; bottom: auto; width: var(--w); padding: 18px 20px; border-radius: 20px; background: var(--hero); text-align: left; color: var(--ink);
  transform: translate(var(--x), calc(var(--y) + (1 - var(--r, 1)) * 16px)); }
