/* FlexifyAI. Mobile first: works from 360 px with 16 px side gutters, calm colours, large
   readable text, buttons at least 48 px high. Phone: the menu is a bar at the bottom. */
@font-face { font-family: "CoachSans"; src: url("../fonts/NotoSans-SemiBold-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --bg: #f3f7f5;
  --bg-2: #e6efeb;
  --card: #ffffff;
  --ink: #1f2f2c;
  --ink-soft: #52635f;
  --teal: #24635b;
  --teal-dark: #194a44;
  --mint: #7cc4aa;
  --mint-soft: #dff1ea;
  --sky: #3b7bbf;
  --sky-soft: #e3eef9;
  --sand: #f6ecd9;
  --sand-ink: #6e4d12;
  --coral: #c2563f;
  --coral-soft: #fbe6df;
  --line: #d3e2dc;
  --focus: #1d5fd1;
  --shadow: 0 6px 18px rgba(20, 60, 50, .10);
  --radius: 20px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; scroll-padding-bottom: 96px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "CoachSans", "Noto Sans", system-ui, sans-serif; font-size: 18px; line-height: 1.55; overflow-x: hidden; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
h1, h2, h3 { line-height: 1.22; margin: 0 0 .45em; color: var(--teal-dark); }
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
p { margin: 0 0 .8em; }
a { color: var(--teal); }
button { font: inherit; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 14px; border-radius: 10px; z-index: 30; }
.skip:focus { left: 8px; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 10px; }
main:focus { outline: none; }
.hidden { display: none !important; }
.small { font-size: 16px; }
.soft { color: var(--ink-soft); }
.lead { font-size: 19px; color: var(--ink-soft); max-width: 68ch; }
.loading { padding: 40px 16px; text-align: center; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.ok { color: var(--teal); font-weight: 800; }
.warn { background: var(--sand); color: var(--sand-ink); border-radius: 14px; padding: 10px 14px; }

/* ---- header, menu, footer ---- */
.top { background: var(--card); border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-soft); font-size: 13px; line-height: 1.1; }
.brand img { border-radius: 10px; }
.brand b { display: block; font-size: 21px; color: var(--teal-dark); }
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border-top: 2px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); z-index: 20; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; text-decoration: none; color: var(--ink-soft); font-size: 13px; border-radius: 14px; }
.nav a .ic { width: 26px; height: 26px; }
.nav a[aria-current="page"] { color: var(--teal-dark); background: var(--mint-soft); }
.foot { margin-top: 40px; padding: 18px 0 8px; border-top: 2px solid var(--line); color: var(--ink-soft); font-size: 16px; }
.foot p { margin: 0 0 4px; }
.foot .ic { color: var(--coral); }

