/* The exercise sheet: the 3D motion player (js/workout/motion.js), the 2D muscle map and the body
   figure (js/ui/body-figure.js). */
.ex-vis{display:flex;flex-direction:column;gap:10px;background:var(--tile-2);border-radius:14px;padding:12px}
.pick.center{justify-content:center}
.ex-facts{display:flex;flex-direction:column}
.ex-facts .kv{padding:9px 2px;font-size:.875rem}
.ex-facts .kv span{color:var(--ink-3)}
.ex-facts .kv b{font-weight:600;text-align:end}
.ex-ins{font-size:.94rem;color:var(--ink-2);line-height:1.55}
.ex-ins + .ex-ins{margin-top:6px}

/* ---------- 3D motion ---------- */
.mo [hidden]{display:none !important}
.mo-stage{position:relative;height:340px;border-radius:14px;overflow:hidden;background:var(--tile)}
.mo-stage canvas{display:block;width:100%;height:100%;touch-action:pan-y;cursor:grab}
.mo-stage canvas.gm-drag{cursor:grabbing}
.mo-load{position:absolute;inset:0;display:grid;place-items:center;font-size:.8125rem;color:var(--ink-3)}
.mo-load span{display:inline-flex;gap:8px;align-items:center}
.mo-load span::before{content:"";width:16px;height:16px;border-radius:50%;border:2px solid var(--line-2);border-top-color:var(--accent);animation:mo-spin .7s linear infinite}
@keyframes mo-spin{to{transform:rotate(360deg)}}
.mo-phase,.mo-rep,.mo-hint{position:absolute;pointer-events:none;font-size:.75rem;font-weight:600;border-radius:999px;background:var(--tile-2)}
.mo-phase{top:10px;right:10px;display:inline-flex;gap:6px;align-items:center;padding:4px 10px;color:var(--ink)}
.mo-phase i{width:8px;height:8px;border-radius:50%;background:var(--ink-3);transition:background-color .2s ease}
.mo-phase.work i{background:var(--danger)}
.mo-rep{top:10px;left:10px;padding:4px 9px;color:var(--ink-3);font-variant-numeric:tabular-nums}
.mo-rep:empty{display:none}
.mo-hint{bottom:10px;left:50%;translate:-50% 0;padding:3px 10px;font-weight:500;color:var(--ink-3);white-space:nowrap;transition:opacity .4s ease}
.mo-stage.touched .mo-hint{opacity:0}
.mo-ctl{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:10px}
.mo-seg{display:inline-flex;gap:14px;border-bottom:1px solid var(--line)}
.mo-seg button{padding:6px 0 8px;margin-bottom:-1px;border-bottom:2px solid transparent;font-size:.8125rem;font-weight:600;color:var(--ink-3)}
.mo-seg button[aria-pressed="true"]{color:var(--nav-on);border-bottom-color:var(--nav-on)}
.mo-btns{display:flex;gap:6px}
.mo-btn{height:36px;min-width:36px;padding:0 10px;border-radius:10px;background:var(--tile);color:var(--ink);font-size:.78rem;font-weight:600;display:inline-flex;align-items:center;justify-content:center}
.mo-btn svg{width:15px;height:15px}
.mo-btn[aria-pressed="true"][data-mo-slow]{background:var(--accent);color:var(--on-accent)}
/* the tabs over the stage: one per choice, a sliding card under the chosen one */
.mo-tabs{position:relative;display:grid;grid-auto-flow:column;grid-auto-columns:1fr;padding:3px;border-radius:12px;background:var(--line);touch-action:pan-y;user-select:none;-webkit-user-select:none}
.mo-tabs button{position:relative;z-index:1;display:grid;gap:1px;justify-items:center;min-height:44px;padding:5px 4px;border-radius:9px;color:var(--ink-3);transition:color .2s ease}
.mo-tabs b{font-size:.84rem;font-weight:700}
.mo-tabs small{font-size:.7rem;font-weight:500}
.mo-tabs button[aria-selected="true"]{color:var(--ink)}
.mo-opts{display:grid;gap:6px;margin-bottom:10px}
.mo-tabs-ink{position:absolute;top:3px;bottom:3px;inset-inline-start:calc(3px + (100% - 6px) * var(--i, 0) / var(--n, 1));width:calc((100% - 6px) / var(--n, 1));border-radius:9px;background:var(--tile);transition:inset-inline-start .25s ease}
.mo-cue{margin-top:12px;background:var(--tile);border-radius:12px;padding:10px 13px;min-height:72px}
.mo-cue small{display:block;font-size:.75rem;font-weight:700;color:var(--ink-3)}
.mo-cue p{margin:2px 0 0;font-size:.875rem;line-height:1.5;color:var(--ink)}
.mo-h{margin:14px 0 6px}
.mo-steps{display:grid;gap:4px;counter-reset:mo}
.mo-steps li{counter-increment:mo;display:grid;grid-template-columns:22px 1fr;gap:4px 8px;padding:7px 9px;border-radius:12px;font-size:.8125rem;color:var(--ink-2);transition:background-color .25s ease}
.mo-steps li::before{content:counter(mo);grid-row:span 2;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:.75rem;font-weight:700;background:var(--tile);color:var(--ink-3)}
.mo-steps li b{color:var(--ink);font-size:.78rem}
.mo-steps li.on{background:var(--wash)}
.mo-steps li.on::before{background:var(--accent);color:var(--on-accent)}
.mo-miss{list-style:disc;padding:0 18px 0 0;font-size:.8125rem;color:var(--ink-2);display:grid;gap:4px}
.mo-offer{margin-bottom:10px;width:100%}