/* ---- shared blocks ---- */
.page { padding-top: 18px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.safety, .privacy { display: flex; gap: 12px; align-items: flex-start; border-radius: 18px; padding: 14px 16px; margin: 14px 0; }
.safety { background: var(--coral-soft); color: #6d2a1c; border: 2px solid #f1c7ba; }
.safety .ic { color: var(--coral); width: 28px; height: 28px; margin-top: 2px; }
.safety b, .privacy b { display: block; font-size: 19px; }
.safety p, .privacy p { margin: 2px 0 0; }
.safety.short { padding: 8px 14px; margin: 8px 0 14px; font-size: 16px; align-items: center; }
.safety.short .ic { width: 22px; height: 22px; margin: 0; }
.privacy { background: var(--sky-soft); color: #1d3f63; border: 2px solid #c6dbf1; }
.privacy .ic { color: var(--sky); width: 28px; height: 28px; margin-top: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 22px; border: 0; border-radius: 999px; background: var(--teal); color: #fff; font-weight: 800; font-size: 18px; text-decoration: none; cursor: pointer; box-shadow: 0 3px 0 var(--teal-dark); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--teal-dark); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.big { min-height: 60px; font-size: 21px; padding: 10px 30px; }
.btn.small { min-height: 44px; font-size: 16px; padding: 6px 16px; }
.btn.ghost { background: var(--card); color: var(--teal-dark); border: 2px solid var(--line); box-shadow: none; }
.btn.danger { background: var(--coral); box-shadow: 0 3px 0 #94402e; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.backlink { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; text-decoration: none; font-weight: 800; }
.modes { display: inline-flex; flex-wrap: wrap; gap: 6px; background: var(--bg-2); border-radius: 999px; padding: 5px; margin: 4px 0 12px; }
.seg { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 6px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); font-weight: 800; cursor: pointer; }
.seg[aria-pressed="true"] { background: var(--card); color: var(--teal-dark); box-shadow: var(--shadow); }

/* ---- home ---- */
.hero { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: center; }
.hero h1 { font-size: 30px; }
.hero-pic { display: flex; justify-content: center; }
.hero-fig { width: 190px; }
.hero-link { display: block; border-radius: 22px; }
.pills { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 15px; color: var(--teal-dark); }
.choose { margin-top: 26px; }
.choices { display: grid; grid-template-columns: 1fr; gap: 14px; }
.choice-wrap { display: flex; flex-direction: column; gap: 8px; }
.choice-wrap .choice { flex: 1; }
.choice { display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; text-decoration: none; color: var(--ink); border: 3px solid transparent; min-height: 110px; }
.choice:hover { border-color: var(--mint); }
.choice-ic { grid-row: 1 / span 2; width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; }
.choice-ic .ic { width: 32px; height: 32px; }
.choice.c1 .choice-ic { background: var(--teal); }
.choice.c2 .choice-ic { background: var(--sky); }
.choice.c3 .choice-ic { background: #8a6bb8; }
.choice-title { font-size: 22px; font-weight: 800; color: var(--teal-dark); }
.choice-text { color: var(--ink-soft); font-size: 17px; }
.choice-links { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-link { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 14px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); text-decoration: none; font-weight: 800; font-size: 16px; }
.home-progress { display: flex; gap: 8px; align-items: center; margin-top: 20px; }

/* ---- lists ---- */
.cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px 12px 12px; text-decoration: none; color: var(--ink); border: 3px solid transparent; }
a.card:hover { border-color: var(--mint); }
.card .still { width: 104px; height: 104px; flex: none; background: var(--mint-soft); border-radius: 16px; }
.card .card-pic { width: 84px; height: 122px; flex: none; object-fit: cover; object-position: center top; background: var(--mint-soft); border-radius: 16px; }
.routine-pics { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.routine-pics > *, .card .routine-pics > svg.still { width: 52px; height: 76px; flex: none; object-fit: cover; object-position: center top; background: var(--mint-soft); border-radius: 10px; }
.card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-title { font-size: 21px; font-weight: 800; color: var(--teal-dark); }
.card-text { color: var(--ink); }
.card-meta { color: var(--ink-soft); font-size: 15px; }
.card.routine { padding: 18px; }
.card.routine .btn { align-self: flex-start; margin-top: 8px; }
.routine-list { margin: 6px 0; padding-left: 22px; color: var(--ink-soft); font-size: 16px; }

/* ---- a stretch or routine ---- */
.sess-head h1 { margin-bottom: 2px; }
.sess-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "fig cam" "coach coach"; gap: 12px; }
.sess-grid.nocam { grid-template-areas: "fig fig" "coach coach"; }
.sess-grid.nocam .cam-card, .sess-grid .photo-card, .sess-grid.photo .cam-card { display: none; }
.sess-grid.photo .photo-card { display: block; grid-area: cam; }
.coach { grid-area: coach; }
.fig-card { grid-area: fig; padding: 10px; text-align: center; }
.cam-card { grid-area: cam; padding: 10px; }
.fig-card canvas { width: 100%; max-width: 280px; aspect-ratio: 1 / 1; height: auto; background: var(--mint-soft); border-radius: 16px; }
.fig-cap { font-size: 15px; color: var(--ink-soft); margin: 0 0 6px; }
.fig-note { font-size: 15px; color: var(--sand-ink); margin: 6px 0 0; }
.fig-note:empty { display: none; }
.camview, .photoview { position: relative; width: 100%; aspect-ratio: 1 / 1; background: #23302d; border-radius: 16px; overflow: hidden; }
.camview canvas, .photoview canvas { width: 100%; height: 100%; display: block; }
.camoff { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; text-align: center; padding: 12px; color: #d8ebe4; font-size: 14px; }
.camoff .ic { width: 30px; height: 30px; }
.cam-msg { font-size: 15px; margin: 8px 0 0; }
.cam-msg:empty { display: none; }
.privacy-line { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); margin: 8px 0 0; }
.camfail { background: var(--sand); color: var(--sand-ink); border-radius: 14px; padding: 10px 12px; margin-top: 8px; font-size: 16px; }
.camfail .btn { margin-top: 4px; }
.session > .camfail, .session > div > .camfail { margin: 0 0 12px; }
.ex-name { font-size: 22px; margin: 0; }
.step-label { font-weight: 800; color: var(--ink-soft); margin: 0 0 8px; }
.valbox { background: var(--bg); border-radius: 16px; padding: 10px 14px 8px; border: 3px solid transparent; transition: border-color .2s; }
.timer-mode .valbox { display: none; }
.valbox.in { border-color: var(--mint); background: var(--mint-soft); }
.valbox.plenty { border-color: #e6b35c; background: var(--sand); }
.valtop { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.valwhat { font-weight: 800; color: var(--ink-soft); }
.bigval { font-size: 44px; font-weight: 800; color: var(--teal-dark); line-height: 1.1; font-variant-numeric: tabular-nums; }
.gauge { position: relative; height: 18px; background: #dfe6e3; border-radius: 999px; margin: 8px 0 4px; }
.g-band { position: absolute; top: 0; bottom: 0; background: var(--mint); border-radius: 999px; }
.g-easy { position: absolute; top: -5px; bottom: -5px; width: 4px; margin-left: -2px; background: #d4962b; border-radius: 2px; }
.g-ptr { position: absolute; top: -7px; width: 14px; height: 32px; margin-left: -7px; background: var(--teal-dark); border: 3px solid #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: left .15s; }
.gauge-row { display: flex; gap: 16px; font-size: 14px; color: var(--ink-soft); }
.g-cap { display: inline-flex; align-items: center; gap: 6px; }
.g-cap i { display: inline-block; width: 16px; height: 10px; border-radius: 4px; }
.sw-band { background: var(--mint); }
.sw-easy { background: #d4962b; width: 4px !important; }
.status { font-size: 20px; font-weight: 800; margin: 12px 0 4px; min-height: 1.55em; color: var(--teal-dark); }
.status.plenty, .status.other { color: var(--sand-ink); }
.status.nobody, .status.more { color: var(--ink-soft); }
.hint { min-height: 1.55em; margin: 0 0 6px; color: var(--sky); font-weight: 800; }
.bar { height: 14px; background: #dfe6e3; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 999px; transition: width .1s linear; }
.bar.rest i, .bar.ready i { background: var(--sky); }
.bar-text { font-size: 16px; color: var(--ink-soft); margin: 4px 0 0; min-height: 1.5em; font-variant-numeric: tabular-nums; }
.howbox { margin-top: 14px; }
.how { padding-left: 24px; margin: 0 0 10px; }
.how li { margin: 4px 0; }
.timer-mode .cam-only, .timer-mode .howbox .small { display: none; }
.finish { margin-top: 14px; background: var(--mint-soft); border: 3px solid var(--mint); border-radius: var(--radius); padding: 18px; }
.finish-title { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 800; color: var(--teal-dark); margin: 0 0 4px; }

/* ---- Photo mode ---- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.photo-card { padding: 12px; }
.photo-card h3 { margin-bottom: 2px; }
.photo-card .controls { margin-top: 10px; }
.photo-credit { font-size: 13px; color: var(--ink-soft); margin: 4px 0 0; overflow-wrap: anywhere; }
.photo-credit:empty { display: none; }
.photo-verdict { border-radius: 14px; padding: 10px 12px; margin-top: 8px; background: var(--bg); border: 2px solid var(--line); font-size: 17px; }
.photo-verdict:empty { display: none; }
.photo-verdict b { display: block; color: var(--teal-dark); }
.photo-verdict p { margin: 4px 0 0; }
.photo-verdict.good { background: var(--mint-soft); border-color: var(--mint); }
.photo-verdict.some { background: var(--sky-soft); border-color: #c6dbf1; }
.photo-verdict.low, .photo-verdict.bad { background: var(--sand); border-color: #e6b35c; }
.photo-verdict.low b, .photo-verdict.bad b { color: var(--sand-ink); }
.photo-hint { color: var(--sky); font-weight: 800; }
.samples { margin-top: 10px; }
.samples > p { margin: 0 0 4px; }
.sample-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.sample-group { display: flex; flex-direction: column; gap: 4px; }
.sample-group .sample-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.sample { padding: 0; border: 3px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; width: 78px; height: 78px; overflow: hidden; }
.sample img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sample[aria-pressed="true"] { border-color: var(--teal); }
.photo-note { margin: 6px 0 0; font-size: 14px; }
.posture-grid .photo-card .photoview { max-width: 420px; margin: 0 auto; }

/* ---- posture ---- */
.posture-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.posture-grid .cam-card { grid-area: auto; }
.posture-grid .cam-card .camview { max-width: 420px; margin: 0 auto; }
.scorebox { transition: opacity .2s; }
.scorebox.dim { opacity: .45; }
.score-cap { font-weight: 800; color: var(--ink-soft); margin: 0 0 6px; text-align: center; }
.ring { --p: 0; width: 150px; height: 150px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(closest-side, var(--card) 76%, transparent 78%), conic-gradient(var(--ring, var(--mint)) calc(var(--p) * 1%), #e3eae7 0); }
.ring.good { --ring: var(--mint); }
.ring.some { --ring: #e6b35c; }
.ring.low { --ring: var(--coral); }
.score-num { font-size: 44px; font-weight: 800; color: var(--teal-dark); }
.prow { display: grid; grid-template-columns: 1fr 90px 74px; gap: 8px; align-items: center; margin: 6px 0; font-size: 16px; }
.pbar { height: 12px; background: #e3eae7; border-radius: 999px; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 4%; background: var(--mint); }
.prow.some .pbar i { background: #e6b35c; }
.prow.much .pbar i { background: var(--coral); }
.pword { font-weight: 800; text-align: right; }
.two { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
.two ul { margin: 0; padding-left: 22px; }
.two li { margin: 4px 0; }
.cansee h3 { color: var(--teal); }
.cannot h3 { color: var(--sand-ink); }
.breakbox { margin-top: 14px; }
.breakbox h3 { display: flex; align-items: center; gap: 8px; }
.breaks .seg { padding: 6px 14px; }

/* ---- progress ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 8px; text-align: center; }
.stat b { display: block; font-size: 38px; color: var(--teal-dark); line-height: 1.1; }
.stat span { font-size: 15px; color: var(--ink-soft); }
.best { list-style: none; padding: 0; margin: 0; }
.best li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 2px solid var(--bg-2); }
.best li:last-child { border-bottom: 0; }
.clear-area { margin-top: 20px; }

/* ---- toasts ---- */
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); background: var(--card); color: var(--ink); border: 3px solid var(--mint); border-radius: 18px; padding: 12px 18px; z-index: 40; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); display: flex; flex-direction: column; gap: 4px; transition: opacity .5s; }
.toast b { font-size: 20px; color: var(--teal-dark); }
.toast.remind { border-color: #e6b35c; }
.toast.break { border-color: var(--sky); }
.toast.gone { opacity: 0; }
.toast-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ---- "Page looks old? Get the newest version" (js/fresh.js, same as the AI Lab) ---- */
.fresh-link { background: none; border: 0; padding: 8px 0; margin: 0; font: inherit; font-size: 15px; color: var(--ink-soft); text-decoration: underline; cursor: pointer; min-height: 44px; }
.fresh-link:hover { color: var(--ink); }
dialog.fresh { width: min(580px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; border: 0; border-radius: 24px; padding: 22px 20px 18px; background: var(--card); color: var(--ink); box-shadow: 0 20px 50px rgba(0, 0, 0, .3); font: inherit; line-height: 1.45; }
dialog.fresh::backdrop { background: rgba(20, 40, 36, .45); }
.fresh h2 { margin: 0 40px 8px 0; font-size: 24px; line-height: 1.2; }
.fresh h3 { margin: 18px 0 6px; font-size: 19px; }
.fresh h4 { margin: 10px 0 2px; font-size: 16px; color: var(--teal); }
.fresh p { margin: 6px 0; }
.fresh ol { margin: 2px 0 6px; padding-left: 24px; }
.fresh li { margin: 3px 0; }
.fresh-x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
.fresh-go { display: flex; width: 100%; align-items: center; justify-content: center; min-height: 60px; margin: 14px 0 6px; padding: 10px 22px; border: 0; border-radius: 999px; background: var(--teal); color: #fff; font: inherit; font-weight: 800; font-size: 21px; cursor: pointer; box-shadow: 0 3px 0 var(--teal-dark); }
.fresh-go[disabled] { opacity: .6; cursor: wait; }
.fresh-bar { height: 12px; border-radius: 999px; background: var(--bg-2); overflow: hidden; margin: 8px 0 2px; }
.fresh-bar i { display: block; height: 100%; width: 0; background: var(--mint); }
.fresh-bar[hidden] { display: none; }
.fresh-status { min-height: 1.45em; font-weight: 800; }
.fresh-status.ok { color: var(--teal); }
.fresh-status.bad { color: var(--coral); }
.fresh-hand { border-top: 2px solid var(--line); margin-top: 12px; }
.fresh-group { background: var(--bg); border-radius: 16px; padding: 4px 14px 6px; margin: 8px 0; }
.fresh-note { font-size: 15px; color: var(--ink-soft); }
.fresh-note.warn { background: var(--sand); color: var(--sand-ink); border-radius: 12px; padding: 8px 12px; }
.fresh-close { display: block; margin: 12px auto 0; min-height: 44px; padding: 6px 22px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; }
.fresh-toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); background: var(--mint-soft); color: var(--teal-dark); border: 3px solid var(--mint); border-radius: 18px; padding: 10px 18px; font-weight: 800; z-index: 60; box-shadow: var(--shadow); transition: opacity .5s; text-align: center; }
.fresh-toast.gone { opacity: 0; }

/* ---- laptop ---- */
@media (min-width: 760px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .cards.wide { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr 260px; gap: 30px; }
  .hero-fig { width: 250px; }
  .choices { grid-template-columns: repeat(3, 1fr); }
  .choice { grid-template-columns: 1fr; grid-template-rows: auto; row-gap: 8px; align-content: start; }
  .choice-ic { grid-row: auto; }
  .two { grid-template-columns: 1fr 1fr; }
  .posture-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
@media (min-width: 980px) {
  html { scroll-padding-bottom: 16px; }
  body { padding-bottom: 0; }
  .nav { position: static; display: flex; gap: 4px; border: 0; padding: 0; background: none; }
  .nav a { flex-direction: row; min-height: 48px; padding: 0 14px; font-size: 16px; gap: 6px; }
  .nav a .ic { width: 22px; height: 22px; }
  h1, .hero h1 { font-size: 36px; }
  .sess-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr) minmax(0, 1fr); grid-template-areas: "coach fig cam"; align-items: start; }
  .sess-grid.nocam { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "coach fig"; }
  .toast, .fresh-toast { bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .bar i, .g-ptr, .toast { transition: none; }
}

/* ---- body template (js/template.js) ---- */
.tpl-slot { display: block; }
.tpl-demo { text-align: left; }
.tpl-stage { display: flex; justify-content: center; }
svg.tpl { display: block; width: 100%; max-width: 300px; aspect-ratio: 240 / 272; height: auto; background: var(--mint-soft); border-radius: 16px; touch-action: manipulation; }
svg.tpl .mus, svg.tpl .fas, svg.tpl .jnt { cursor: pointer; }
svg.tpl .mus.picked { stroke: #1f2f2c; stroke-width: 2.2; stroke-opacity: 1; }
svg.tpl .tlabel { paint-order: stroke; stroke: rgba(255, 255, 255, .92); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
svg.tpl-still { pointer-events: none; }
.card svg.still { width: 92px; height: 104px; flex: none; }
.tpl-box { margin-top: 12px; }
.hero-fig.tpl-demo { width: 200px; height: 200px; border-radius: 50%; overflow: hidden; background: var(--mint-soft); }
.hero-fig svg.tpl { max-width: none; border-radius: 0; height: 100%; width: auto; margin: 0 auto; }
.tpl-layers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 4px; }
.tpl-show { font-size: 14px; font-weight: 800; color: var(--ink-soft); margin-right: 2px; }
.tpl-lay { min-height: 40px; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink-soft); font-weight: 800; font-size: 14px; cursor: pointer; }
.tpl-lay[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.tpl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; color: var(--ink-soft); margin: 4px 0; }
.tpl-legend .sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-left: 6px; }
.tpl-legend .sw:first-child { margin-left: 0; }
.sw.str, .tpl-key.str { background: #f0602c; }
.sw.work, .tpl-key.work { background: #3d7fe0; }
.sw.behind { border: 1.5px dashed #8c4a3f; background: transparent; }
.tpl-info { min-height: 44px; font-size: 15px; background: var(--bg); border-radius: 12px; padding: 6px 10px; margin: 6px 0; }
.tpl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
.tpl-key { color: #fff; font-size: 13px; font-weight: 800; border-radius: 999px; padding: 2px 10px; }
.tpl-chip { min-height: 36px; padding: 2px 10px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; }
.tpl-chip.stretched { border-color: #f3a27c; }
.tpl-chip.working { border-color: #9cbdf0; }
.tpl-chip[aria-pressed="true"] { background: var(--sand); }
.tpl-review { display: inline-block; font-size: 13px; font-weight: 800; color: var(--sand-ink); background: var(--sand); border: 2px solid #ead7ae; border-radius: 999px; padding: 3px 12px; margin: 6px 0 0; }
.tpl-review.ok { color: var(--teal-dark); background: var(--mint-soft); border-color: var(--mint); }
.tpl-credit { font-size: 13px; color: var(--ink-soft); margin: 6px 0 0; }
.tpl-credit[hidden] { display: none; }
svg.tpl .tlabel.plain { stroke: none; }
svg.tpl .glow { animation: tplPulse 1.5s ease-in-out infinite alternate; }
@keyframes tplPulse { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { svg.tpl .glow { animation: none; } }

/* ---- the built-in person: the main picture (stretch pages, home, cards, posture example) ---- */
.person-view { display: block; }
.person-frame { position: relative; width: 100%; max-width: 300px; margin: 0 auto; aspect-ratio: 352 / 512; border-radius: 18px; overflow: hidden; background: var(--mint-soft); }
.person-frame.flip { transform: scaleX(-1); }
.person-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.person-img-top { position: absolute; inset: 0; opacity: 0; }
.person-img-top.on { opacity: 1; }
.person-img-top.fade { transition: opacity .26s ease-in-out; }
.person-steps { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 300px; margin: 8px auto 0; font-size: .9rem; color: var(--ink-soft); }
.person-steps.hidden { display: none; }
.person-step { width: 100%; }
.person-frame .person-muscles { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; aspect-ratio: auto; background: none; border-radius: 0; pointer-events: none; display: none; }
.person-frame.muscles-on .person-muscles { display: block; }
.person-glow { animation: tplPulse 1.5s ease-in-out infinite alternate; }
.hero-fig .person-frame { max-width: none; border-radius: 22px; box-shadow: var(--shadow); }
.fig-views { margin: 0 0 6px; }
.modes.small { padding: 4px; gap: 4px; margin: 0; }
.modes.small .seg { min-height: 40px; padding: 4px 12px; font-size: 15px; }
.person-key { justify-content: center; margin: 6px 0 2px; }
.person-key.hidden { display: none; }
.person-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 8px; margin-top: 6px; }
.fig-muscles { min-height: 44px; }

.posture-example { margin-bottom: 12px; }
.posture-example h3 { margin-top: 0; }
.posture-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.posture-fig { margin: 0; }
.posture-fig img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; background: var(--mint-soft); border: 3px solid transparent; }
.posture-fig.good img { border-color: var(--mint); }
.posture-fig.slouched img { border-color: #e6b35c; }
.posture-fig figcaption { display: flex; align-items: flex-start; gap: 6px; font-size: 15px; font-weight: 700; margin-top: 6px; }
.posture-fig figcaption .ic { width: 20px; height: 20px; flex: none; }
@media (min-width: 760px) { .posture-pair { max-width: 620px; } }
@media (prefers-reduced-motion: reduce) { .person-glow { animation: none; } .person-img-top.fade { transition: none; } }