/* ---------- 2D muscle map ---------- */
.mm-wrap{display:flex;flex-direction:column;gap:6px;text-align:center}
.mm-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.mm-head .link{background:var(--tile)}
.mm-head .link[disabled]{opacity:.6;cursor:default}
.bf-svg{width:100%;max-width:340px;display:block;margin:0 auto}
.mm-svg{max-width:280px}
.bf-body{fill:var(--bf-body);stroke:none}
.bf-m{fill:var(--bf-m);stroke:var(--bf-seam);stroke-width:1.3;stroke-linejoin:round;transition:fill .18s ease,opacity .18s ease}
.bf-cap{font-size:12px;fill:var(--ink-3)}
.bf-m.bf-p{fill:var(--mm-p);opacity:1}
.bf-m.bf-s{fill:var(--mm-s);opacity:.9}
/* The worked muscle pulses, the helping ones answer softer and later: told apart at a glance.
   transform-box:fill-box makes a scale on an SVG shape pivot on itself. */
.mm-svg .bf-p,.mm-svg .bf-s{transform-box:fill-box;transform-origin:center}
.mm-svg .bf-p{animation:mmPulse 1.9s ease-in-out infinite}
.mm-svg .bf-s{animation:mmPulseSoft 1.9s ease-in-out infinite;animation-delay:.42s}
.mm-still .mm-svg .bf-p,.mm-still .mm-svg .bf-s{animation:none}
@keyframes mmPulse{0%,100%{opacity:.62;transform:scale(1)}46%{opacity:1;transform:scale(1.09)}}
@keyframes mmPulseSoft{0%,100%{opacity:.45;transform:scale(1)}46%{opacity:.85;transform:scale(1.04)}}
.bf-interactive .bf-m{cursor:pointer}
.bf-interactive .bf-m.bf-on{fill:var(--accent);opacity:1;stroke:var(--tile)}
.bf-interactive .bf-m:focus-visible{outline:none;stroke:var(--decor);stroke-width:2.5}
.mm-legend{display:flex;gap:14px;justify-content:center;flex-wrap:wrap;font-size:.72rem;color:var(--ink-2)}
.mm-legend span{display:inline-flex;align-items:center;gap:5px}
.mm-key{width:9px;height:9px;border-radius:50%;display:inline-block}
.mm-key.mm-p{background:var(--mm-p)}
.mm-key.mm-s{background:var(--mm-s);opacity:.75}

@media (hover: hover) and (pointer: fine){
  .bf-interactive .bf-m:hover{fill:var(--secondary)}
}
/* A pulsing diagram is motion for its own sake to anyone who asked for less: hold the highlight. */
@media (prefers-reduced-motion: reduce){
  .mm-svg .bf-p,.mm-svg .bf-s{animation:none;opacity:1;transform:none}
  .mo-load span::before{animation:none}
  .mo-tabs-ink{transition:none}
}
